Is there any way for kotlin to easily get generic information on a class?

I can get it by reflection when I write java. I wonder if there are other convenient ways for kotlin.

Mar.10,2021

Kotlin, like Java, still requires reflection to get generic information. The reflection API of


Kotlin (from kotlin-reflect.jar) can get the generic parameter list of the class through the arguments of KType.

Menu