[Mono-bugs] [Bug 76874][Wis] New - mcs lets structs as iteration variables in a foreach loop. csc does not

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Dec 1 19:00:37 EST 2005


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 pibgeus at gmail.com.

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

--- shadow/76874	2005-12-01 19:00:37.000000000 -0500
+++ shadow/76874.tmp.32518	2005-12-01 19:00:37.000000000 -0500
@@ -0,0 +1,47 @@
+Bug#: 76874
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: pibgeus at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs lets structs as iteration variables in a foreach loop. csc does not
+
+Description of Problem:
+
+mcs lets structs as iteration variables in a foreach loop. csc does not
+
+Example of code:
+
+using System.Drawing;
+            ...
+Point[] puntos=new Point[64];
+System.Random r=new Random();
+foreach(Point p in puntos)
+{
+p.X=r.Next(this.Width);//A
+p.Y=r.Next(this.Height);//B
+}
+          ...
+
+Actual Results:
+
+- compiles ok for mcs.//wrong perform
+- does not compile for csc // right perform
+
+mcs version: 1.1.10.0
+csc version: 1.1.4322
+
+Expected Results:
+
+- two compilation erros:lines A and B: Cannot modify members of 'p' because
+it is a 'foreach iteration variable'


More information about the mono-bugs mailing list