The value for an annotation attribute must be a constant expression

1,601 views
Skip to first unread message

Sebastien Diot

unread,
Mar 15, 2014, 6:08:16 PM3/15/14
to xtend...@googlegroups.com
I am working on an active annotation processor which is somewhat similar to @Data.

I have this strange case, where I get the error message in the title.

If I just create an interface like this (CollectionProperty is an annotation type, and CollectionPropertyType is an enum type):

interface EnumAnnotationTest {
    @CollectionProperty(type=CollectionPropertyType::list, fixedSize=10)
    String[] TEST = newArrayOfSize(0)
}

then everything is fine. But if I define this in an interface, that is processed by my annotation processor:

  @CollectionProperty(type=CollectionPropertyType::list, fixedSize=10)
  String[] arrayProp

then I get the message in the title. The strange part is, that while Eclipse and Maven say there is an error there, but not in the first case, after the active annotation processor ran, the generated Java code is as it should be, and no error in the Java code is reported.

Sven Efftinge

unread,
Mar 16, 2014, 7:59:24 AM3/16/14
to xtend...@googlegroups.com
Also here. Please file a bugzilla and we will fix it.

Sven

--
You received this message because you are subscribed to the Google Groups "Xtend Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xtend-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc
Reply all
Reply to author
Forward
0 new messages