-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Description
Encountered the following issue when trying to debug an incremental source generator false positive:
Minimal reproduction
[Fact]
public void ReturnsEqualValuesForEqualArguments()
{
var descriptor = new DiagnosticDescriptor(
id: "0001",
title: "title",
messageFormat: "Prameterized format {0}.",
category: "category",
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true);
string arg1 = new string('a', 5);
string arg2 = new string('a', 5);
Assert.Equal(arg1, arg2);
Assert.NotSame(arg1, arg2);
Diagnostic diag1 = Diagnostic.Create(descriptor, location: null, arg1);
Diagnostic diag2 = Diagnostic.Create(descriptor, location: null, arg2);
Assert.Equal(diag1, diag2); // Assertion failing
}The issue appears to be caused by the following line:
| && _messageArgs.SequenceEqual(other._messageArgs, (a, b) => a == b) |
Reactions are currently unavailable