[Mono-bugs] [Bug 29150][Maj] New - Variable scope issue

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
20 Aug 2002 05:35:37 -0000


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 gonzalo@ximian.com.

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

--- shadow/29150	Tue Aug 20 01:35:36 2002
+++ shadow/29150.tmp.15429	Tue Aug 20 01:35:37 2002
@@ -0,0 +1,52 @@
+Bug#: 29150
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Variable scope issue
+
+Steps to reproduce the problem:
+1. Try compiling this:
+
+using System;
+class C
+{
+        static void Main (string [] args)
+        {
+                if (args.Length == 0) {
+                        int i = 3;
+                }
+
+                int i = 4;
+        }
+}
+
+Actual Results:
+Compilation successful.
+
+
+Expected Results:
+bugnuevo.cs(10,7): error CS0136: 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 'child'
+scope to denote something else
+bugnuevo.cs(10,7): error CS0103: The name 'i' does not exist in the class
+or namespace 'C'
+
+
+How often does this happen? 
+always.
+
+Additional Information:
+delegate.cs has this problem.