[Mono-bugs] [Bug 74655][Nor] New - incorrect default processing in switch

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 18 Apr 2005 23:58:08 -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 atsushi@ximian.com.

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

--- shadow/74655	2005-04-18 23:58:08.000000000 -0400
+++ shadow/74655.tmp.18708	2005-04-18 23:58:08.000000000 -0400
@@ -0,0 +1,50 @@
+Bug#: 74655
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: atsushi@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: incorrect default processing in switch
+
+mcs does not examine non-default cases when default case is put in front of
+other case statements.
+
+public class Test {
+  public static void Main (string [] args) {
+    foreach (string arg in args) {
+      switch (arg) {
+      default: System.Console.WriteLine (arg); break;
+      case "foo": System.Console.WriteLine ("!!! foo !!!"); break;
+      }
+    }
+  }
+}
+
+Run this example with command line arguments "foo bar"
+
+Actual Results:
+
+foo
+bar
+
+Expected Results:
+
+!!! foo !!!
+bar
+
+How often does this happen? 
+consistently.
+
+Additional Information:
+It is compiler matter. The same binary borks under MS runtime, and mono
+runtime never do that when the executable is compiled by csc.