[Mono-bugs] [Bug 60080][Nor] New - mcs does not emit custom FlagsAttribute for enums
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sat, 12 Jun 2004 04:04:49 -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 gert.driesen@pandora.be.
http://bugzilla.ximian.com/show_bug.cgi?id=60080
--- shadow/60080 2004-06-12 04:04:49.000000000 -0400
+++ shadow/60080.tmp.17355 2004-06-12 04:04:49.000000000 -0400
@@ -0,0 +1,63 @@
+Bug#: 60080
+Product: Mono: Compilers
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: gert.driesen@pandora.be
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: mcs does not emit custom FlagsAttribute for enums
+
+mcs does not emit the custom FlagsAttribute for enums with Flags
+attribute.
+
+For the following enum definition :
+
+ [Flags]
+ private enum TestEnum
+ {
+ PrivateScope = 0,
+ Public = 6,
+ ReuseSlot = 0,
+ }
+
+csc emits :
+
+ .class /*02000003*/ auto ansi sealed nested private TestEnum
+ extends [mscorlib/* 23000001 */]System.Enum/* 01000002 */
+ {
+ .custom /*0C000002:0A000006*/ instance void [mscorlib/* 23000001 */]
+System.FlagsAttribute/* 01000007 */::.ctor() /* 0A000006 */ = ( 01 00 00
+00 )
+ .field /*04000001*/ public specialname rtspecialname int32 value__
+ .field /*04000002*/ public static literal valuetype EntryPoint/*
+02000002 *//TestEnum/* 02000003 */ PrivateScope = int32(0x00000000)
+ .field /*04000003*/ public static literal valuetype EntryPoint/*
+02000002 *//TestEnum/* 02000003 */ Public = int32(0x00000006)
+ .field /*04000004*/ public static literal valuetype EntryPoint/*
+02000002 *//TestEnum/* 02000003 */ ReuseSlot = int32(0x00000000)
+ } // end of class TestEnum
+
+while mcs emits :
+
+ .class /*02000003*/ auto ansi sealed nested private TestEnum
+ extends [mscorlib/* 23000001 */]System.Enum/* 01000003 */
+ {
+ .field /*04000001*/ public specialname rtspecialname int32 value__
+ .field /*04000002*/ public static literal valuetype EntryPoint/*
+02000002 *//TestEnum/* 02000003 */ PrivateScope = int32(0x00000000)
+ .field /*04000003*/ public static literal valuetype EntryPoint/*
+02000002 *//TestEnum/* 02000003 */ Public = int32(0x00000006)
+ .field /*04000004*/ public static literal valuetype EntryPoint/*
+02000002 *//TestEnum/* 02000003 */ ReuseSlot = int32(0x00000000)
+ } // end of class TestEnum
+
+As you can see, there's no custom attribute emitted.