+2008-07-04 Rodrigo Kumpera <rkumpera@n ovell.com>
+
+ * MethodBase.cs (GetMethodFromHandle): Extract an internal version
+ of this function that doesn't perform the generic class check.
+ This method is required to fix the Delegate regression that fixing
+ #377324 caused.
+
2008-06-25 Rodrigo Kumpera <rkumpera@n ovell.com>
* MethodBase.cs (GetMethodFromHandle): Check if the icall returns null
[MethodImplAttribute (MethodImplOptions.InternalCall)]
public extern static MethodBase GetCurrentMethod ();
- public static MethodBase GetMethodFromHandle(RuntimeMethodHandle handle) {
+ internal static MethodBase GetMethodFromHandleNoGenericCheck (RuntimeMethodHandle handle) {
if (handle.Value == IntPtr.Zero)
throw new ArgumentException ("The handle is invalid.");
MethodBase res = GetMethodFromHandleInternalType (handle.Value, IntPtr.Zero);
if (res == null)
throw new ArgumentException ("The handle is invalid.");
+ return res;
+ }
+
+ public static MethodBase GetMethodFromHandle(RuntimeMethodHandle handle) {
+ MethodBase res = GetMethodFromHandleNoGenericCheck (handle);
+ Type t = res.DeclaringType;
#if NET_2_0
- if (res.DeclaringType.IsGenericType || res.DeclaringType.IsGenericTypeDefinition)
+ if (t.IsGenericType || t.IsGenericTypeDefinition)
throw new ArgumentException ("Cannot resolve method because it's declared in a generic class.");
#endif
return res;