[Mono-bugs] [Bug 60332][Nor] New - Field initializer of multidimentional arrays not always run

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 17 Jun 2004 02:24:12 -0400 (EDT)


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 rshade@dvsconsulting.com.

http://bugzilla.ximian.com/show_bug.cgi?id=60332

--- shadow/60332	2004-06-17 02:24:12.000000000 -0400
+++ shadow/60332.tmp.10026	2004-06-17 02:24:12.000000000 -0400
@@ -0,0 +1,35 @@
+Bug#: 60332
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: OS 10.3
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: rshade@dvsconsulting.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Field initializer of multidimentional arrays not always run
+
+Multidimentional arrays are not being initialized when initialized with:
+
+class T
+{
+    int[,] i = new int[1,1];
+    ...
+}
+
+a reference to i[0,0] results in a NullReferenceException.
+
+However, this works:
+
+class T
+{
+    int[,] i2 = new int[,] { {0} }
+    ...
+}