mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-07 08:31:28 +00:00
27 lines
485 B
Kotlin
Vendored
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
|