https://kotlinlang.org logo
p

Peter

06/07/2021, 6:29 PM
does anyone know if it’s possible to get a reference to the KClass of a generic type parameter? eg.
inline fun <reified T>test() { typeOf<T>()... }
r

Roukanken

06/07/2021, 6:30 PM
you can just do
T::class
(if it's reified), that should get ya what you want no?
❤️ 1
p

Peter

06/07/2021, 6:32 PM
perfect, thank you!
2 Views