https://kotlinlang.org logo
a

arekolek

05/21/2018, 12:47 PM
why this doesn't compile?
T::class
is of type
KClass<T : Foo>
, and that is not a sealed class Also, if you run:
Copy code
val par: List<Foo> = listOf(Foo1(), Foo2())
test(par)
Then
T
is
Foo
so none of the branches in your
when
would be executed