[Mono-bugs] [Bug 33094][Wis] New - C# switch statement fails to compile.
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
31 Oct 2002 11:47:05 -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 david_stephenson@hp.com.
http://bugzilla.ximian.com/show_bug.cgi?id=33094
--- shadow/33094 Thu Oct 31 06:47:05 2002
+++ shadow/33094.tmp.11527 Thu Oct 31 06:47:05 2002
@@ -0,0 +1,88 @@
+Bug#: 33094
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: david_stephenson@hp.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: C# switch statement fails to compile.
+
+Description of Problem:
+
+When compiling my .Net C# project with mono I encountered some
+compilations error that I did not get with rotor or the .Net compiler.
+
+Steps to reproduce the problem:
+compile the following method.
+
+public static void test(int p) {
+ int elementDepth = 0;
+
+ switch(p){
+ case 2:
+ elementDepth++; // hint If I remove this line it compiles
+with half the errors!
+ int ascii = 0;
+ int nonAscii = 0;
+ break;
+ case 3:
+ int ascii = 0;
+ int nonAscii = 0;
+ ascii++;
+ nonAscii++;
+ System.Console.WriteLine(ascii);
+ System.Console.WriteLine(nonAscii);
+ break;
+ }
+}
+
+Actual Results:
+
+C:\>mcs monobug1.cs
+
+You can run mcs with 'monomcs' on .NET, instead of mono, too.
+
+monobug1.cs(23) error CS0103: The name `ascii' could not be found in
+`test.MonoB
+ug'
+monobug1.cs(24) error CS0103: The name `nonAscii' could not be found in
+`test.Mo
+noBug'
+monobug1.cs(25) error CS0103: The name `ascii' could not be found in
+`test.MonoB
+ug'
+monobug1.cs(26) error CS0103: The name `nonAscii' could not be found in
+`test.Mo
+noBug'
+monobug1.cs(27) error CS0103: The name `ascii' could not be found in
+`test.MonoB
+ug'
+monobug1.cs(28) error CS0103: The name `nonAscii' could not be found in
+`test.Mo
+noBug'
+Compilation failed: 6 error(s), 0 warnings
+
+Expected Results:
+
+C:\>mcs monobug1.cs
+
+You can run mcs with 'monomcs' on .NET, instead of mono, too.
+
+Compilation succeeded
+
+How often does this happen?
+
+Always
+
+Additional Information:
+
+I will try to attach the test program to this bug...