Bugzilla – Bug 323338
[GMCS] Anonymous methods loose parameter scope when declared in base()
Last modified: 2007-09-15 21:24:23 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".