Originally Title : "Mono 2.7: Array Initializer Bug"
I'm having an issue with mono where array initialization (at least for multidimensional arrays) does not work when inlined in a method call. It looks like the mono compiler is emitting the assignments after the method call.
For instance:
MathLib.PrintMatrix(new double[,] { {1.0, 1.0}, {1.0, 1.0} });
// Prints the following
// 0.0, 0.0
// 0.0, 0.0
However, the following code works correctly:
var myArray = new double[,] = { {1.0, 1.0}, {1.0, 1.0} };
MathLib.PrintMatrix(myArray);
// Prints the following
// 1.0, 1.0
// 1.0, 1.0
I couldn't find any release note addressing this issue, and I'm currently running an older version (which I don't want to update unless it's going to be benificial). Does anyone know if this bug has been fixed?
I don't have 2.7 (a beta for 2.8) around but I have something older (2.6.7 in Ubuntu)
and something a lot newer: 2.11 from git
So I believe your issue is related to using an old, unsupported beta release of Mono.