Don't save constant value for non-resolved array expression in K1

#KT-55912 Fixed
This commit is contained in:
Ivan Kylchik
2023-01-23 18:02:19 +01:00
committed by Space Team
parent 8fcea399f9
commit 13cad2a820
15 changed files with 89 additions and 13 deletions
@@ -101,6 +101,15 @@ fun KotlinType?.isArrayOfNothing(): Boolean {
return typeArg != null && KotlinBuiltIns.isNothingOrNullableNothing(typeArg)
}
fun KotlinType.isGenericArrayOfTypeParameter(): Boolean {
if (!KotlinBuiltIns.isArray(this)) return false
val argument0 = arguments[0]
if (argument0.isStarProjection) return false
val argument0type = argument0.type
return argument0type.isTypeParameter() ||
argument0type.isGenericArrayOfTypeParameter()
}
fun KotlinType.isSubtypeOf(superType: KotlinType): Boolean = KotlinTypeChecker.DEFAULT.isSubtypeOf(this, superType)