groovy/groovy-eclipse

Fix type inferencing and syntax highlighting for inaccessible fields and properties

eric-milles opened this issue · 2 comments

Consider the following:

abstract class A {
  private f
  private getP(){}
}

void test(A a) {
  a.@f     // MissingFieldException
  a.f      // MissingPropertyException
  a.p      // MissingPropertyException
  a.getP() // MissingMethodException
  a.with {
    it.@f  // MissingFieldException
    it.f   // MissingPropertyException
    it.p   // MissingPropertyException
    f      // MissingPropertyException
    p      // MissingPropertyException
    getP() // MissingMethodException
  }
}

Since A is abstract, a will always refer to a subclass instance. Therefore private member access will fail. No indication of this is given in the editor.

image