Beispiel #1
0
  private void makePrimitive(@NotNull PrimitiveType primitiveType) {
    JetType type = getBuiltInTypeByClassName(primitiveType.getTypeName().asString());
    JetType arrayType = getBuiltInTypeByClassName(primitiveType.getArrayTypeName().asString());

    primitiveTypeToNullableJetType.put(primitiveType, TypeUtils.makeNullable(type));
    primitiveTypeToArrayJetType.put(primitiveType, arrayType);
    primitiveJetTypeToJetArrayType.put(type, arrayType);
    jetArrayTypeToPrimitiveJetType.put(arrayType, type);
  }
Beispiel #2
0
 @NotNull
 public KotlinType getArrayElementType(@NotNull KotlinType arrayType) {
   if (isArray(arrayType)) {
     if (arrayType.getArguments().size() != 1) {
       throw new IllegalStateException();
     }
     return arrayType.getArguments().get(0).getType();
   }
   KotlinType primitiveType =
       kotlinArrayTypeToPrimitiveKotlinType.get(TypeUtils.makeNotNullable(arrayType));
   if (primitiveType == null) {
     throw new IllegalStateException("not array: " + arrayType);
   }
   return primitiveType;
 }
Beispiel #3
0
 @NotNull
 public KotlinType getNullableAnyType() {
   return TypeUtils.makeNullable(getAnyType());
 }
Beispiel #4
0
 @NotNull
 public KotlinType getNullableNothingType() {
   return TypeUtils.makeNullable(getNothingType());
 }