Closed
Description
openedon Jan 13, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment