[Mono-bugs] [Bug 33628][Wis] New - mcs fails on initializing multi-dimensional array
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
11 Nov 2002 23:49:25 -0000
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by manyoso@yahoo.com.
http://bugzilla.ximian.com/show_bug.cgi?id=33628
--- shadow/33628 Mon Nov 11 18:49:25 2002
+++ shadow/33628.tmp.30143 Mon Nov 11 18:49:25 2002
@@ -0,0 +1,37 @@
+Bug#: 33628
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: manyoso@yahoo.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: mcs fails on initializing multi-dimensional array
+
+Try declaring this: int[][] blah = new int [][] {new int[] {1}, new int
+[]{2}};
+
+... and compiling with mcs. You'll get:
+
+error CS0029: Cannot convert implicitly from `int[]' to `int'
+
+while csc allows this.
+
+BTW, when you try and compile this line with mcs you get:
+
+int[][] blah = new int [][] {{1}, {2}};
+
+error CS0178: Incorrectly structured array initializer
+
+but csc gives:
+
+error CS0623: Array initializers can only be used in a variable or field
+initializer.