public static boolean isExtensionFunctionType(@NotNull KotlinType type) {
    if (isExactExtensionFunctionType(type)) return true;

    for (KotlinType superType : type.getConstructor().getSupertypes()) {
      if (isExtensionFunctionType(superType)) return true;
    }

    return false;
  }
 private static boolean isConstructedFromGivenClass(
     @NotNull KotlinType type, @NotNull FqNameUnsafe fqName) {
   ClassifierDescriptor descriptor = type.getConstructor().getDeclarationDescriptor();
   return descriptor != null
       &&
       /* quick check to avoid creation of full FqName instance */ descriptor
           .getName()
           .equals(fqName.shortName())
       && fqName.equals(getFqName(descriptor));
 }
 public static boolean isExactFunctionOrExtensionFunctionType(@NotNull KotlinType type) {
   ClassifierDescriptor descriptor = type.getConstructor().getDeclarationDescriptor();
   return descriptor != null && isNumberedFunctionClassFqName(getFqName(descriptor));
 }
 public static boolean isPrimitiveType(@NotNull KotlinType type) {
   ClassifierDescriptor descriptor = type.getConstructor().getDeclarationDescriptor();
   return !type.isMarkedNullable()
       && descriptor instanceof ClassDescriptor
       && isPrimitiveClass((ClassDescriptor) descriptor);
 }
 public static boolean isPrimitiveArray(@NotNull KotlinType type) {
   ClassifierDescriptor descriptor = type.getConstructor().getDeclarationDescriptor();
   return descriptor != null && getPrimitiveTypeByArrayClassFqName(getFqName(descriptor)) != null;
 }