public static boolean isDirectSubclass( @NotNull ClassDescriptor subClass, @NotNull ClassDescriptor superClass) { for (KotlinType superType : subClass.getTypeConstructor().getSupertypes()) { if (isSameClass(superType, superClass.getOriginal())) { return true; } } return false; }
public static boolean isSubclass( @NotNull ClassDescriptor subClass, @NotNull ClassDescriptor superClass) { return isSubtypeOfClass(subClass.getDefaultType(), superClass.getOriginal()); }