Mono 2.6.7:数组初始化程序错误?
原标题:“Mono 2.7:数组初始化程序错误”
我遇到了单声道问题,其中数组初始化(至少对于多维数组)在方法调用中内联时不起作用。看起来单声道编译器在方法调用后发出赋值。
例如:
MathLib.PrintMatrix(new double[,] { {1.0, 1.0}, {1.0, 1.0} });
// Prints the following
// 0.0, 0.0
// 0.0, 0.0
但是,以下代码可以正常工作:
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
我找不到任何解决此问题的发行说明,并且我当前正在运行旧版本(我不想更新它,除非它是有益的)。有谁知道这个错误是否已修复?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有 2.7 (2.8 的测试版),但我有一些较旧的版本(Ubuntu 中的 2.6.7)
和更新的版本:来自 git 的 2.11
所以我相信你的问题与使用有关旧的、不受支持的 Mono 测试版。
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.