nhaarman
07/15/2016, 8:58 PMsealed class A
sealed class B : A()
class C : B()
class D : B()
fun test(a: A): Any {
return when (a) {
is C -> ""
is D -> ""
}
}
Why doesn't the compiler understand the when
expression is exhaustive? It tells me that I should add a case for B
.
Is this just not implemented yet, or is there more to this?
(This is written using the 1.1.0 syntax, but the same happens in 1.0.3)