When compiling C# sources with mcs it transforms new int into Array.Empty<int>(). This causes problems in code that rightly expects that new-ing a class will return a unique instance.
From the C# spec:
Instances of classes are created using the new operator,
which allocates memory for a new instance,
invokes a constructor to initialize the instance, and
returns a reference to the instance.
As an array is a class it must conform to this spec, and I don't see anything in the spec file that allows the current transformation.
I also haven't seen any version of csc.exe apply this conversion either (including the Roslyn compiler included in mono trunk).
Additionally: I'm currently relying on the fact that doing "new something" returns references for which object.ReferenceEquals() returns false. This transformation invalidates that assumption.
*** Bug 51163 has been marked as a duplicate of this bug. ***
Fixed in master and Mono 4.8
That was quick! Thanks!