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 [EMAIL PROTECTED]

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

--- shadow/80650        2007-01-28 13:15:34.000000000 -0500
+++ shadow/80650.tmp.6924       2007-01-28 13:15:34.000000000 -0500
@@ -0,0 +1,46 @@
+Bug#: 80650
+Product: Mono: Compilers
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: [EMAIL PROTECTED]                            
+ReportedBy: [EMAIL PROTECTED]               
+QAContact: [EMAIL PROTECTED]
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [GMCS] Anonymous methods loose parameter scope when declared in base()
+
+The following code:
+
+using System;
+
+public class BaseClass {
+        public delegate void SomeDelegate ();
+        public BaseClass (SomeDelegate d) {
+                d();
+        }
+}
+
+public class TestClass : BaseClass {
+        public readonly int Result;
+        public TestClass (int result)
+                : base(delegate () {
+                        Console.WriteLine (result);
+                }) {
+        }
+        static void Main (string [] args) {
+                TestClass c = new TestClass (1);
+        }
+}
+
+compiles and runs on ms.net but results in:
+
+bug.cs(15,23): error CS0103: The name `result' does not exist in the context 
of `TestClass'
+
+on gmcs.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to