> why this doesn't compile? `T::class` is of ty...
# announcements
a
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