[Mono-bugs] [Bug 73485][Nor] Changed - Problem compiling recursive delegates
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Tue, 19 Apr 2005 02:52:23 -0400 (EDT)
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 miguel@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=73485
--- shadow/73485 2005-03-09 06:56:39.000000000 -0500
+++ shadow/73485.tmp.20966 2005-04-19 02:52:23.000000000 -0400
@@ -67,6 +67,53 @@
Compilation failed: 1 error(s), 0 warnings
------- Additional Comments From rharinath@novell.com 2005-03-09 06:56 -------
This is reproducible with MCS too. If I move the 'object[] instrs'
line below the anonymous delegate, it works again. That suggests to
me that somewhere, the code isn't handling implicit blocks.
+
+------- Additional Comments From miguel@ximian.com 2005-04-19 02:52 -------
+Just to track the problem.
+
+This is a simpler program:
+
+public class Test1 {
+ public static void Main() {
+ int a // = 1;
+ check_t m = delegate () {
+ m ();
+ };
+ }
+
+ delegate void check_t();
+}
+
+The above compiles, if we remove the // from that program it will fail.
+
+The problem is in the lookup process for locals, currently we have
+linked two TopLevelBlocks like this:
+
+Delegate.TopLevelBlock.Parent = Main.TopLevelBlock
+
+But it should be:
+
+Delegate.ToplevelBlock.Parent = Main.ToplevelBlock.FirstDeclaration
+
+With IDs:
+
+1 public class Test1 {
+2 public static void Main() {
+3 int a = 1;
+4 check_t m = delegate () {
+5 m ();
+6 };
+7 }
+
+2: the first toplevel block
+3: implicit block created for the assignemtn of 1 to a.
+4: second toplevel block, with its parent pointing to `2'
+
+Have not found where the linking gets messed up yet.
+
+
+
+