[FIR] Resolve array literal with non-primitive-array expected type as arrayOf call

This lets us properly complete the call which fixes some issues with
false-positive type mismatches.
This change doesn't apply to array literals in annotation calls yet
because they are resolved as context-dependent.
This will be adapted in a following commit.

#KT-59581
This commit is contained in:
Kirill Rakhman
2023-07-04 14:27:43 +02:00
committed by Space Team
parent 4ead02271b
commit ff6b3350ae
16 changed files with 92 additions and 118 deletions
@@ -56,6 +56,9 @@ val ConeKotlinType.isNonPrimitiveArray: Boolean
val ConeKotlinType.isPrimitiveArray: Boolean
get() = this is ConeClassLikeType && lookupTag.classId in StandardClassIds.primitiveArrayTypeByElementType.values
val ConeKotlinType.isPrimitiveOrUnsignedArray: Boolean
get() = this is ConeClassLikeType && (lookupTag.classId in StandardClassIds.primitiveArrayTypeByElementType.values || lookupTag.classId in StandardClassIds.unsignedArrayTypeByElementType.values)
val ConeKotlinType.isUnsignedTypeOrNullableUnsignedType: Boolean get() = isAnyOfBuiltinType(StandardClassIds.unsignedTypes)
val ConeKotlinType.isUnsignedType: Boolean get() = isUnsignedTypeOrNullableUnsignedType && nullability == ConeNullability.NOT_NULL