[Mono-bugs] [Bug 80344][Nor] New - GetMembers behaviour does not match MS with BindingFlags.FlattenHierarchy

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Dec 22 12:42:03 EST 2006


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 rolfkvinge at ya.com.

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

--- shadow/80344	2006-12-22 12:42:03.000000000 -0500
+++ shadow/80344.tmp.4192	2006-12-22 12:42:03.000000000 -0500
@@ -0,0 +1,53 @@
+Bug#: 80344
+Product: Mono: Class Libraries
+Version: 1.0
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: rolfkvinge at ya.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: GetMembers behaviour does not match MS with BindingFlags.FlattenHierarchy
+
+The following code prints different output on MS and Mono.
+
+using System;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Text;
+
+
+class vbnc_bugs {
+	public const BindingFlags ALLMEMBERS = BindingFlags.FlattenHierarchy 
+| BindingFlags.Public | BindingFlags.Instance;
+	
+	static void Main ()
+	{
+		Type t = typeof(System.Windows.Forms.Form);
+		MemberInfo [] members  = t.GetMembers (ALLMEMBERS);
+
+		foreach (MemberInfo m in members) {
+			if (m.Name.ToLower () != "clientsize" )
+				continue;
+				
+			Console.WriteLine (m.MemberType.ToString () + " " + 
+m.DeclaringType.FullName + ":" + m.Name);
+		}
+
+	}
+}
+
+
+Output on MS:
+Property System.Windows.Forms.Form:ClientSize
+
+Output on Mono (both v1.1 and 2.0 profile):
+Property System.Windows.Forms.Form:ClientSize
+Property System.Windows.Forms.Control:ClientSize


More information about the mono-bugs mailing list