Files
kotlin/compiler/testData/codegen/bytecodeText/when/noBoxingInDefaultWhenWithSpecialCases.kt
2020-02-20 14:20:21 +03:00

21 lines
408 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// TODO KT-36646 Don't box primitive values in equality comparison with objects in JVM_IR
fun testInt(i: Int?) =
when (i) {
0 -> "zero"
42 -> "magic"
else -> "other"
}
fun testLong(i: Long?) =
when (i) {
0L -> "zero"
42L -> "magic"
else -> "other"
}
// 0 valueOf
// 0 Integer.valueOf
// 0 Long.valueOf
// 0 areEqual