[Mono-bugs] [Bug 82003][Nor] New - CS0103 error compiling anonymous method in combination with partial classes

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jul 3 16:33:18 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 gert.driesen at pandora.be.

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

--- shadow/82003	2007-07-03 16:33:18.000000000 -0400
+++ shadow/82003.tmp.25702	2007-07-03 16:33:18.000000000 -0400
@@ -0,0 +1,81 @@
+Bug#: 82003
+Product: Mono: Compilers
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CS0103 error compiling anonymous method in combination with partial classes
+
+To reproduce, compile the following code using gmcs (gmcs /target:library 
+Main.Designer.cs Main.cs):
+
+Main.Designer.cs:
+
+namespace Mono.Sms
+{
+  partial class Main
+  {
+  }
+}
+
+=======
+
+Main.cs:
+
+using Mono.Sms.Core;
+
+namespace Mono.Sms
+{
+  public partial class Main
+  {
+    public void Test ()
+    {
+      Contacts frm = new Contacts ();
+      frm.ContactsEventHandler += delegate () {
+        Agenda.AddContact ();
+      };
+    }
+  }
+
+  public partial class Contacts
+  {
+    public void Test ()
+    {
+      ContactsEventHandler ();
+    }
+
+    public delegate void ContactsHandler ();
+    public event ContactsHandler ContactsEventHandler;
+  }
+}
+
+namespace Mono.Sms.Core
+{
+  public class Agenda
+  {
+    public static void AddContact ()
+    {
+    }
+  }
+}
+
+=======
+
+Expected result:
+
+Successful compilation.
+
+Actual result:
+
+Main.cs(11,33): error CS0103: The name 'Agenda' does not exist in the 
+context of '<>c_CompilerGenerated0'


More information about the mono-bugs mailing list