From: Bernhard Urban Date: Mon, 27 Feb 2017 16:55:53 +0000 (+0100) Subject: [interpreter] inflate method signature for delegate.invoke () X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=02782549c3f8387cc4cb85ee407bc6808bbbcbda;p=mono.git [interpreter] inflate method signature for delegate.invoke () --- diff --git a/mono/mini/interpreter/transform.c b/mono/mini/interpreter/transform.c index 5e4c1aaac4b..7aa65c5d0c1 100644 --- a/mono/mini/interpreter/transform.c +++ b/mono/mini/interpreter/transform.c @@ -692,6 +692,12 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target csignature = mono_method_signature (target_method); } + /* TODO: that's oddly specific? */ + if (generic_context && target_method && !strcmp ("Invoke", target_method->name) && target_method->klass->parent == mono_defaults.multicastdelegate_class) { + csignature = mono_inflate_generic_signature (csignature, generic_context, &error); + mono_error_cleanup (&error); /* FIXME: don't swallow the error */ + } + if (constrained_class) { if (constrained_class->enumtype && !strcmp (target_method->name, "GetHashCode")) { /* Use the corresponding method from the base type to avoid boxing */ diff --git a/mono/mini/objects.cs b/mono/mini/objects.cs index 9cbbcd28f54..005e276fbb1 100644 --- a/mono/mini/objects.cs +++ b/mono/mini/objects.cs @@ -907,14 +907,12 @@ class Tests { } } - [Category ("!INTERPRETER")] public static int test_42_vtype_delegate () { var s = new VtypeVirtualDelStruct () { f = 42 }; Func f = s.return_field_nonvirt; return f (); } - [Category ("!INTERPRETER")] public static int test_42_vtype_virtual_delegate () { IFaceVirtualDel s = new VtypeVirtualDelStruct () { f = 42 }; Func f = s.return_field;