[Mono-bugs] [Bug 30081][Nor] New - enum value not checked to be of the underlying type

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
9 Sep 2002 22:31:41 -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 gonzalo@ximian.com.

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

--- shadow/30081	Mon Sep  9 18:31:41 2002
+++ shadow/30081.tmp.9656	Mon Sep  9 18:31:41 2002
@@ -0,0 +1,38 @@
+Bug#: 30081
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: enum value not checked to be of the underlying type
+
+Steps to reproduce the problem:
+1. Try compiling this:
+public class Blah
+{
+        enum AA : long { a, b }
+
+        enum Bar {
+                a = AA.a
+        }
+}
+
+Actual Results:
+Compilation successful.
+
+Expected Results:
+from40-2.cs(6,7): error CS0029: Cannot implicitly convert type 'long' to 'int'
+
+
+Additional Information:
+Extracted from test-40.cs