marcinmoskala
04/06/2020, 3:18 PMRoundEnvironment
. Got TypeElement
but don’t have any idea how to make KClass out of that. Any ideas?diesieben07
04/07/2020, 7:25 AMKClass
is a runtime representation. But during kapt the code is still being compiled, there is no runtime.
What you can do is extract the @kotlin.Metadata
annotation from the classes and then use kotlinx-metadata-jvm
to parse the Kotlin-specific information. Its not as easy to use as just KClass
, but if you absolutely need some Kotlin-specific information out of the class you can use it.
https://github.com/JetBrains/kotlin/tree/master/libraries/kotlinx-metadata/jvmmarcinmoskala
04/07/2020, 5:38 PM