I ran into an issue where a kotlin annotation was defined like this:
@Retention(AnnotationRetention.RUNTIME)
@ConfiguringAnnotation(RegisterKotlinMappersImpl::class)
@Target(AnnotationTarget.TYPE, AnnotationTarget.FUNCTION)
annotation class RegisterKotlinMappers(vararg val value: RegisterKotlinMapper)
and users complained that those could not be used on interfaces. The proposed solution is to change AnnotationTarget.TYPE
to AnnotationTarget.CLASS
. I would like to understand why this is the right fix.
what is the difference between the two annotation targets? I tried to find any documentation on the kotlin-lang web site and on stack overflow but so far I only found crickets.
We are using Kotlin 1.6.10, same problem exists on Kotlin 1.5.31. Target is Java 8 bytecode
Thank you for any pointers.