Files
kotlin/compiler/testData/codegen/bytecodeText/when/noBoxingInDefaultWhenWithSpecialCases.kt
Dmitry Petrov 2ed5a5e368 'when' should use intrinsics for '=='
#KT-19029 Fixed Target versions 1.1.5
 #KT-18818 Fixed Target versions 1.1.5
2017-08-07 10:31:02 +03:00

27 lines
497 B
Kotlin
Vendored

// FILE: C.kt
class CInt(val value: Int)
val nCInt3: CInt? = CInt(3)
class CLong(val value: Long)
val nCLong3: CLong? = CLong(3)
// FILE: test.kt
fun testInt(i: Int?) =
when (i) {
0 -> "zero"
42 -> "magic"
else -> "other"
}
fun testLong(i: Long?) =
when (i) {
0L -> "zero"
42L -> "magic"
else -> "other"
}
// @TestKt.class:
// 0 valueOf
// 0 Integer.valueOf
// 0 Long.valueOf
// 0 areEqual