New test.
[mono.git] / mcs / class / corlib / System.Reflection / MonoGenericClass.cs
index 1a51976778233836994998af6ef44fdc15c8abf8..345b5d99c68c21cb67a8ca94ffb3de6fb346353f 100644 (file)
@@ -518,5 +518,28 @@ namespace System.Reflection
                {
                        return generic_type.GetNestedTypes (bf);
                }
+
+               public override bool IsAssignableFrom (Type c)
+               {
+                       if (c == this)
+                               return true;
+
+                       MonoGenericClass[] interfaces = GetInterfaces_internal ();
+
+                       if (c.IsInterface) {
+                               if (interfaces == null)
+                                       return false;
+                               foreach (Type t in interfaces)
+                                       if (c.IsAssignableFrom (t))
+                                               return true;
+                               return false;
+                       }
+
+                       Type parent = GetParentType ();
+                       if (parent == null)
+                               return c == typeof (object);
+                       else
+                               return c.IsAssignableFrom (parent);
+               }
        }
 }