[Mono-bugs] [Bug 62054][Nor] Changed - Constant byte enum expressions not folded

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 28 Jul 2004 13:22:12 -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 bmaurer@users.sf.net.

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

--- shadow/62054	2004-07-28 13:08:29.000000000 -0400
+++ shadow/62054.tmp.12211	2004-07-28 13:22:12.000000000 -0400
@@ -1,23 +1,23 @@
 Bug#: 62054
 Product: Mono: Compilers
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: C#
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: alfredo@lab.matcom.uh.cu               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: Error on binary or in case statements
+Summary: Constant byte enum expressions not folded
 
 Description of Problem:
 I'm not sure if this is exactly a bug. The code is written in C#.
 Trying to compile something like this in a swith statement:
 
 case (XMode.X1 | XMode.X2) : {...}
@@ -30,6 +30,18 @@
 public enum XMode : byte{X1 = 1, X2 = 2, X3 = 4, X4 = 8}
 
 I had to solve this converting the switch block to a sequence of ifs. Then
 it worked.
 
 This code compiles and works OK with Visual Studio.
+
+------- Additional Comments From bmaurer@users.sf.net  2004-07-28 13:22 -------
+Simpler:
+
+class X {
+	enum A : byte {
+		x, y, z
+	}
+	const A foo = A.x | A.y;
+	
+	static void Main () {}
+}