If i place an annotation on an enum value, it doesn't work. It doesn't identify the annotation as a syntax error, but it does mis-highlight it and refuse to import the annotation class (if that is necessary). The same code (when ported) works fine in Java.
Here's how I can reproduce it:
Class annotations = [@enumsgroovy.A(value=C)]
Field annotations = []
such that it has not found the annotation on E.C.
src.zip
If i place an annotation on an enum value, it doesn't work. It doesn't identify the annotation as a syntax error, but it does mis-highlight it and refuse to import the annotation class (if that is necessary). The same code (when ported) works fine in Java.
Here's how I can reproduce it:
@Target([ElementType.FIELD, ElementType.TYPE]) @Retention(RetentionPolicy.RUNTIME) @interface A { String value() }@A("C") enum E { @A("B") C }println 'Class annotations = ' + E.class.getAnnotations()println 'Field annotations = ' + E.class.getField(E.C.name()).getAnnotations()Class annotations = [@enumsgroovy.A(value=C)]
Field annotations = []
such that it has not found the annotation on E.C.
src.zip