[Mono-bugs] [Bug 75704][Nor] New - Captured variables cause code to not run on msft

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Aug 3 21:57:21 EDT 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 bmaurer at users.sf.net.

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

--- shadow/75704	2005-08-03 21:57:21.000000000 -0400
+++ shadow/75704.tmp.32029	2005-08-03 21:57:21.000000000 -0400
@@ -0,0 +1,44 @@
+Bug#: 75704
+Product: Mono: Compilers
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: bmaurer at users.sf.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Captured variables cause code to not run on msft
+
+Compile this test case with mcs:
+
+class X {
+	delegate void D ();
+	static void Main ()
+	{
+		bool b = false;
+		D d = delegate {
+			b = true;
+		};
+		d ();
+	}
+}
+
+When the resulting code is run on Microsoft's framework, it will generate a
+MethodAccessException. The issue is that we generate:
+
+ .class nested assembly auto ansi '<>AnonHelp<0>'
+        extends [mscorlib]System.Object
+  {
+...
+    .method private hidebysig
+           instance default void '<#AnonymousMethod>0' ()  cil managed
+    {
+
+Which is clearly wrong.


More information about the mono-bugs mailing list