Eric Milles created GROOVY-11390:
------------------------------------

             Summary: access error for inaccessible getter of super class
                 Key: GROOVY-11390
                 URL: https://issues.apache.org/jira/browse/GROOVY-11390
             Project: Groovy
          Issue Type: Bug
          Components: Static compilation
    Affects Versions: 3.0.21
            Reporter: Eric Milles
            Assignee: Eric Milles


Consider the following:
{code:java}
package p;
abstract class A {
  private Object getX() { return "X"; }
  /*package*/ Object getY() { return "Y"; }
}
{code}

{code:groovy}
@groovy.transform.CompileStatic
class C extends p.A implements Map<String,String> {
  @Delegate Map<String,String> map = [:]
  void test() {
    print this.x // Cannot access method: getX() of class: p.A
    print this.y // IllegalAccessError: class C tried to access method 
p.A.getY()
  }
}
{code}

STC is happy with both property expressions since they can be satisfied via the 
Map interface.  Classgen emits error for the private getter and writes out a 
call to the package-private getter,



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to