mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
Includes changes to decompiled text Old syntax is used in builtins and project code for now
30 lines
681 B
Kotlin
30 lines
681 B
Kotlin
import kotlin.test.assertEquals
|
|
|
|
class A {
|
|
default object {
|
|
enum class Season {
|
|
WINTER
|
|
SPRING
|
|
SUMMER
|
|
AUTUMN
|
|
}
|
|
}
|
|
}
|
|
|
|
fun foo(x : A.Default.Season) : String {
|
|
return when (x) {
|
|
A.Default.Season.WINTER -> "winter"
|
|
A.Default.Season.SPRING -> "spring"
|
|
A.Default.Season.SUMMER -> "summer"
|
|
else -> "other"
|
|
}
|
|
}
|
|
|
|
fun box() : String {
|
|
assertEquals("winter", foo(A.Default.Season.WINTER))
|
|
assertEquals("spring", foo(A.Default.Season.SPRING))
|
|
assertEquals("summer", foo(A.Default.Season.SUMMER))
|
|
assertEquals("other", foo(A.Default.Season.AUTUMN))
|
|
return "OK"
|
|
}
|