groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Sun (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-7202) Unable to resolve nested enum of parent class when compiling against binary parent
Date Thu, 05 Apr 2018 18:36:00 GMT

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

Daniel Sun updated GROOVY-7202:
-------------------------------

should be same with GROOVY-8531 and fixed now

> Unable to resolve nested enum of parent class when compiling against binary parent
> ----------------------------------------------------------------------------------
>
>                 Key: GROOVY-7202
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7202
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.3.3, 2.3.8
>         Environment: Tested on JDK 1.7.0_51 32 bit Windows
>            Reporter: Jason Winnebeck
>            Priority: Major
>         Attachments: Base.groovy, Child.groovy
>
>
> {code:title=Base.groovy}
> class Base {
>   public static enum Color { Red, Green }
>   
>   public Color getColor() { Color.Red }
> }
> {code}
> {code:title=Child.groovy}
> class Child extends Base {
>   @Override
>   public Color getColor() { Color.Green }
> }
> {code}
> Steps to reproduce:
> # groovyc Base.groovy
> # rm Base.groovy
> # groovyc Child.groovy
> Note that `groovyc *.groovy` works, as well as putting the code into the groovyconsole.
It seems that this bug is triggered only when Base.groovy source is not in sourcepath.
> Workaround is to put `import Base.Color` in Child.groovy. However, IDEs like IntelliJ
IDEA show this as an unnecessary import and remove the import when optimizing imports (which
can happen on every save depending on IDE settings). Another workaround is to put absolute
qualifier on Color enum, but IDEA also provides warning for this.



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

Mime
View raw message