5a1c995b5c
Generate TABLESWITCH/LOOKUPSWITCH bytecode command in case of "when" by enum entries
19 lines
287 B
Kotlin
19 lines
287 B
Kotlin
enum class Season {
|
|
WINTER
|
|
SPRING
|
|
SUMMER
|
|
AUTUMN
|
|
}
|
|
|
|
fun foo(x : Any) : String {
|
|
return when (x) {
|
|
Season.WINTER -> "winter"
|
|
Season.SPRING -> "spring"
|
|
Season.SUMMER -> "summer"
|
|
else -> "other"
|
|
}
|
|
}
|
|
|
|
// 0 TABLESWITCH
|
|
// 0 LOOKUPSWITCH
|