@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; }
/** @return {@code null} if not primitive */ @Nullable public KotlinType getPrimitiveArrayKotlinTypeByPrimitiveKotlinType( @NotNull KotlinType kotlinType) { return primitiveKotlinTypeToKotlinArrayType.get(kotlinType); }
@NotNull public KotlinType getPrimitiveArrayKotlinType(@NotNull PrimitiveType primitiveType) { return primitiveTypeToArrayKotlinType.get(primitiveType); }
/** @return <code>null</code> if not primitive */ @Nullable public JetType getPrimitiveArrayJetTypeByPrimitiveJetType(@NotNull JetType jetType) { return primitiveJetTypeToJetArrayType.get(jetType); }
@NotNull public JetType getPrimitiveArrayJetType(@NotNull PrimitiveType primitiveType) { return primitiveTypeToArrayJetType.get(primitiveType); }
@NotNull public JetType getNullablePrimitiveJetType(@NotNull PrimitiveType primitiveType) { return primitiveTypeToNullableJetType.get(primitiveType); }