[Mono-bugs] [Bug 79698][Maj] New - Cannot register static event handler in anonymous method in static class

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Oct 19 11:54:47 EDT 2006

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 abockover at novell.com.


--- shadow/79698	2006-10-19 11:54:47.000000000 -0400
+++ shadow/79698.tmp.2976	2006-10-19 11:54:47.000000000 -0400
@@ -0,0 +1,52 @@
+Bug#: 79698
+Product: Mono: Compilers
+Version: 1.1
+OS Details: 
+Status: NEW   
+Priority: Major
+Component: C#
+AssignedTo: miguel at ximian.com                            
+ReportedBy: abockover at novell.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Cannot register static event handler in anonymous method in static class
+mcs 1.1.18 crashes when it encounters in a static class an anonymous method
+that registers a static event handler on a static event contained in the
+parent static class.
+aaron at linux-0790:~/Desktop$ mcs gmcs-static-anonmethods.cs
+gmcs-static-anonmethods.cs(13,14): warning CS0219: The variable `foo' is
+assigned but its value is never used
+gmcs-static-anonmethods.cs(12,2): error CS0723:
+`<>c__CompilerGenerated1.<1:<>THIS>': cannot declare variables of static types
+gmcs-static-anonmethods.cs(3,21): (Location of the symbol related to
+previous error)
+Unhandled Exception: Mono.CSharp.InternalErrorException: Internal error
+  at
+(Mono.CSharp.EmitContext ec) [0x00000]
+  at Mono.CSharp.ScopeInfo+ScopeInitializer.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.ScopeInfo.GetScopeInitializer (Mono.CSharp.EmitContext ec)
+  at Mono.CSharp.Block.EmitMeta (Mono.CSharp.EmitContext ec) [0x00000]
+  at Mono.CSharp.ToplevelBlock.EmitMeta (Mono.CSharp.EmitContext ec) [0x00000]
+  at Mono.CSharp.EmitContext.EmitMeta (Mono.CSharp.ToplevelBlock b) [0x00000]
+  at Mono.CSharp.EmitContext.EmitTopBlock (IMethodData md,
+Mono.CSharp.ToplevelBlock block) [0x00000]
+  at Mono.CSharp.MethodData.Emit (Mono.CSharp.DeclSpace parent) [0x00000]
+  at Mono.CSharp.Method.Emit () [0x00000]
+  at Mono.CSharp.TypeContainer.EmitType () [0x00000]
+  at Mono.CSharp.RootContext.EmitCode () [0x00000]
+  at Mono.CSharp.Driver.MainDriver (System.String[] args) [0x00000]
+  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000]

More information about the mono-bugs mailing list