[Mono-dev] [PATCH] MonoMethod.cs

Miguel de Icaza miguel at novell.com
Tue Mar 3 11:02:34 EST 2009


Hello,

    This patch would require both a ChangeLog entry as well as updated
NUnit test cases to go with it, exposing the intended behavior and the
buggy behavior.

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> To whom it may concern,
> 
> I was migrating some code from Mono 1.x to .NET 3.5 and came across a
> very small bug. I was calling MonoMethod.Invoke like so:
> 
> MethodInfo method = type.GetMethod("Foo"); // Foo(int i, string name);
> 
> method.Invoke(obj,
>               BindingFlags.ExactBinding,
>               new CustomerBinder(),
>               new object[]{"0", "one"},
>               null);
> 
> When using Mono the code above works, but on .NET it does not because
> BindingFlags.ExactBinding(1) apparently means that the Binder's
> ChangeType method is not supposed to be called. Therefore the string "0"
> is never converted to an int (as required by the signature for Foo).
> 
> I've attached a very small patch for this. Please let me know if there
> is anything else I can do.
> 
> Regards,
> 
> ~ Matthew
> 
> (1)
> http://msdn.microsoft.com/en-us/library/system.reflection.bindingflags(VS.80).aspx
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkmn/cQACgkQLrcoBjlTBf1bIQCfWMh9d9n7VGiUk7D1ziLtUixC
> tiwAn1iet8LbeoVsviq8ywfuWKeLrgK5
> =QIaU
> -----END PGP SIGNATURE-----
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list