public static boolean isExtensionFunctionType(@NotNull JetType type) { if (isExactExtensionFunctionType(type)) return true; for (JetType superType : type.getConstructor().getSupertypes()) { if (isExtensionFunctionType(superType)) return true; } return false; }
private static boolean isTypeConstructorFqNameInSet( @NotNull JetType type, @NotNull Set<FqNameUnsafe> classes) { ClassifierDescriptor declarationDescriptor = type.getConstructor().getDeclarationDescriptor(); if (declarationDescriptor == null) return false; FqNameUnsafe fqName = DescriptorUtils.getFqName(declarationDescriptor); return classes.contains(fqName); }
private static boolean isConstructedFromGivenClass( @NotNull JetType type, @NotNull FqNameUnsafe fqName) { ClassifierDescriptor descriptor = type.getConstructor().getDeclarationDescriptor(); return descriptor != null && fqName.equals(DescriptorUtils.getFqName(descriptor)); }
public static boolean isPrimitiveType(@NotNull JetType type) { ClassifierDescriptor descriptor = type.getConstructor().getDeclarationDescriptor(); return !type.isMarkedNullable() && descriptor != null && FQ_NAMES.primitiveTypes.contains(DescriptorUtils.getFqName(descriptor)); }