[Mono-bugs] [Bug 29977][Nor] New - Delegate.CreateDelegate broken (regression)

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
6 Sep 2002 17:37:23 -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 ric@users.sourceforge.net.

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

--- shadow/29977	Fri Sep  6 13:37:23 2002
+++ shadow/29977.tmp.25560	Fri Sep  6 13:37:23 2002
@@ -0,0 +1,70 @@
+Bug#: 29977
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: ric@users.sourceforge.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Delegate.CreateDelegate broken (regression)
+
+The folowing program works with the mono class library version of yesterday:
+
+
+namespace T1 {
+  using System;
+  using System.Reflection;
+  
+  public class T {
+  
+    public static void Main (string[] args)
+    {
+      A a = new A ();
+      B b = new B ();
+      EventInfo ei = b.GetType ().GetMember("E")[0] as EventInfo;
+      MethodInfo mi = ei.GetAddMethod ();
+      ParameterInfo[] pi = mi.GetParameters ();
+      Console.WriteLine ("{0}", pi.Length); // should always be 1...
+      Type delegate_type = pi[0].ParameterType;
+      // this fails, it should work
+      Delegate d = Delegate.CreateDelegate (delegate_type, a, "M"); 
+      Console.WriteLine ("{0}", d);
+    }
+  
+  }
+  
+  public class A {
+    private void M (Object b, EventArgs e)
+    {
+      Console.WriteLine ("method M");
+    }
+  }
+  
+  public class B {
+    public event EventHandler E 
+    {
+      add {
+        Console.WriteLine ("added");
+      }
+      remove {
+        Console.WriteLine ("removed");
+      }
+    }
+  }
+}
+
+However, it doesn't work today. The change that breaks it is:
+
+Fri Sep 6 12:11:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+* MonoType.cs: implemented GetMembers, GetConstructorImpl and
+GetMethodImpl using the binder.
+* Type.cs: GetConstructorImpl/GetConstructor fixes.