[Mono-bugs] [Bug 61293][Wis] New - mcs not handling [FlagsAttribute]

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 8 Jul 2004 12:19:40 -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 jpease@twcny.rr.com.

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

--- shadow/61293	2004-07-08 12:19:40.000000000 -0400
+++ shadow/61293.tmp.11224	2004-07-08 12:19:40.000000000 -0400
@@ -0,0 +1,90 @@
+Bug#: 61293
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jpease@twcny.rr.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs not handling [FlagsAttribute]
+
+Description of Problem:
+mcs doesn't handle Flags attribute correctly.
+
+Steps to reproduce the problem:
+1. Compile FlagsAttributeDemo from MSDN library with mcs
+(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemFlagsAttributeClassTopic.asp)
+2. Run with mono
+3. monodis executable
+
+Actual Results:
+
+Output (compiled with mcs) for enum with [FlagsAttribute] set:
+
+  0 - Black
+  1 - Red
+  2 - Green
+  3 - 3
+  4 - Blue
+  5 - 5
+  6 - 6
+  7 - 7
+  8 - 8
+
+IL (using monodis) for enum with [FlagsAttribute] set:
+
+  .class nested private auto ansi sealed MultiHue
+        extends [mscorlib]System.Enum
+  {
+    .field  public specialname  rtspecialname   int16 value__
+    .field public static  literal   valuetype 'FlagsAttributeDemo/MultiHue'
+Black = int16(0x00000000)
+    .field public static  literal   valuetype 'FlagsAttributeDemo/MultiHue'
+Red = int16(0x00000001)
+    .field public static  literal   valuetype 'FlagsAttributeDemo/MultiHue'
+Green = int16(0x00000002)
+    .field public static  literal   valuetype 'FlagsAttributeDemo/MultiHue'
+Blue = int16(0x00000004)
+                                                                          
+                                                
+  } // end of class MultiHue
+
+Expected Results:
+
+Output (compiled with csc) for enum with [FlagsAttribute] set:
+
+  0 - Black
+  1 - Red
+  2 - Green
+  3 - Red, Green
+  4 - Blue
+  5 - Red, Blue
+  6 - Green, Blue
+  7 - Red, Green, Blue
+  8 - 8
+
+IL (using ildasm) for enum with [FlagsAttribute] set:
+
+  .class auto ansi sealed nested private MultiHue
+         extends [mscorlib]System.Enum
+  {
+    .custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01
+00 00 00 )
+    .field public specialname rtspecialname int16 value__
+    .field public static literal valuetype FlagsAttributeDemo/MultiHue
+Black = int16(0x0000)
+    .field public static literal valuetype FlagsAttributeDemo/MultiHue Red
+= int16(0x0001)
+    .field public static literal valuetype FlagsAttributeDemo/MultiHue
+Green = int16(0x0002)
+    .field public static literal valuetype FlagsAttributeDemo/MultiHue Blue
+= int16(0x0004)
+  } // end of class MultiHue