[interpreter] inflate method signature for delegate.invoke ()
authorBernhard Urban <bernhard.urban@xamarin.com>
Mon, 27 Feb 2017 16:55:53 +0000 (17:55 +0100)
committerBernhard Urban <bernhard.urban@xamarin.com>
Tue, 28 Feb 2017 21:59:28 +0000 (22:59 +0100)
mono/mini/interpreter/transform.c
mono/mini/objects.cs

index 5e4c1aaac4bb6223754fe77f98b5479fbf8a8f5d..7aa65c5d0c17b0a47883e6e0788601380988e66e 100644 (file)
@@ -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 */
index 9cbbcd28f54f9d61fc1ff59fd77932beab6135d6..005e276fbb18d565934733bc3d15e54b24c5fff2 100644 (file)
@@ -907,14 +907,12 @@ class Tests {
                }
        }
 
-       [Category ("!INTERPRETER")]
        public static int test_42_vtype_delegate () {
                var s = new VtypeVirtualDelStruct () { f = 42 };
                Func<int> f = s.return_field_nonvirt;
                return f ();
        }
 
-       [Category ("!INTERPRETER")]
        public static int test_42_vtype_virtual_delegate () {
                IFaceVirtualDel s = new VtypeVirtualDelStruct () { f = 42 };
                Func<int> f = s.return_field;