From a1a38e2eba3e7189d807736369d72c62f746c822 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Thu, 23 Jul 2015 18:30:58 +0300 Subject: [PATCH] Minor: CompileTimeConstant use utils instead of JetType#equals --- .../kotlin/resolve/constants/CompileTimeConstant.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 -> {