Is it a bug that I can resolve an annotation type only when the annotation is declared at top-level? If annotation is nested inside a class it won’t resolve:
Copy code
val annotation: KSAnnotation = //...
annotation.annotationType.resolve() // only resolves when annotation is not nested in a class
j
Jiaxiang
06/09/2022, 11:44 PM
sounds like a bug to me. can you provide a reproduce? We have tests checking annotations on class members.
v
Vladimir Tagakov
06/09/2022, 11:45 PM
I’m facing that in our project env, it is kinda custom and complex. Let me try to repro it in a simple gradle project. I’ll be back with results.
Vladimir Tagakov
06/09/2022, 11:59 PM
It doesn’t repro with a gradle setup and embeddable compiler used for tests 😞 So there is something wrong with ours.
The only difference I can spot is that with gradle for annotation like
returns “Nested” but in our setup it for some reason returns “Outer$Nested”. Maybe it is somehow related to compilation units, but I can’t reproduce it in tests =(