Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

dupdob
Copy link
Member

@dupdob dupdob commented Mar 4, 2024

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 rouke-broersma changed the title Ensure MutationControl class compiles with 'nullable' enabled fix: Ensure MutationControl compiles with 'nullable' enabled Mar 4, 2024
@rouke-broersma
Copy link
Member

@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
Copy link
Member Author

dupdob commented Mar 4, 2024

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

Copy link

sonarcloud bot commented Mar 4, 2024

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

@rouke-broersma rouke-broersma enabled auto-merge (squash) March 4, 2024 15:11
@rouke-broersma rouke-broersma merged commit 0fbd340 into master Mar 4, 2024
9 checks passed
@rouke-broersma rouke-broersma deleted the fix_2867 branch March 4, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants