Status of annotation attributes?

Can somebody clarify the situation with annotation attributes? I'm a bit confused because this bug (KT-1522) appears to be closed but all that seems supported is

[Foo] [Foo("valueConstructor")]

but not arbitrary attributes, such as:

@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @Target(java.lang.annotation.ElementType.METHOD) public @interface Parameter {   String description() default ""; }

I also looked in the entire code base and couldn’t find anything besides [Inject] and [Intrinsic(“”)].

I think KT-1522 should be reopened and bumped up, most modern Java frameworks need attributes to function properly, not having them is hindering what we can do with Kotlin today.


Support for it seems to be there, as I was doing this the other day in a bit of JSF test code:

ManagedBean(name = “login”)
class LoginController {

  ManagedProperty(value = “#{userProfile}”)
  public var userProfile : UserProfileController? = null;

Indeed, it works. Thanks Marc!

What’s the bracket syntax for, then?  ([Test])

The bracket syntax still seems to work, and might just be a throw back for familiarity ( altho thats the .NET syntax rather than Java ).

One reason I could see to keep it is that it visually breaks up the code to identify it as something “different”.  The syntax without works nicer with lower case annotations, such as maybe:

test fun foo() {


Test fun foo() {

I think I prefer if the annotations stand out somehow instead of having them just look like a regular class, doesn't matter how ([Test], @Test, or whatever).

What’s the current thinking of the language team? Are annotations going to stay as they are, with no marker?

Also, any plan of being able to specify annotations in Kotlin at some point?


Currently annotations have an optional marker: the square brackets. We believe that there are many cases where such a marker just clutters the code, e.g. modifier annotations that have no parameters, so we provide a shorthand syntax, too.