Using Greclipse 4.4.0.v202112282355-e2009.
Consider the following enum:
package test69b;
public enum MyEnum {
FOO, BAR;
}
And the following classes:
package test69
import test69b.MyEnum
class Base {
MyEnum myEnum
}
package test69
import groovy.transform.CompileStatic
@CompileStatic
class Ext extends Base {
void foo() {
if(myEnum == MyEnum.FOO)
println 'bla'
}
}
Please note that MyEnum is in a different package.
Observed behaviour in Ext:
- Greclipse does not automatically insert an import for
test69b.MyEnum
- Greclipse does nothing with Ctrl+Shift+O (organize imports) or Ctrl+Shift+M (add import) on
MyEnum in MyEnum.FOO
- no compilation error is produced by Greclipse
- if you hit F3 on
MyEnum in MyEnum.FOO, you'll be directed to Base.myEnum rather than to MyEnum type
- syntax highlighting reflects the fact that
MyEnum is not recognized as a type
If you however try to compile this with groovyc (I tried it through Gradle), compilation correctly fails because MyEnum is not recognized ("[Static type checking] - The variable [MyEnum] is undeclared.").
Using Greclipse 4.4.0.v202112282355-e2009.
Consider the following enum:
And the following classes:
Please note that
MyEnumis in a different package.Observed behaviour in
Ext:test69b.MyEnumMyEnuminMyEnum.FOOMyEnuminMyEnum.FOO, you'll be directed toBase.myEnumrather than toMyEnumtypeMyEnumis not recognized as a typeIf you however try to compile this with groovyc (I tried it through Gradle), compilation correctly fails because
MyEnumis not recognized ("[Static type checking] - The variable [MyEnum] is undeclared.").