FIR checker: createPrimitiveArrayType -> createPrimitiveArrayTypeIfPossible

This commit is contained in:
Tianyu Geng
2021-09-08 16:54:52 -07:00
committed by teamcityserver
parent b8b9502db4
commit ef80a8ebf6
2 changed files with 3 additions and 3 deletions
@@ -779,7 +779,7 @@ class FirCallCompletionResultsWriterTransformer(
?: it
} ?: expectedArrayElementType ?: session.builtinTypes.nullableAnyType.type
arrayOfCall.resultType = arrayOfCall.typeRef.resolvedTypeFromPrototype(
arrayElementType.createArrayType(createPrimitiveArrayType = expectedArrayType?.isPrimitiveArray == true)
arrayElementType.createArrayType(createPrimitiveArrayTypeIfPossible = expectedArrayType?.isPrimitiveArray == true)
)
return arrayOfCall
}
@@ -14,8 +14,8 @@ fun ConeKotlinType.createOutArrayType(nullable: Boolean = false, createPrimitive
return ConeKotlinTypeProjectionOut(this).createArrayType(nullable, createPrimitiveArrayType)
}
fun ConeTypeProjection.createArrayType(nullable: Boolean = false, createPrimitiveArrayType: Boolean = true): ConeClassLikeType {
if (this is ConeKotlinTypeProjection && createPrimitiveArrayType) {
fun ConeTypeProjection.createArrayType(nullable: Boolean = false, createPrimitiveArrayTypeIfPossible: Boolean = true): ConeClassLikeType {
if (this is ConeKotlinTypeProjection && createPrimitiveArrayTypeIfPossible) {
val type = type.lowerBoundIfFlexible()
if (type is ConeClassLikeType && type.nullability != ConeNullability.NULLABLE) {
val classId = type.lookupTag.classId