[Mono-bugs] [Bug 60090][Nor] New - String representation of flags enum value differs from MS.NET

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 12 Jun 2004 05:04:07 -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=60090

--- shadow/60090	2004-06-12 05:04:06.000000000 -0400
+++ shadow/60090.tmp.19829	2004-06-12 05:04:06.000000000 -0400
@@ -0,0 +1,75 @@
+Bug#: 60090
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gert.driesen@pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: String representation of flags enum value differs from MS.NET
+
+The Mono string representation of a flags enum value, where are fields 
+that have the same underlying value differs from that of MS.NET.
+
+using System;
+using System.Reflection;
+
+public class EntryPoint
+{
+	public static void Main ()
+	{
+		MethodAttributes ma = MethodAttributes.Public;
+		Console.WriteLine ("MA: " + ma.ToString ());
+	}
+}
+
+IF you execute the code above on MS.NET, you get :
+
+MA: PrivateScope, Public
+
+While on Mono, get you get :
+
+MA: ReuseSlot, Public
+
+
+The System.Reflection.MethodAttributes enum is defined as :
+
+	[Flags]
+	public enum MethodAttributes
+	{
+		MemberAccessMask = 7,
+		Private = 1,
+		PrivateScope = 0,
+		FamANDAssem = 2,
+		Assembly = 3,
+		Family = 4,
+		FamORAssem = 5,
+		Public = 6,
+		Static = 16,
+		Final = 32,
+		Virtual = 64,
+		HideBySig = 128,
+		VtableLayoutMask = 256,
+		CheckAccessOnOverride = 512,
+		ReuseSlot = 0,
+		NewSlot = 256,
+		Abstract = 1024,
+		SpecialName = 2048,
+		PinvokeImpl = 8192,
+		UnmanagedExport = 8,
+		RTSpecialName = 4096,
+		ReservedMask = 53248,
+		HasSecurity = 16384,
+		RequireSecObject = 32768
+	}
+
+As you can see both the PrivateScope and ReuseSlot field have the same 
+value (0).