[Mono-bugs] [Bug 31235][Wis] New - GetMethods and GetProperties error

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
25 Sep 2002 22:54:47 -0000


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 gonzalo@ximian.com.

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

--- shadow/31235	Wed Sep 25 18:54:46 2002
+++ shadow/31235.tmp.17722	Wed Sep 25 18:54:46 2002
@@ -0,0 +1,74 @@
+Bug#: 31235
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: GetMethods and GetProperties error
+
+Description of Problem:
+
+When a class 'Derived' derives from class 'Base' and overrides
+methods/properties of 'Base', both methods/properties are returned in
+GetMethods/GetProperties.
+
+It should only return the one in 'Derived'
+
+
+Steps to reproduce the problem:
+1. Compile this and run:
+-----
+using System;
+using System.Reflection;
+
+class Base
+{
+        public virtual void Method ()
+        {
+        }
+
+        public virtual string Property
+        {
+                get { return "Base"; }
+        }
+}
+
+class Derived : Base
+{
+        public override void Method ()
+        {
+        }
+
+        public override string Property
+        {
+                get { return "Derived"; }
+        }
+}
+
+public class Test
+{
+        static void Main ()
+        {
+                Type t = typeof (Derived);
+                //PropertyInfo p = t.GetProperty ("Property");
+                //Console.WriteLine ("{0} {1}", p.DeclaringType, p.Name);
+                MethodInfo p = t.GetMethod ("Method");
+                Console.WriteLine ("{0} {1}", p.DeclaringType, p.Name);
+        }
+}
+------
+Actual Results:
+AmbiguousMatchException
+
+Expected Results:
+Derived Property/Derived Method