Files
kotlin/compiler/testData/codegen/bytecodeText/whenStringOptimization/nonInlinedConst.kt
Denis Zharkov d4cb822ee8 When by String constants:
Generate TABLESWITCH/LOOKUPSWITCH bytecode operation for when operator by String constants
2014-07-21 17:13:56 +04:00

12 lines
199 B
Kotlin
Vendored

fun foo(x : String) : String {
val y = "cde"
when (x) {
"abc", "${y}" -> return "abc_cde"
"e" + "fg", "ghi" -> return "efg_ghi"
}
return "other"
}
// 1 LOOKUPSWITCH