[Mono-bugs] [Bug 65778][Nor] Changed - Type.GetMember Ignoring BindingFlags.IgnoreCase
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Tue, 14 Sep 2004 16:39:41 -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 bryan@alphora.com.
http://bugzilla.ximian.com/show_bug.cgi?id=65778
--- shadow/65778 2004-09-13 09:02:19.000000000 -0400
+++ shadow/65778.tmp.31909 2004-09-14 16:39:41.000000000 -0400
@@ -1,23 +1,23 @@
Bug#: 65778
Product: Mono: Class Libraries
Version: unspecified
OS: unknown
OS Details:
-Status: NEEDINFO
+Status: REOPENED
Resolution:
Severity: Unknown
Priority: Normal
Component: CORLIB
AssignedTo: mono-bugs@ximian.com
ReportedBy: bryan@alphora.com
QAContact: mono-bugs@ximian.com
TargetMilestone: ---
URL:
Cc:
-Summary: Type.GetMember Should Be Case-Insensitive
+Summary: Type.GetMember Ignoring BindingFlags.IgnoreCase
In the MS framework the Type.GetMember will do a case in-sensitive search
for members and return all that match. The mono one in 1.0.1 is case
sensitive. I think it needs to be case insensitive as well to be fully
compatible.
@@ -31,6 +31,39 @@
Am having a hard time believing this is true? The MS docs explicitly
state that it is case-sensitive. A quick test shows that this is
correct.
Can you come up with a test case that demonstrates the problem (and
test it on the ms runtime and the mono runtime)? Until then NEEDINFO
+
+------- Additional Comments From bryan@alphora.com 2004-09-14 16:39 -------
+I was full of crap on the docs bit. Sorry about that. I didn't look
+at it carefully enough.
+
+Apparently BindingFlags.IgnoreCase is being ignored.
+
+Here is a repro. It returns 2 on MS and 0 on Mono.
+
+using System;
+using System.Reflection;
+
+namespace ConsoleApplication1
+{
+ class Class1
+ {
+ [STAThread]
+ static void Main(string[] args)
+ {
+ MemberInfo[] LMembers = typeof
+(String).GetMember
+ (
+ "tostring",
+ MemberTypes.Property |
+MemberTypes.Field | MemberTypes.Method,
+ BindingFlags.IgnoreCase |
+BindingFlags.Public | BindingFlags.Instance
+ );
+ Console.WriteLine(LMembers.Length);
+ }
+ }
+}
+