if (initialized)
return;
- MonoGenericClass parent = GetParentType ();
+ MonoGenericClass parent = GetParentType () as MonoGenericClass;
if (parent != null)
parent.initialize ();
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- protected extern MonoGenericClass GetParentType ();
+ protected extern Type GetParentType ();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
protected extern MonoGenericClass[] GetInterfaces_internal ();
public override Type BaseType {
get {
- MonoGenericClass parent = GetParentType ();
+ Type parent = GetParentType ();
return parent != null ? parent : generic_type.BaseType;
}
}
{
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);
+ }
}
}