[Mono-bugs] [Bug 77756][Maj] Changed - [GMCS] wrong code generation when using anonymous methods

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Mar 11 08:51:39 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 zulu99 at gmx.net.

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

--- shadow/77756	2006-03-10 11:21:26.000000000 -0500
+++ shadow/77756.tmp.25079	2006-03-11 08:51:39.000000000 -0500
@@ -2,13 +2,13 @@
 Product: Mono: Compilers
 Version: 1.1
 OS: other
 OS Details: fedora core 4
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Major
 Component: C#
 AssignedTo: rharinath at novell.com                            
 ReportedBy: flipper98 at gmx.net               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
@@ -111,6 +111,44 @@
             string[] textArray1 = new string[] { "1", "2", "3" };
             p<>1.<0:o> = new Program.O(textArray1);
             new
 Program.MethodInvoker(p<>1.<#AnonymousMethod>1).BeginInvoke(null, null);
       }
 }
+
+------- Additional Comments From zulu99 at gmx.net  2006-03-11 08:51 -------
+...and here is a testcase with irrelevant code removed:
+
+using System;
+class Program
+{
+    static void Main(string[] args)
+    {
+        Program p = new Program();
+        p.f(false);
+    }
+
+    public void f(bool anyCondition)
+    {
+        if (anyCondition)
+        {
+            MyDelegate d1 =
+                delegate
+                {
+                    Console.WriteLine("d1");
+                };
+            d1();
+        }
+
+        string s = "blah";
+
+        MyDelegate d2 =
+                delegate
+                {
+                    Console.WriteLine(s);
+                };
+        d2();
+    }
+
+    private delegate void MyDelegate();
+}
+


More information about the mono-bugs mailing list