-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No error mark on Groovy code that does not compile #708
Comments
Imports are checked in If the class is resolving due to the subclass superclass relationship, no error will be indicated. There is a chance that this is a core Groovy issue. |
Could be a Groovy issue even if the compiler fails? Maybe a problem with the static type checker? |
I'm missing the compiler error when these classes reside in the same package. However, when |
Hmmm... I'm not sure I'm following. With Greclipse 3.1.0.xx-201809160114-e48, Groovy 2.4 Compiler plugin 3.1.0.xx-201809160114-e48 and Groovy 2.4.15 on the Eclipse project classpath, I don't get any error in the editor for Instead, if I build the project with Gradle, I get:
As you can see, the compilation errors involve both |
That's the piece I'm missing. When you compile with Gradle (aka not eclipse) you get an error. |
protected boolean resolveFromCompileUnit(ClassNode type) {
boolean foundit = super.resolveFromCompileUnit(type);
recordDependency(type.getName());
if (DEBUG) {
log("resolveFromCompileUnit", type, foundit);
}
if (foundit) {
return true;
}
if (activeScope != null) {
// Ask JDT for a source file, visible from this scope
ClassNode node = activeScope.lookupClassNodeForSource(type.getName(), this); |
Ready to test |
Hi Eric, the error is given in 3.1.0.xx-201809190054-e48, thank you! But the strange thing (I have already observed in other circumstances) is that:
This is annoying, because it's hard to see when there's an error in which class it's located (you have to open the Markers view to find it out). Here, I would expect to see the red error mark on both |
Indeed, this must be the difference. See #726. |
Consider these Java classes:
and this Groovy class:
Although the equivalent Java code would be valid, the Groovy compiler rejects this code with
unable to resolve class test35.Extension.Nested
(sinceNested
is declared inBase
, notExtension
). However Greclipse does not complain at all, while I would expect an error mark on the import statement, to be consistent with the Groovy compiler.The text was updated successfully, but these errors were encountered: