[Mono-bugs] [Bug 37652][Wis] New - volatile enums are seen as 'int' by the compiler
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Wed, 5 Feb 2003 12:20:56 -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 lukas.pokorny@rebex.cz.
http://bugzilla.ximian.com/show_bug.cgi?id=37652
--- shadow/37652 Wed Feb 5 12:20:56 2003
+++ shadow/37652.tmp.24389 Wed Feb 5 12:20:56 2003
@@ -0,0 +1,62 @@
+Bug#: 37652
+Product: Mono/MCS
+Version: unspecified
+OS: Debian Woody
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: lukas.pokorny@rebex.cz
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: volatile enums are seen as 'int' by the compiler
+
+Description of Problem:
+When compiling a class with volatile enum member, compiler throws an error
+CS0029, stating it could not implicitly convert from enum to int.
+
+Following source demonstrates the problem when compiling with MCS 0.19:
+----------------------------
+using System;
+
+namespace Test
+{
+
+ public enum TestEnum
+ {
+ FirstValue,
+ SecondValue,
+ }
+
+ public class Test
+ {
+ public static volatile TestEnum testEnum;
+
+ [STAThread]
+ static void Main(string[] args)
+ {
+ testEnum = TestEnum.FirstValue;
+ }
+ }
+}
+----------------------------
+
+Actual Results:
+Test.cs(19) error CS0029: Cannot convert implicitly from `Test.TestEnum'
+to `int'
+
+Expected Results:
+Successful compilation.
+
+
+How often does this happen?
+Every time I compile any source with volatile enum.
+
+Additional Information:
+After deleting the "volatile" keyword from the source, mcs works
+perfectly. But then the field is not volatile, which is not what I need...