[Mono-bugs] [Bug 80878][Nor] New - delegate declaration in event add accessor results in exception
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Fri Feb 16 20:32:35 EST 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 thoemy at gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=80878
--- shadow/80878 2007-02-16 20:32:35.000000000 -0500
+++ shadow/80878.tmp.6478 2007-02-16 20:32:35.000000000 -0500
@@ -0,0 +1,96 @@
+Bug#: 80878
+Product: Mono: Compilers
+Version: 1.2
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com
+ReportedBy: thoemy at gmail.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: delegate declaration in event add accessor results in exception
+
+Description of Problem:
+
+gmcs version 1.2.2.1 throws an exception when compiling the following code:
+
+public class Test
+{
+ public delegate void TestEventHandler ();
+ public event TestEventHandler testEvent;
+
+ public event TestEventHandler TestEvent
+ {
+ add {
+ TestEventHandler fun = delegate () { value (); };
+ fun ();
+ }
+ remove { }
+ }
+}
+
+
+Steps to reproduce the problem:
+1. Save code as Test.cs
+2. gmcs Test.cs
+
+Actual Results:
+
+Exception caught by the compiler while compiling:
+ Block that caused the problem begin at: Test.cs(9,27):
+ Block being compiled: [Test.cs(9,39):,Test.cs(9,51):]
+System.NullReferenceException: Object reference not set to an instance of
+an object
+Exception caught by the compiler while compiling:
+ Block that caused the problem begin at: Test.cs(8,3):
+ Block being compiled: [Test.cs(8,7):,Test.cs(10,3):]
+System.NullReferenceException: Object reference not set to an instance of
+an object
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+ at Mono.CSharp.ScopeInfo.CreateScope (Mono.CSharp.Block block) [0x00000]
+ at Mono.CSharp.Block.CreateScopeInfo () [0x00000]
+ at Mono.CSharp.ParameterReference.DoResolveBase (Mono.CSharp.EmitContext
+ec) [0x00000]
+ at Mono.CSharp.ParameterReference.DoResolve (Mono.CSharp.EmitContext ec)
+[0x00000]
+ at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec,
+ResolveFlags flags) [0x00000]
+ at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
+ at Mono.CSharp.SimpleName.DoSimpleNameResolve (Mono.CSharp.EmitContext
+ec, Mono.CSharp.Expression right_side, Boolean intermediate) [0x00000]
+ at Mono.CSharp.SimpleName.SimpleNameResolve (Mono.CSharp.EmitContext ec,
+Mono.CSharp.Expression right_side, Boolean intermediate) [0x00000]
+ at Mono.CSharp.SimpleName.DoResolve (Mono.CSharp.EmitContext ec, Boolean
+intermediate) [0x00000]
+ at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec,
+ResolveFlags flags) [0x00000]
+ at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
+ at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec,
+ResolveFlags flags) [0x00000]
+ at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
+ at Mono.CSharp.ExpressionStatement.ResolveStatement
+(Mono.CSharp.EmitContext ec) [0x00000]
+ at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.EmitContext ec)
+[0x00000]
+ at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
+ at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
+anonymous_method_host, Mono.CSharp.ToplevelBlock block,
+Mono.CSharp.Parameters ip, IMethodData md, System.Boolean& unreachable)
+[0x00000]
+
+Expected Results:
+It should compile without problems.
+
+How often does this happen?
+Every time
+
+Additional information:
+Debian mono-gmcs package version 1.2.2.1-1
More information about the mono-bugs
mailing list