FIR checker: createPrimitiveArrayType -> createPrimitiveArrayTypeIfPossible
This commit is contained in:
committed by
teamcityserver
parent
b8b9502db4
commit
ef80a8ebf6
+1
-1
@@ -779,7 +779,7 @@ class FirCallCompletionResultsWriterTransformer(
|
|||||||
?: it
|
?: it
|
||||||
} ?: expectedArrayElementType ?: session.builtinTypes.nullableAnyType.type
|
} ?: expectedArrayElementType ?: session.builtinTypes.nullableAnyType.type
|
||||||
arrayOfCall.resultType = arrayOfCall.typeRef.resolvedTypeFromPrototype(
|
arrayOfCall.resultType = arrayOfCall.typeRef.resolvedTypeFromPrototype(
|
||||||
arrayElementType.createArrayType(createPrimitiveArrayType = expectedArrayType?.isPrimitiveArray == true)
|
arrayElementType.createArrayType(createPrimitiveArrayTypeIfPossible = expectedArrayType?.isPrimitiveArray == true)
|
||||||
)
|
)
|
||||||
return arrayOfCall
|
return arrayOfCall
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ fun ConeKotlinType.createOutArrayType(nullable: Boolean = false, createPrimitive
|
|||||||
return ConeKotlinTypeProjectionOut(this).createArrayType(nullable, createPrimitiveArrayType)
|
return ConeKotlinTypeProjectionOut(this).createArrayType(nullable, createPrimitiveArrayType)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun ConeTypeProjection.createArrayType(nullable: Boolean = false, createPrimitiveArrayType: Boolean = true): ConeClassLikeType {
|
fun ConeTypeProjection.createArrayType(nullable: Boolean = false, createPrimitiveArrayTypeIfPossible: Boolean = true): ConeClassLikeType {
|
||||||
if (this is ConeKotlinTypeProjection && createPrimitiveArrayType) {
|
if (this is ConeKotlinTypeProjection && createPrimitiveArrayTypeIfPossible) {
|
||||||
val type = type.lowerBoundIfFlexible()
|
val type = type.lowerBoundIfFlexible()
|
||||||
if (type is ConeClassLikeType && type.nullability != ConeNullability.NULLABLE) {
|
if (type is ConeClassLikeType && type.nullability != ConeNullability.NULLABLE) {
|
||||||
val classId = type.lookupTag.classId
|
val classId = type.lookupTag.classId
|
||||||
|
|||||||
Reference in New Issue
Block a user