mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 15:53:40 +00:00
13 lines
240 B
Kotlin
Vendored
13 lines
240 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
sealed class Season {
|
|
object Warm: Season()
|
|
object Cold: Season()
|
|
}
|
|
|
|
fun foo(): Season = Season.Warm
|
|
|
|
fun box() = when(foo()) {
|
|
Season.Warm -> "OK"
|
|
Season.Cold -> "Fail: Cold, should be Warm"
|
|
}
|