-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-System.Runtimein-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Description
Description
Default Equals
implementation compares only the first element of inline array.
Reproduction Steps
var a1 = new A();
a1[0]=1;
a1[1]=2;
var a2 = new A();
a2[0] = 1;
a2[1] = 1;
Console.WriteLine(a1.Equals(a2));
[InlineArray(2)]
struct A
{
public int? P;
}
This code prints true
sharplab
Expected behavior
Should compare all values in inline array and print false
in this case.
Actual behavior
Compares only the first element.
Regression?
No
Known Workarounds
Override Equals
Configuration
.net 8, Win 10
Other information
No response
ForNeVeR, Suchiman and AArnott
Metadata
Metadata
Assignees
Labels
area-System.Runtimein-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged