[Mono-bugs] [Bug 82660][Nor] New - Anonymous methods - invalid IL / MethodException

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Sep 2 12:43:12 EDT 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 contact at i-nz.net.

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

--- shadow/82660	2007-09-02 12:43:12.000000000 -0400
+++ shadow/82660.tmp.8487	2007-09-02 12:43:12.000000000 -0400
@@ -0,0 +1,44 @@
+Bug#: 82660
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: marek.safar at seznam.cz                            
+ReportedBy: contact at i-nz.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Anonymous methods - invalid IL / MethodException
+
+I have the code below [2], which gets compiled and works fine with mcs SVN
+Head(r85181), but MS doesn't like the IL code and throws the
+MethodException[1] I have attached dissassembly of c__CompilerGenerated1
+and the LoadWorkspace methods. Also attached a binary reproducer.
+
+[1]
+Unhandled Exception: System.MethodAccessException:
+<>c__CompilerGenerated1.<LoadWorkspace>c__4(System.Object,
+mwf_designer.ActiveDocumentChangedEventArgs)
+   at mwf_designer.MainView.LoadWorkspace()
+
+
+[2] 
+The code (all the accessed properties are public and all the methods and
+field are private;all are non-virtual):
+
+		private void LoadWorkspace ()
+		{
+			_workspace = new Workspace ();
+			_workspace.ActiveDocumentChanged += delegate (object sender,
+ActiveDocumentChangedEventArgs args) {
+				propertyGrid.ActiveComponents = new object[] { GetPrimarySelection
+(args.NewDocument) };
+			};
+			...
+		}


More information about the mono-bugs mailing list