You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (JIRA)" <ji...@apache.org> on 2019/04/26 15:17:00 UTC

[jira] [Issue Comment Deleted] (GROOVY-8940) Cannot create package-private annotation type

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

Eric Milles updated GROOVY-8940:
--------------------------------
    Comment: was deleted

(was: Retention has target type {{ANNOTATION_TYPE}}.  Should {{@PackageScope}} have this as well, instead of the patch applied for GROOVY-7151, which alters the meaning of {{ElementType.TYPE}}?
{code:java}
@Target(ElementType.ANNOTATION_TYPE)
public @interface Retention {
{code}
)

> Cannot create package-private annotation type
> ---------------------------------------------
>
>                 Key: GROOVY-8940
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8940
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.16
>            Reporter: Eric Milles
>            Priority: Minor
>
> Java allows this:
> {code:java}
> package foobar;
> @interface Java {
> }
> {code}
> Groovy 2.4 fails for the equivalent:
> {code:groovy}
> package foobar
> import groovy.transform.PackageScope
> @PackageScope @interface Groovy {
> }
> {code}
> {code}
> Annotation @groovy.transform.PackageScope is not allowed on element ANNOTATION
>  @ line 3, column 1.
>    @PackageScope @interface Groovy {
>    ^
> {code}
> NOTE: This works in Groovy 2.5, but it is not clear from the changelogs which change is responsible.  Could the change that fixed be identified so I can try my hand at a minimal patch for 2.4?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)