[Mono-bugs] [Bug 52182][Wis] New - GetFields returns inherited static fields

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 15 Dec 2003 09:31:09 -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 malekith@pld-linux.org.


--- shadow/52182	2003-12-15 09:31:08.000000000 -0500
+++ shadow/52182.tmp.24868	2003-12-15 09:31:09.000000000 -0500
@@ -0,0 +1,50 @@
+Bug#: 52182
+Product: Mono/Runtime
+Version: unspecified
+OS Details: PLD Linux
+Status: NEW   
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: malekith@pld-linux.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: GetFields returns inherited static fields
+Description of Problem:
+The GetFields() method of System.Type returns static members of both
+current type and its super types. For example it returns Null twice for
+Steps to reproduce the problem:
+1. compile and run the following program:
+using System;
+using System.IO;
+using System.Reflection;
+class T {
+  public static void Main () {
+    FieldInfo[] fs = typeof(StreamReader).GetFields();
+        foreach (FieldInfo f in fs) {
+          Console.WriteLine("{0} : {1}", f.Name, f.FieldType.FullName);
+        }
+  }
+Actual Results:
+Null : System.IO.StreamReader
+Null : System.IO.TextReader
+Expected Results:
+Null : System.IO.StreamReader
+Additional Information:
+See the table after "The following table shows what members of a base class
+are returned by the Get methods when reflecting on a type."
+I filled bug against runtime, since it's implemented in C (icall.c).