mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Generate TABLESWITCH/LOOKUPSWITCH bytecode operation for when operator by String constants
12 lines
199 B
Kotlin
Vendored
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
|