[runtime] Fix Empty generic enumerator equality
authorAlexander Kyte <alexmkyte@gmail.com>
Mon, 2 Oct 2017 18:59:16 +0000 (14:59 -0400)
committerMarek Safar <marek.safar@gmail.com>
Fri, 6 Oct 2017 09:35:17 +0000 (11:35 +0200)
commit410bb8a57e23a901ea47d8a74f88a20972de423d
treef11942965e8a275fbd22bde087cf67785aa97ea8
parent74a87af7f580c59f524f79508e4ad32ccff0870a
[runtime] Fix Empty generic enumerator equality

On the CLR, two enumerators containing zero elements will
have reference equality if they are inflated with the same
generic type.

If comparing two enumerators which are not inflated (Array.Empty, for
instance), they are not equal when they contain zero elements.

This reference equality behavior is not compatible with treating
the enumerators as structs, as value types will not have reference
equality.
mcs/class/corlib/System/Array.cs
mcs/class/corlib/Test/System/ArrayTest.cs