Files
kotlin/compiler/testData/codegen/bytecodeText/whenStringOptimization/expression.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

10 lines
172 B
Kotlin

fun foo(x : String) : String {
return when (x) {
"abc", "cde" -> "abc_cde"
"efg", "ghi" -> "efg_ghi"
else -> "other"
}
}
// 1 LOOKUPSWITCH