Mario,
 
Please submit a bug report for this, and add your patch as an attachment.
 
Gert
 
  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mario Chavez
Sent: donderdag 25 oktober 2007 8:31
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] Patch to add support to execute methods
withParamArray thought Reflection



This new diff fix a issue with boo, the problem is related to methods with
zero parameters but parameters are passed when calling SelectMethod in
Binder.cs

Mario


On 10/24/07, Mario Chavez <[EMAIL PROTECTED]> wrote: 

Hi;

Currently reflection does not support methods that have ParamArray attribute
to be called with InvokeMember, like:

... some class 
public static void TestMethod(params string[] param1)
    {
        Console.WriteLine("Test Method 3, one params");
    }
.... some class

Type type = typeof(ParamArrayTest);
        object obj = type.InvokeMember("TestMethod", InvokeBindingFlags,
null, null, new object[] {"param1"}); 

it fails with:

Unhandled Exception: System.MissingMethodException: The best match for
method TestMethod has some invalid parameter.
  at System.MonoType.InvokeMember (System.String name, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object target,
System.Object[] args, System.Reflection.ParameterModifier[] modifiers,
System.Globalization.CultureInfo culture, System.String[] namedParameters)
[0x00000] 
  at System.Type.InvokeMember (System.String name, BindingFlags invokeAttr,
System.Reflection.Binder binder, System.Object target, System.Object[] args)
[0x00000] 
  at ParamArrayTest.Main (System.String[] args) [0x00000] 

This patch for Binder.cs and MonoType.cs allows this type of calling, which
by the way does work on MS .NET

I hope that this patch is good enough to go into Mono

Thanks
-- 
Mario Chavez
[EMAIL PROTECTED]
http://mario-chavez.blogspot.com/ 





-- 
Mario Chavez
[EMAIL PROTECTED]
http://mario-chavez.blogspot.com/  <http://mario-chavez.blogspot.com/> 
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to