Hi! In my project I have annotation setup which lo...
# ksp
s
Hi! In my project I have annotation setup which looks like this:
Copy code
@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.SOURCE)
@TargetAlias(target = SomeTarget::class)
annotation class AliasAnnotation

@Target(AnnotationTarget.ANNOTATION_CLASS)
@Retention(AnnotationRetention.SOURCE)
annotation class TargetAlias(val target: KClass<out Target>)

interface SomeView {
    @AliasAnnotation
    fun doSomething()
}
For some reason, when I'm processing
doSomething
method and trying to get annotations for
@AliasAnnotation
declaration I only get
@Target
and
@Retention
annotations, but not
@TargetAlias
. Is it some known KSP limitation or maybe bug? I'm getting annotations like this:
Copy code
methodDeclaration.annotations.first().annotationType.resolve().declaration.annotations.toList()
Looks like a bug for me, reported as https://github.com/google/ksp/issues/1824