[Mono-bugs] [Bug 54945][Cri] Changed - GetCustomAttributes failing for fields defined in a base class

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 8 Mar 2004 19:54:53 -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 bmaurer@users.sf.net.

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

--- shadow/54945	2004-02-29 17:06:57.000000000 -0500
+++ shadow/54945.tmp.21197	2004-03-08 19:54:53.000000000 -0500
@@ -1,15 +1,15 @@
 Bug#: 54945
-Product: Mono/Class Libraries
+Product: Mono: Class Libraries
 Version: unspecified
 OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
 Severity: Unknown
-Priority: Normal
+Priority: Critical
 Component: CORLIB
 AssignedTo: bmaurer@users.sf.net                            
 ReportedBy: lluis@ximian.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
@@ -57,6 +57,40 @@
 ------- Additional Comments From gonzalo@ximian.com  2004-02-27 13:19 -------
 May be this is related to bug #54518
 
 ------- Additional Comments From bmaurer@users.sf.net  2004-02-29 17:06 -------
 Am going to work on this, i have alot of patches in this area, so best
 to integrate this in the new version.
+
+------- Additional Comments From bmaurer@users.sf.net  2004-03-08 19:54 -------
+This seems to be the root cause of the regression:
+
+using System;
+using System.Reflection;
+
+class Test {
+	public static void Main ()
+	{
+		FieldInfo fi = typeof (Derived).GetField ("field");
+		Console.WriteLine (fi.DeclaringType);
+		Console.WriteLine (fi.ReflectedType);
+		
+		FieldInfo [] fieldInfos = typeof (Derived).GetFields ();
+		foreach (FieldInfo f in fieldInfos) {
+			Console.WriteLine (fi.DeclaringType);
+			Console.WriteLine (fi.ReflectedType);
+		}
+	}
+}
+
+public class Base
+{
+	public string field;
+}
+
+public class Derived: Base
+{
+}
+
+Since .30, there have been various returns for ReflectedType. Whenever
+ ReflectedType is Base, the attribute code works, otherwise, you get
+teh bug.