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 2021/04/08 14:35:00 UTC

[jira] [Updated] (GROOVY-8063) Type annotation value referencing inner class is not properly scoped

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

Eric Milles updated GROOVY-8063:
--------------------------------
    Labels: breaking  (was: )

> Type annotation value referencing inner class is not properly scoped
> --------------------------------------------------------------------
>
>                 Key: GROOVY-8063
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8063
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.8
>            Reporter: Eric Milles
>            Priority: Major
>              Labels: breaking
>
> This code does not generate a compilation error -- it does in Java.  Inner should be unresolvable without a qualifier or import when referenced in the type annotation.
> {code}
> @Anno(value=Inner)
> class Outer {
>   static class Inner {}
> }
> @interface Anno { Class value() }
> {code}
> For comparison, this code behaves the same in Groovy and Java.  VALUE is not resolvable without a qualifier or static import.
> {code}
> @Anno(value=VALUE)
> class Outer {
> public static final Stirng VALUE = ''
> }
> @interface Anno { String value() }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)