[Mono-bugs] [Bug 44302][Min] New - mcs fails to flag a CS0136
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Sun, 8 Jun 2003 09:54:20 -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 gonzalo@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=44302
--- shadow/44302 Sun Jun 8 09:54:20 2003
+++ shadow/44302.tmp.14967 Sun Jun 8 09:54:20 2003
@@ -0,0 +1,47 @@
+Bug#: 44302
+Product: Mono/MCS
+Version: unspecified
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Minor
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: gonzalo@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: mcs fails to flag a CS0136
+
+Try compiling this program:
+--------
+class C
+{
+ static void Main (string [] args)
+ {
+ foreach (string s in args) {
+ byte [] bytes = null;
+ }
+
+ int length = args.Length; // [1]
+ // if (args.Length > 0) // [2]
+ if (length > 0) // [1]
+ System.Console.WriteLine ("hey");
+
+ byte [] bytes = null;
+ }
+}
+--------
+
+Expected results:
+mcsbug.cs(14,11): error CS0136: A local variable named 'bytes' cannot be
+declared in this scope.......
+
+Actual results:
+Compilation succeeded
+
+Additional information:
+If you comment out lines marked as [1] and uncomment [2], mcs flags the error.