diff --git a/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmStringConcatenationLowering.kt b/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmStringConcatenationLowering.kt index feae62c6a2d..f33938df338 100644 --- a/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmStringConcatenationLowering.kt +++ b/compiler/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmStringConcatenationLowering.kt @@ -80,7 +80,7 @@ private fun JvmIrBuilder.normalizeArgument(expression: IrExpression): IrExpressi // upcast to 'String?' return irImplicitCast(expression, context.irBuiltIns.stringType.makeNullable()) } - if (!(type as IrSimpleType).hasQuestionMark) { + if (type is IrSimpleType && !type.hasQuestionMark || type is IrDefinitelyNotNullType) { if (upperBound.isByte() || upperBound.isShort()) { // Expression type is not null, // T <: Byte || T <: Short => diff --git a/compiler/testData/codegen/box/unsignedTypes/evaluateConstructorOfUnsignedArrayType.kt b/compiler/testData/codegen/box/unsignedTypes/evaluateConstructorOfUnsignedArrayType.kt index 1f78a794d4b..af6f5f856d1 100644 --- a/compiler/testData/codegen/box/unsignedTypes/evaluateConstructorOfUnsignedArrayType.kt +++ b/compiler/testData/codegen/box/unsignedTypes/evaluateConstructorOfUnsignedArrayType.kt @@ -1,8 +1,6 @@ // !LANGUAGE: -ApproximateIntegerLiteralTypesInReceiverPosition // WITH_REFLECT // TARGET_BACKEND: JVM -// KT-51458: -// IGNORE_BACKEND_FIR: JVM_IR annotation class AnnoUB(val ub: UByteArray) annotation class AnnoUS(val us: UShortArray) diff --git a/compiler/testData/codegen/box/unsignedTypes/evaluateConstructorOfUnsignedType.kt b/compiler/testData/codegen/box/unsignedTypes/evaluateConstructorOfUnsignedType.kt index 3a7c2fab450..3eb4952fb33 100644 --- a/compiler/testData/codegen/box/unsignedTypes/evaluateConstructorOfUnsignedType.kt +++ b/compiler/testData/codegen/box/unsignedTypes/evaluateConstructorOfUnsignedType.kt @@ -1,8 +1,6 @@ // !LANGUAGE: -ApproximateIntegerLiteralTypesInReceiverPosition // WITH_REFLECT // TARGET_BACKEND: JVM -// KT-51458: -// IGNORE_BACKEND_FIR: JVM_IR // TODO: it's not clear why compilation fails for Android // IGNORE_BACKEND: ANDROID