From 989e423533552c3fb16c282105caeef9d605328c Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Fri, 16 Apr 2010 21:37:12 +0000 Subject: [PATCH] 2010-04-16 Rodrigo Kumpera * MonoType.cs (GetInterface): Compare against the name of the generic type definition. Fixes #484246. svn path=/trunk/mcs/; revision=155664 --- mcs/class/corlib/System/ChangeLog | 7 +++++++ mcs/class/corlib/System/MonoType.cs | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mcs/class/corlib/System/ChangeLog b/mcs/class/corlib/System/ChangeLog index 3ccf94db573..5b55f78df87 100644 --- a/mcs/class/corlib/System/ChangeLog +++ b/mcs/class/corlib/System/ChangeLog @@ -1,5 +1,12 @@ 2010-04-16 Rodrigo Kumpera + * MonoType.cs (GetInterface): Compare against the name + of the generic type definition. + + Fixes #484246. + +2010-04-16 Rodrigo Kumpera + * MonoCustomAttrs.cs (GetBasePropertyDefinition): Use GetBaseMethod instead of GetMethodDefinition otherwise we skip intermediate overloads. diff --git a/mcs/class/corlib/System/MonoType.cs b/mcs/class/corlib/System/MonoType.cs index f5bf38edad3..fe3bca9630b 100644 --- a/mcs/class/corlib/System/MonoType.cs +++ b/mcs/class/corlib/System/MonoType.cs @@ -182,9 +182,12 @@ namespace System Type[] interfaces = GetInterfaces(); foreach (Type type in interfaces) { - if (String.Compare (type.Name, name, ignoreCase, CultureInfo.InvariantCulture) == 0) + /*We must compare against the generic type definition*/ + Type t = type.IsGenericType ? type.GetGenericTypeDefinition () : type; + + if (String.Compare (t.Name, name, ignoreCase, CultureInfo.InvariantCulture) == 0) return type; - if (String.Compare (type.FullName, name, ignoreCase, CultureInfo.InvariantCulture) == 0) + if (String.Compare (t.FullName, name, ignoreCase, CultureInfo.InvariantCulture) == 0) return type; } -- 2.11.4.GIT