grandstaish
01/19/2019, 2:01 PMx::class
produces KClass<out T>
instead of just KClass<T>
in the following snippet?
class Test<T : Any>(val x: T) {
fun type(): KClass<T> = x::class // doesn't compile bc types don't match!
}
And a follow-up question, is there any way to make this compile without having to cast the result of x::class
to KClass<T>
?Dico
01/19/2019, 9:47 PM