Is there a way in Kotlin to print through reflecti...
# reflect
d
Is there a way in Kotlin to print through reflection the type o a class like Selected<Person>? The goal is to print “Selected<Person>“, but with normal reflection methods it is not possible. The only result at runtime is “Selected”.
d
A class (as in
KClass
) can not represent that. You need a
KType
, which you can get using
typeOf<Selected<Person>>()
d
Nice! It works! Thank you very much!
Unfortunately type of needs for ExperimentalStdlibApi, but I think it is the only option