[Mono-bugs] [Bug 80573][Nor] New - Static anonymous methods are not static.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Jan 21 14:41:26 EST 2007


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=80573

--- shadow/80573	2007-01-21 14:41:26.000000000 -0500
+++ shadow/80573.tmp.29714	2007-01-21 14:41:26.000000000 -0500
@@ -0,0 +1,39 @@
+Bug#: 80573
+Product: Mono: Compilers
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: miguel at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Static anonymous methods are not static.
+
+The following program should print true, but instead prints false:
+
+using System;
+
+class Class1 {
+    delegate void Action ();
+
+    static void Main ()
+    {
+        Action a = delegate {
+            Console.WriteLine ("Task");
+        };
+	Console.WriteLine ("Target: {0}", a.Method.IsStatic);
+    }
+}
+
+This is problematic for dynamic invocations, as the parameters provided
+will not match the parameters that the code expects. 
+
+The above delegate should not be an instance method, it should be a static
+method.


More information about the mono-bugs mailing list