-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Labels
Milestone
Description
In PR #24913, I fixed the case where s doesn't have an operator== and I also verified the case where s has operator==(S, S).
But while working on tuple equality, I thought of this scenario and it doesn't seem to work.
struct MyType
{
int i;
public MyType(int value)
{
i = value;
}
static void Main()
{
MyType? x = null;
_ = x == 0;
}
public static bool operator==(MyType x, int y)
=> x.i == y;
public static bool operator!=(MyType x, int y)
=> !(x == y);
public override bool Equals(object o) => throw null;
public override int GetHashCode() => throw null;
}Reactions are currently unavailable