Пример #1
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;
 }
Пример #2
0
 @NotNull
 public KotlinType getNullableAnyType() {
   return TypeUtils.makeNullable(getAnyType());
 }
Пример #3
0
 @NotNull
 public KotlinType getNullableNothingType() {
   return TypeUtils.makeNullable(getNothingType());
 }