I’m sure this has been asked, but i wanted to confirm my suspicions that kotlin-reflect is a jvm only library. I have things i would like to do with meta programming, but i’m not sure i could make that work on iOS code (i’m not targeting JS, just android and ios), Swift itself has the Mirror functionality for reflection, but it’s my understanding that kmm doesn’t really deal in swift and compiles directly to down to binary code.
@Trevor Stone I’m basically thinking retrofit like things. Inspecting the annotations at runtime and generating interface implementations based on it. Not necessarily to execute http requests, but similar type approach.
t
Trevor Stone
09/03/2022, 2:19 AM
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/ it looks like Annotations can be used in kotlin native but I haven't done it before. Personally, I would go down the ksp route to generate the code at compile time with KotlinPoet vs using reflection but seems like both could be viable