39bd97147f
Usually FIR enum entry is initialized by anonymous object, which is the container for all enum entry' declarations. However, for simple enum entries there is no need of initializer at all.
13 lines
170 B
Kotlin
Vendored
13 lines
170 B
Kotlin
Vendored
enum class Season {
|
|
WINTER,
|
|
SPRING,
|
|
SUMMER,
|
|
AUTUMN
|
|
}
|
|
|
|
fun foo(): Season = Season.SPRING
|
|
|
|
fun box() =
|
|
if (foo() == Season.SPRING) "OK"
|
|
else "fail"
|