-
Notifications
You must be signed in to change notification settings - Fork 221
More aggressive rollback for error CS0165 #3548
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -312,6 +312,11 @@ private string DisplayName(SyntaxNode initNode) => | |
| not null => initNode.Parent == null ? "whole file" : "the current node", | ||
| }; | ||
|
|
||
|
|
||
| // errors that must trigger a deep removal of mutations | ||
| // usage of uninitialized variables (165) | ||
| private static readonly HashSet<string> ErrorsRequiringRecursiveRemoval = ["CS0165"]; | ||
|
Comment on lines
+316
to
+318
|
||
|
|
||
| private Collection<SyntaxNode> IdentifyMutationsAndFlagForRollback(IEnumerable<Diagnostic> diagnosticInfo, | ||
| SyntaxNode rollbackRoot, out Diagnostic[] diagnostics) | ||
| { | ||
|
|
@@ -326,7 +331,7 @@ private Collection<SyntaxNode> IdentifyMutationsAndFlagForRollback(IEnumerable<D | |
| continue; | ||
| } | ||
|
|
||
| if (MutantPlacer.RequiresRemovingChildMutations(mutationIf)) | ||
| if (MutantPlacer.RequiresRemovingChildMutations(mutationIf) || ErrorsRequiringRecursiveRemoval.Contains(diagnostic.Id)) | ||
| { | ||
|
Comment on lines
+334
to
335
|
||
| FlagChildrenMutationsForRollback(mutationIf, brokenMutations); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment describing CS0165 as “usage of uninitialized variables” is inaccurate/misleading (CS0165 is “use of unassigned local variable”). Updating this comment to the correct wording will make it clearer why this diagnostic needs recursive rollback.