Stanislav Maksimov
04/07/2024, 2:09 PM@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:
methodDeclaration.annotations.first().annotationType.resolve().declaration.annotations.toList()
Stanislav Maksimov
04/12/2024, 8:40 AM