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=76620 --- shadow/76620 2005-11-02 16:27:16.000000000 -0500 +++ shadow/76620.tmp.22973 2005-11-02 16:27:16.000000000 -0500 @@ -0,0 +1,49 @@ +Bug#: 76620 +Product: Mono: Compilers +Version: 1.0 +OS: All +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Wishlist +Component: C# +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: mcs does not properly detect variable name conflicts when using anonymous methods + +The following code should not compile: + +public class AnonTest +{ + public static void Main () + { + new AnonTest (); + } + + delegate void MooEventHandler (string moo); + event MooEventHandler bleh; + + public AnonTest () + { + AddEvent ("moo"); + } + + void AddEvent (string moo) + { + bleh += delegate (string moo) { + System.Console.WriteLine (moo); + }; + } +} + +On .NET 2.0 final, the following error is generated: + +test.cs(20,21): error CS0136: A local variable named 'moo' cannot be +declared in + this scope because it would give a different meaning to 'moo', which is + already used in a 'parent or current' scope to denote something else _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
