mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
Generate TABLESWITCH/LOOKUPSWITCH bytecode operation for when operator by String constants
10 lines
172 B
Kotlin
Vendored
10 lines
172 B
Kotlin
Vendored
fun foo(x : String) : String {
|
|
return when (x) {
|
|
"abc", "cde" -> "abc_cde"
|
|
"efg", "ghi" -> "efg_ghi"
|
|
else -> "other"
|
|
}
|
|
}
|
|
|
|
// 1 LOOKUPSWITCH
|