Files
kotlin/compiler/testData/codegen/bytecodeText/whenEnumOptimization/expression.kt
Alexander Udalov c57441b51b Use '$' instead of '-' in package part class names
Otherwise some tools break (e.g. CheckMethodAdapter in ASM, used in generic
signature writer) because they expect class names to be Java identifiers.

Some tests fixed, some will be fixed in future commits
2014-09-26 10:22:20 +04:00

27 lines
482 B
Kotlin

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