Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.3, 2.3.8
-
None
-
None
-
Tested on JDK 1.7.0_51 32 bit Windows
Description
Base.groovy
class Base { public static enum Color { Red, Green } public Color getColor() { Color.Red } }
Child.groovy
class Child extends Base { @Override public Color getColor() { Color.Green } }
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.