Files
kotlin/compiler/testData/codegen/bytecodeText/whenEnumOptimization/expression.kt
2015-08-10 16:24:12 +03:00

27 lines
485 B
Kotlin
Vendored

import kotlin.test.assertEquals
enum class Season {
WINTER,
SPRING,
SUMMER,
AUTUMN
}
fun bar1(x : Season) : String {
return when (x) {
Season.WINTER, Season.SPRING -> "winter_spring"
Season.SUMMER -> "summer"
else -> "autumn"
}
}
fun bar2(x : Season) : String {
return when (x) {
Season.WINTER, Season.SPRING -> "winter_spring"
Season.SUMMER -> "summer"
Season.AUTUMN -> "autumn"
}
}
// 2 TABLESWITCH