[Mono-bugs] [Bug 67711][Nor] New - MCS errors when compile a cast in switch/case.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 6 Oct 2004 15:11:55 -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 sebastien@ximian.com.

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

--- shadow/67711	2004-10-06 15:11:54.000000000 -0400
+++ shadow/67711.tmp.15802	2004-10-06 15:11:55.000000000 -0400
@@ -0,0 +1,56 @@
+Bug#: 67711
+Product: Mono: Compilers
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: sebastien@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: MCS errors when compile a cast in switch/case.
+
+Description of Problem:
+MCS errors when compile a cast in switch/case.
+
+
+Steps to reproduce the problem:
+1. Compile the following source:
+
+using System;
+using System.Security;
+using System.Security.Permissions;
+
+public class Program {
+
+        static public void Main (string [] args)
+        {
+                SecurityAction a = SecurityAction.Demand;
+                switch (a) {
+                        case (SecurityAction)13:
+                        case SecurityAction.Demand:
+                                Console.WriteLine ("ok");
+                        break;
+                }
+        }
+}
+ 
+Actual Results:
+# mcs bug.cs
+bug.cs(11) error CS0150: A constant value is expected, got:
+Mono.CSharp.EmptyCast
+Compilation failed: 1 error(s), 0 warnings
+
+
+Expected Results:
+Compile without problem (like CSC).
+
+
+How often does this happen? 
+Always