Value: Make GetMethod more specific to avoid ambigous matches

This patch prevents GetMethod from throwing an AmbiguousMatchException because several constructors were found.
This commit is contained in:
Stephan Sundermann 2014-06-10 15:23:10 +02:00
parent 8885fa98af
commit 839a32d797

View file

@ -424,7 +424,7 @@ namespace GLib {
else if (t.IsSubclassOf (typeof (GLib.Opaque)))
return (GLib.Opaque) this;
MethodInfo mi = t.GetMethod ("New", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
MethodInfo mi = t.GetMethod ("New", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy, null, new Type[] { typeof(IntPtr) }, null);
if (mi != null)
return mi.Invoke (null, new object[] {boxed_ptr});