Feedforward
Feedforward

Reputation: 4869

Kotlin annotation only for annotation parameters

I'd like to have a Kotlin annotation that can only be used as a parameter on another annotation. Which target should I use for it?

// @Target   <- ?
annotation class MyConfigurationEntry(
    val option,
    val value
)

@Target(AnnotationTarget.FUNCTION)
annotation class MyConfiguration(vararg val entries: MyConfigurationEntry)

Upvotes: 0

Views: 298

Answers (1)

apksherlock
apksherlock

Reputation: 8371

I believe it is @Target(AnnotationTarget.ANNOTATION_CLASS) if you click on that constant you will read:

Annotation class only

Kotlin version 1.3.41

Upvotes: 1

Related Questions