[Mono-bugs] [Bug 58670][Min] New - Incorrect error message when accessing name defined only in a child block.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 18 May 2004 15:51:27 -0400 (EDT)


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 shaver@off.net.

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

--- shadow/58670	2004-05-18 15:51:27.000000000 -0400
+++ shadow/58670.tmp.28812	2004-05-18 15:51:27.000000000 -0400
@@ -0,0 +1,47 @@
+Bug#: 58670
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: FC2, x86
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: shaver@off.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Incorrect error message when accessing name defined only in a child block.
+
+class Test
+{
+    static int Meth()
+    {
+        for (int i = 0; i < 0; i++) { }
+        return i;
+    }
+}
+
+produces:
+
+undeclared-child-block.cs(6) error CS0135: 'i' has a different meaning in a
+child block
+
+while
+
+class Test
+{
+    static int Meth()
+    {
+        for (int i = 0; i < 0; i++) { }
+        return j;
+    }
+}
+
+produces (correctly, IMO):
+
+undeclared-child-block.cs(6) error CS0103: The name `j' could not be found
+in `Test'