From 4a7fcac07559a6458e3d8a5fb01f2bc182153ab3 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 9 Sep 2015 16:10:19 +0100 Subject: [delegate] Fix bug #33218 "Action ReflectedType differs from Delegate ReflectedType" --- mcs/class/corlib/System/Delegate.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mcs/class/corlib') diff --git a/mcs/class/corlib/System/Delegate.cs b/mcs/class/corlib/System/Delegate.cs index c2f92a7f73b..ba97e726509 100644 --- a/mcs/class/corlib/System/Delegate.cs +++ b/mcs/class/corlib/System/Delegate.cs @@ -68,6 +68,8 @@ namespace System private MethodInfo original_method_info; private DelegateData data; + + private bool method_is_virtual; #pragma warning restore 169, 414, 649 #endregion @@ -103,13 +105,19 @@ namespace System return method_info; } else { if (method != IntPtr.Zero) { - method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method)); + if (!method_is_virtual) + method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method)); + else + method_info = GetVirtualMethod_internal (); } return method_info; } } } + [MethodImplAttribute (MethodImplOptions.InternalCall)] + extern MethodInfo GetVirtualMethod_internal (); + public object Target { get { return m_target; -- cgit v1.2.3