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
215 B
Kotlin
Vendored
12 lines
215 B
Kotlin
Vendored
import kotlin.test.assertEquals
|
|
|
|
fun foo(x : String) : String {
|
|
when (x) {
|
|
"abc" -> return "abc"
|
|
"efg", "ghi", "abc" -> return "efg_ghi"
|
|
else -> return "other"
|
|
}
|
|
}
|
|
|
|
// 1 LOOKUPSWITCH
|