[Mono-bugs] [Bug 27811][Maj] New - mcs fails compiling code that adds a delegate to an event

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
16 Jul 2002 01:04:46 -0000


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 gonzalo@ximian.com.

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

--- shadow/27811	Mon Jul 15 21:04:46 2002
+++ shadow/27811.tmp.18877	Mon Jul 15 21:04:46 2002
@@ -0,0 +1,52 @@
+Bug#: 27811
+Product: Mono/MCS
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs fails compiling code that adds a delegate to an event
+
+Compile this with -r System.Web --target library:
+using System;
+using System.Web.UI;
+using System.Web.UI.HtmlControls;
+
+public class radiobuttons_aspx : System.Web.UI.Page
+{
+	void lblTime_Init(Object Source, EventArgs E)
+	{
+	}
+
+	private void test ()
+	{
+		System.Web.UI.WebControls.Label __ctrl;
+
+		__ctrl = new System.Web.UI.WebControls.Label ();
+		__ctrl.Init += new System.EventHandler (this.lblTime_Init);
+	}
+}
+
+
+mcs dies saying:
+** (process:894): WARNING **: unhandled exception
+System.NullReferenceException: "A null value was found where an object
+instance was required"
+#0: 0x00006 callvirt   in Mono.CSharp.TypeManager::GetPrivateFieldOfEvent
+([0x8272150] )
+#1: 0x00008 call       in Mono.CSharp.Expression::GetFieldFromEvent
+([0x82b7058] )
+#2: 0x002e6 call       in Mono.CSharp.MemberAccess::ResolveMemberAccess
+([0x82a5740] [0x82b6398] [0x82adf68] [vt: 0xbfffe01c] [0x82461a8] )
+#3: 0x001df call       in Mono.CSharp.MemberAccess::DoResolve ([0x82a5740] )
+#4: 0x00002 callvirt   in Mono.CSharp.Expression::DoResolveLValue
+([0x82a5740] [0x82463e8] )