stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.75k stars 176 forks source link

fix: Ensure MutationControl compiles with 'nullable' enabled #2869

Closed dupdob closed 4 months ago

dupdob commented 4 months ago

Ensure MutationControl class, which is injected into mutated code, compiles without warnings with 'nullable' option on while remaining compatible with C# 2 Fix issue #2867

rouke-broersma commented 4 months ago

@dupdob while I think it's good to have proper nullable code anyway, wouldn't we want to explicitly disable nullable for the injected code? #nullable disable Or does that not work on older target frameworks?

dupdob commented 4 months ago

you guessed right: it was the first thing I attempted, the pragma raises an error for pre CSharp 8. I did a couple of quick fixes (ensuring explicit initialization of fields), but I mainly disabled the warning. plus added a specific unit test

sonarcloud[bot] commented 4 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud