[ 
https://issues.apache.org/jira/browse/GROOVY-7151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King closed GROOVY-7151.
-----------------------------

> groovyc should accept meta annotation with ElementType.TYPE
> -----------------------------------------------------------
>
>                 Key: GROOVY-7151
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7151
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.0-beta-3
>            Reporter: Marcin Zajaczkowski
>            Assignee: Cédric Champeau
>            Priority: Minor
>             Fix For: 2.5.0-alpha-1
>
>
> groovyc fails on a try to annotate Groovy annotation with an annotation with 
> Target set to TargetType.TYPE.
> {code:java}
> @Target({ElementType.TYPE})
> @Retention(RetentionPolicy.RUNTIME)
> @Documented
> public @interface Import {
>     Class<?>[] value();
> }
> @Target(ElementType.TYPE)
> @Retention(RetentionPolicy.RUNTIME)
> @Import(CorrelationIdConfiguration.class)
> public @interface EnableCorrelationId {
> }
> EnableCorrelationId.groovy: 12: Annotation 
> @org.springframework.context.annotation.Import is not allowed on element 
> ANNOTATION
>  @ line 12, column 1.
>    @Import(CorrelationIdConfiguration.class)
>    ^
> {code}
> The same works for Java annotations what follows [Java Language 
> Specification|http://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.6.4.1]:
> {quote}
> Type declarations: class, interface, enum, and annotation type declarations 
> (§8.1.1, §9.1.1, §8.5, §9.5, §8.9, §9.6)
> Corresponds to java.lang.annotation.ElementType.TYPE
> Additionally, annotation type declarations correspond to 
> java.lang.annotation.ElementType.ANNOTATION_TYPE
> {quote}
> This is very common in Spring (Boot) application when @Import annotation 
> (which has ElementType.TYPE) is used.
> I fixed that and will make a PR in a few minutes (with proper JIRA ticket ID).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to