[Mono-bugs] [Bug 82784][Wis] New - compile error when creating a delegate inside another delegate
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Sep 10 15:14:59 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 anders at iola.dk.
http://bugzilla.ximian.com/show_bug.cgi?id=82784
--- shadow/82784 2007-09-10 15:14:59.000000000 -0400
+++ shadow/82784.tmp.5238 2007-09-10 15:14:59.000000000 -0400
@@ -0,0 +1,85 @@
+Bug#: 82784
+Product: Mono: Compilers
+Version: 1.2
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: C#
+AssignedTo: rharinath at novell.com
+ReportedBy: anders at iola.dk
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: compile error when creating a delegate inside another delegate
+
+Description of Problem: The problem seems to be one can't create a delegate
+inside another delegate. Something along the following fails:
+
+b.ButtonPressEvent += delegate(object sender, Gtk.ButtonPressEventArgs args) {
+ MorePopup more_popup = new MorePopup(allocation.Width);
+ VoidFunction tmp = delegate() {
+ more_popup.show(percent, (int)(args.Event.XRoot -
+args.Event.X), (int)(args.Event.YRoot - args.Event.Y - allocation.Height));
+};
+ MorePopupTracker.Instance.set_popup_and_show(tmp);
+};
+
+Where VoidFunction is defined as: public delegate void VoidFunction();
+
+Actual Results:
+
+Unhandled Exception: Mono.CSharp.InternalErrorException: Internal error
+ at Mono.CSharp.ScopeInfo.EmitScopeInstance (Mono.CSharp.EmitContext ec)
+[0x00000]
+ at Mono.CSharp.ScopeInfo+CapturedVariable.EmitInstance
+(Mono.CSharp.EmitContext ec) [0x00000]
+ at Mono.CSharp.VariableReference.EmitLoad (Mono.CSharp.EmitContext ec)
+[0x00000]
+ at Mono.CSharp.VariableReference.Emit (Mono.CSharp.EmitContext ec,
+Boolean leave_copy) [0x00000]
+ at Mono.CSharp.VariableReference.Emit (Mono.CSharp.EmitContext ec) [0x00000]
+ at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean
+is_base, Boolean is_static, Mono.CSharp.Expression instance_expr,
+System.Reflection.MethodBase method, System.Collections.ArrayList
+Arguments, Location loc, Boolean dup_args, Boolean omit_args) [0x00000]
+ at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean
+is_base, Boolean is_static, Mono.CSharp.Expression instance_expr,
+System.Reflection.MethodBase method, System.Collections.ArrayList
+Arguments, Location loc) [0x00000]
+ at Mono.CSharp.Invocation.Emit (Mono.CSharp.EmitContext ec) [0x00000]
+ at Mono.CSharp.Invocation.EmitStatement (Mono.CSharp.EmitContext ec)
+[0x00000]
+ at Mono.CSharp.StatementExpression.DoEmit (Mono.CSharp.EmitContext ec)
+[0x00000]
+ at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000]
+ at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000]
+ at Mono.CSharp.Block.Emit (Mono.CSharp.EmitContext ec) [0x00000]
+ at Mono.CSharp.EmitContext.EmitResolvedTopBlock
+(Mono.CSharp.ToplevelBlock block, Boolean unreachable) [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.TypeContainer.EmitType () [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]
+
+
+Expected Results:
+
+Compiles fine.
+
+How often does this happen?
+
+Always
+
+Additional Information:
+
+mono version 1.2.3.1
More information about the mono-bugs
mailing list