Beispiel #1
0
 @NotNull
 public KotlinType getEnumType(@NotNull KotlinType argument) {
   Variance projectionType = Variance.INVARIANT;
   List<TypeProjectionImpl> types =
       Collections.singletonList(new TypeProjectionImpl(projectionType, argument));
   return KotlinTypeImpl.create(Annotations.Companion.getEMPTY(), getEnum(), false, types);
 }
Beispiel #2
0
  @NotNull
  public KotlinType getFunctionType(
      @NotNull Annotations annotations,
      @Nullable KotlinType receiverType,
      @NotNull List<KotlinType> parameterTypes,
      @NotNull KotlinType returnType) {
    List<TypeProjection> arguments =
        getFunctionTypeArgumentProjections(receiverType, parameterTypes, returnType);
    int size = parameterTypes.size();
    ClassDescriptor classDescriptor =
        receiverType == null ? getFunction(size) : getExtensionFunction(size);

    Annotations typeAnnotations =
        receiverType == null ? annotations : addExtensionFunctionTypeAnnotation(annotations);

    return KotlinTypeImpl.create(typeAnnotations, classDescriptor, false, arguments);
  }