Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[642975] Fix initializer of partially static multidimensional arrays
- Loading branch information
1 parent
6e5cb79
commit 0fe5c11
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Compiler options: -optimize | ||
using System; | ||
|
||
class Test | ||
{ | ||
static int Main () | ||
{ | ||
//switching to a constant fixes the problem | ||
double thisIsCausingTheProblem = 5.0; | ||
|
||
double[,] m1 = new double[4, 4] { | ||
{ 1.0, 0.0, 0.0, thisIsCausingTheProblem }, | ||
{ 0.0, 1.0, 0.0, thisIsCausingTheProblem }, | ||
{ 0.0, 0.0, 1.0, thisIsCausingTheProblem }, | ||
{ 0.0, 0.0, 0.0, 1.0 } | ||
}; | ||
|
||
var r = m1[0, 3]; | ||
if (r != 5) | ||
return 1; | ||
|
||
return 0; | ||
} | ||
} |