diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/constants/CompileTimeConstant.kt b/core/descriptors/src/org/jetbrains/kotlin/resolve/constants/CompileTimeConstant.kt index c81dfbe4400..8d15b904e3a 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/resolve/constants/CompileTimeConstant.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/constants/CompileTimeConstant.kt @@ -63,14 +63,15 @@ public class IntegerValueTypeConstant( override fun toConstantValue(expectedType: JetType): ConstantValue { val factory = ConstantValueFactory(KotlinBuiltIns.getInstance()) - return when (getType(expectedType)) { - KotlinBuiltIns.getInstance().getIntType() -> { + val type = getType(expectedType) + return when { + KotlinBuiltIns.isInt(type) -> { factory.createIntValue(value.toInt()) } - KotlinBuiltIns.getInstance().getByteType() -> { + KotlinBuiltIns.isByte(type) -> { factory.createByteValue(value.toByte()) } - KotlinBuiltIns.getInstance().getShortType() -> { + KotlinBuiltIns.isShort(type) -> { factory.createShortValue(value.toShort()) } else -> {