Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/sealed/objects.kt
T
Ilya Matveev 1b553ebfaf backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
2017-01-20 14:04:04 +03:00

12 lines
210 B
Kotlin

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"
}