https://kotlinlang.org logo
j

josephivie

01/28/2019, 9:15 PM
I know this is probably specific to my use case only, but it would be mighty nice if I could instantiate an annotation class in common code. I’ve written an external reflection plugin and library, and have to use an awkward wrapper around annotation information because I can’t just instantiate the annotation class itself.
g

gildor

01/29/2019, 12:46 AM
Doesn't look like language proposal, maybe #multiplatform is better place to ask. Could you also give little bit more information, what is "external reflection plugin"?
j

josephivie

01/29/2019, 2:18 AM
It's absolutely a language proposal. Right now, the language seems to specifically restrict instantiating instances of annotations.
As for what an "external reflection plugin" is, I invented it. It's a plugin that reads your code/the code of libraries and provides information about said code at runtime. It's working beautifully, but as I said, I have to do a bit of a hack for dealing with annotations.
g

gildor

01/29/2019, 2:35 AM
Why do you need instance of annotation?
g

gildor

01/29/2019, 4:50 AM
I see, I would rather discuss it with #serialization guys, maybe there is some workaround for such use cases
2 Views