Example #1
0
  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;
  }
Example #2
0
  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);
  }
Example #3
0
 private static boolean isConstructedFromGivenClass(
     @NotNull JetType type, @NotNull FqNameUnsafe fqName) {
   ClassifierDescriptor descriptor = type.getConstructor().getDeclarationDescriptor();
   return descriptor != null && fqName.equals(DescriptorUtils.getFqName(descriptor));
 }
Example #4
0
 public static boolean isPrimitiveType(@NotNull JetType type) {
   ClassifierDescriptor descriptor = type.getConstructor().getDeclarationDescriptor();
   return !type.isMarkedNullable()
       && descriptor != null
       && FQ_NAMES.primitiveTypes.contains(DescriptorUtils.getFqName(descriptor));
 }