[Mono-bugs] [Bug 37358][Nor] New - mcs believes that System.Enum is a value type
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Wed, 29 Jan 2003 01:33:02 -0500 (EST)
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 mathpup@mylinuxisp.com.
http://bugzilla.ximian.com/show_bug.cgi?id=37358
--- shadow/37358 Wed Jan 29 01:33:02 2003
+++ shadow/37358.tmp.16039 Wed Jan 29 01:33:02 2003
@@ -0,0 +1,54 @@
+Bug#: 37358
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: mathpup@mylinuxisp.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: mcs believes that System.Enum is a value type
+
+Description of Problem:
+
+When compiling a statement like
+
+ Console.WriteLine(Convert.ToInt64( Fruit.Orange as Enum ) );
+
+mcs complains that "The as operator should be used with a reference type only
+(System.Enum is a value type." The above statement would be a genuine error is
+System.Enum were a value type, but System.Enum is, in fact, a reference type. I'm
+not sure why mcs believes that System.Enum is a value type, given that
+Type.GetType("System.Enum").IsValueType is False on mono. Rotor's csc compiles
+the test-case without complaint.
+
+This situation comes up in mcs/tools/verifier.cs, but a smaller test-case is attached.
+
+Steps to reproduce the problem:
+1. mcs enumtest.cs
+
+
+Actual Results:
+
+enumtest.cs(9) error CS0077: The as operator should be used with a reference type
+only (System.Enum is a value type
+
+
+
+Expected Results:
+
+Successful compilation
+
+
+How often does this happen?
+
+Always
+
+Additional Information: