[Mono-bugs] [Bug 54902][Wis] Changed - Invalid IL generated for iterator

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 27 Feb 2004 02:18:05 -0500 (EST)


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 miguel@ximian.com.

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

--- shadow/54902	2004-02-27 02:16:00.000000000 -0500
+++ shadow/54902.tmp.3145	2004-02-27 02:18:05.000000000 -0500
@@ -102,6 +102,33 @@
 	foreach (object o in (a + b)){
 		Console.WriteLine ("-> " + o);
 	}
 }
 }
 
+
+------- Additional Comments From miguel@ximian.com  2004-02-27 02:18 -------
+It is also failing with properties, because the swapped block is not
+being set up correctly, here is a test case:
+
+using System;
+using System.Collections; 
+ 
+public class X { 
+	public IEnumerator A {
+		get {
+			yield return 1;
+			yield return 2;
+		}
+	}
+} 
+ 
+class D {
+	static void Main ()
+	{
+		X a = new X ();
+
+		foreach (object o in a.A)
+			Console.WriteLine ("-> " + o);
+	}
+}
+