[Mono-bugs] [Bug 76591][Wis] Changed - gmcs does not compile cast on anonymous method

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Jan 2 09:16:20 EST 2006


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 at ximian.com.

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

--- shadow/76591	2005-11-04 10:49:26.000000000 -0500
+++ shadow/76591.tmp.31158	2006-01-02 09:16:20.000000000 -0500
@@ -34,6 +34,34 @@
 successful compile
 
 How often does this happen? 
 always
 
 Additional Information:
+
+------- Additional Comments From miguel at ximian.com  2006-01-02 09:16 -------
+Attached the example inline:
+
+using Console = System.Console;
+
+delegate void QueueHandler (Observable sender);
+
+class Observable {
+  public QueueHandler Queue;
+  public void notifyObservers () {
+    if (Queue != null) {
+      QueueHandler copy = new QueueHandler(Queue); // assign...
+      copy(this);
+    }
+  }
+  static void Main (string[] args) {
+    Observable o = new Observable();
+    for (int a = 0; a < args.Length; ++ a)
+#if MONO
+      o.Queue += new QueueHandler(delegate {
+Console.WriteLine("update"); });
+#else
+      o.Queue += (QueueHandler) delegate { Console.WriteLine("update"); };
+#endif
+    o.notifyObservers();
+  }
+}


More information about the mono-bugs mailing list