Files
kotlin/compiler/testData/codegen/bytecodeText/ranges/noDupXForLiteralRangeContains.kt
Dmitry Petrov 354d54aef6 Don't generate DUPX instructions for in-range-literal expressions
Store argument into a local variable instead.
2017-11-16 10:54:25 +03:00

12 lines
255 B
Kotlin
Vendored

// WITH_RUNTIME
fun test(a: Int) = a in 1 .. 10
fun test(a: Long) = a in 1L .. 10L
fun test(a: Float) = a in 1.0f .. 10.0f
fun test(a: Double) = a in 1.0 .. 10.0
fun test(a: String) = a in "abc" .. "def"
// 0 DUP_X1
// 0 DUP2_X1
// 0 DUP_X2
// 0 DUP2_X2