[Mono-bugs] [Bug 352805] New: Delegate.CreateDelegate is missing argument validation

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jan 9 19:53:31 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=352805


           Summary: Delegate.CreateDelegate is missing argument validation
           Product: Mono: Class Libraries
           Version: 1.2.6
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: robertj at gmx.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


The following test case fails on MS.NET 2.0 with

ArgumentException: cannot bind to target method (or similar, as
I translated the message).


On Mono it succeeds, but it's obviously wrong since Test(Uri)
is invoked with an "object" argument.

using System;

delegate void Method(object o);

class T
{
        static void Main ()
        {
                T t = new T ();
                Method m = (Method) Delegate.CreateDelegate (typeof(Method), t, 
t.GetType ().GetMethod ("Test"));

                m (new object ());
        }

        public void Test (Uri uri)
        {
                Console.WriteLine (uri);
        }
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list