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=79153 --- shadow/79153 2006-08-24 05:15:59.000000000 -0400 +++ shadow/79153.tmp.28659 2006-08-24 05:15:59.000000000 -0400 @@ -0,0 +1,45 @@ +Bug#: 79153 +Product: Mono: Compilers +Version: 1.1 +OS: GNU/Linux [Other] +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Minor +Component: C# +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: Anonymous delegates let shadow variables + +Description of Problem: +Gmcs (1.1.13.6) lets shadow a parent scope variable in a child scope, if +the inner scope is an anonymous delegate. This leads to ambigous variable +resolution. Microsoft compiler rejects such code. + +Steps to reproduce the problem: +1. gmcs the following code: + +delegate void D(); +class A{ + static void Main(){ + int i; + D d = delegate {int i;}; + } +} + +Actual Results: +success + +Expected Results: +Report an error, like the Microsoft compiler does. +"A local variable named 'i' cannot be declared in this scope because it +would give a different meaning to 'i', which is already used in a 'parent +or current' scope to denote something else" + +How often does this happen? +100% _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
