title: Kotlin custom annotation, arguments
body: <p>I'm trying to create a custom annotation with an array of arguments but I get an error when trying to set the arguments in the constructor of the annotation. It says it is expecting a type annotation on the Role[], while, if i'm right the Role[] is the type. I looked up the syntax in the docs which can be found here:
  <a href="https://kotlinlang.org/docs/reference/annotations.html" rel="noreferrer">https://kotlinlang.org/docs/reference/annotations.html</a>. But this documentation only explains how I can use the annotation and not how to create one.</p>
  
  <p>This is what my annotation code looks like:</p>
  
  <pre><code>@NameBinding
  @Target(AnnotationTarget.FUNCTION, AnnotationTarget.CLASS)
  @Retention(AnnotationRetention.RUNTIME)
  annotation class Secured(vararg val value: Role[])
  </code></pre>
  
  <p>This is what my Role class looks like:</p>
  
  <pre><code>enum class Role {
     ADMIN, USER
  }
  </code></pre>
  
  <p>and this is how I want to use it:</p>
  
  <pre><code>@Secured(Role.ADMIN, Role.USER)
  </code></pre>
  
  <p>I tried looking for any examples on how to create annotations in Kotlin but I can't seem to find any weirdly. Anyone who can help me out?</p>