Bug 323338 (MONO80650) - [GMCS] Anonymous methods loose parameter scope when declared in base()
Summary: [GMCS] Anonymous methods loose parameter scope when declared in base()
Status: RESOLVED FIXED
Alias: MONO80650
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.2
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Marek Safar
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-28 20:15 UTC by Geoff Norton
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:24:39 UTC


---- Reported by grompf@sublimeintervention.com 2007-01-28 13:15:34 MST ----

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.



---- Additional Comments From marek.safar@seznam.cz 2007-02-20 18:47:51 MST ----

Fixed in SVN.


Unknown operating system unknown. Setting to default OS "Other".