Files
kotlin-fork/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnTriangleStar.kt
T
2017-01-20 11:04:54 +03:00

24 lines
323 B
Kotlin
Vendored

sealed class A
sealed class B : A()
class C : B()
class D : B()
fun test(a: A): Any {
return when (a) {
is C -> ""
is D -> ""
}
}
fun test2(a: A): Any {
return when (a) {
is B -> ""
}
}
fun test3(a: A): Any {
return <!NO_ELSE_IN_WHEN!>when<!> (a) {
is D -> ""
}
}