Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment thread
dupdob marked this conversation as resolved.
Outdated
private static readonly HashSet<string> ErrorsRequiringRecursiveRemoval = ["CS0165"];
Comment thread
dupdob marked this conversation as resolved.
Outdated

private Collection<SyntaxNode> IdentifyMutationsAndFlagForRollback(IEnumerable<Diagnostic> diagnosticInfo,
SyntaxNode rollbackRoot, out Diagnostic[] diagnostics)
{
Expand All @@ -326,7 +331,7 @@ private Collection<SyntaxNode> IdentifyMutationsAndFlagForRollback(IEnumerable<D
continue;
}

if (MutantPlacer.RequiresRemovingChildMutations(mutationIf))
if (MutantPlacer.RequiresRemovingChildMutations(mutationIf) || ErrorsRequiringRecursiveRemoval.Contains(diagnostic.Id))
{
Comment thread
dupdob marked this conversation as resolved.
Outdated
FlagChildrenMutationsForRollback(mutationIf, brokenMutations);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1154,9 +1154,9 @@ public TestableRunner(

public override void Dispose(bool disposing)
{
var disposedField = typeof(SingleMicrosoftTestPlatformRunner).GetField("_disposed",
var disposedField = typeof(SingleMicrosoftTestPlatformRunner).GetField("_disposed",
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);

var wasDisposedBefore = (bool)disposedField!.GetValue(this)!;

base.Dispose(disposing);
Expand Down
Loading