2010-04-16 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Fri, 16 Apr 2010 21:37:12 +0000 (21:37 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 16 Apr 2010 21:37:12 +0000 (21:37 -0000)
* 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
mcs/class/corlib/System/MonoType.cs

index 3ccf94db573a1caa557319bff3462e5e5bc1e9ce..5b55f78df87ef05bd4685fc59a0e630e318ae3dd 100644 (file)
@@ -1,3 +1,10 @@
+2010-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * MonoType.cs (GetInterface): Compare against the name
+       of the generic type definition.
+
+       Fixes #484246.
+
 2010-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * MonoCustomAttrs.cs (GetBasePropertyDefinition): Use
index f5bf38edad3d14e4fc6f6f571d7b8d882bbbbcaf..fe3bca9630b553fcffe19b47b5b6b7d64d126d1b 100644 (file)
@@ -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;
                        }