mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
12 lines
225 B
Kotlin
Vendored
12 lines
225 B
Kotlin
Vendored
fun foo(x: String): String {
|
|
return when (val y = x) {
|
|
"1" -> "one"
|
|
"2" -> "two"
|
|
"3" -> "two and one"
|
|
"4" -> "two and two"
|
|
else -> "many"
|
|
}
|
|
}
|
|
|
|
// 0 LOOKUPSWITCH
|
|
// 1 TABLESWITCH |