~If I have a value `t: T`, why does `t::class` ret...
# random
s
If I have a value
t: T
, why does
t::class
return
KClass<out T>
and not
KClass<T>
?
Surely it’s guaranteed that
t::class
is the exact class of
t
, not a superclass?
Curiously,
t.javaClass.kotlin
does give `KClass<T>`…
The comment on StackOverflow helped me get my head around it. I was assuming that
T
is always the exact type of
t
, but really
T
could be any supertype of the actual type.