The following tests demonstrates this.
[Fact]
public void IStructuralEquatable_Equals_NullEqualityComparer_ThrowsNullReferenceException()
{
IStructuralEquatable structuralEquatable = ValueTuple.Create(1);
Assert.Throws<NullReferenceException>(() => structuralEquatable.Equals(Tuple.Create(1), null));
}
[Fact]
public void IStructuralEquatable_GetHashCode_NullEqualityComparer_ThrowsNullReferenceException()
{
IStructuralEquatable structuralEquatable = ValueTuple.Create(1);
Assert.Throws<NullReferenceException>(() => structuralEquatable.GetHashCode(null));
}
[Fact]
public void IStructuralComparable_CompareTo_NullEqualityComparer_ThrowsNullReferenceException()
{
IStructuralComparable structuralComparable = ValueTuple.Create(1);
Assert.Throws<NullReferenceException>(() => structuralComparable.CompareTo(Tuple.Create(1), null));
}
Spun off from #19265
/cc @karelz (who can help triage this :) )