[Mono-bugs] [Bug 69614][Nor] New - mcs crash when using anonymous delegate

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 17 Nov 2004 12:06:05 -0500 (EST)


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 danw@novell.com.

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

--- shadow/69614	2004-11-17 12:06:05.000000000 -0500
+++ shadow/69614.tmp.16562	2004-11-17 12:06:05.000000000 -0500
@@ -0,0 +1,40 @@
+Bug#: 69614
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: danw@novell.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs crash when using anonymous delegate
+
+This program makes mcs crash with a System.NullReferenceException:
+
+using System;
+
+class Delegable {
+	public event EventHandler MyDelegate;
+}
+
+class DelegateTest {
+	static void Main (string[] argv)
+	{
+		Console.WriteLine ("Test");
+
+		Delegable db = new Delegable ();
+		db.MyDelegate += delegate (object o, EventArgs args) {
+			Console.WriteLine ("{0}", argv);
+			Console.WriteLine ("{0}", db);
+		};
+	}
+}
+
+If you delete any of the three WriteLine calls, it compiles fine...