[ https://issues.apache.org/jira/browse/GROOVY-11390?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-11390. ---------------------------------- Fix Version/s: 3.0.22 Resolution: Fixed https://github.com/apache/groovy/commit/6d2b8660e6969b2445273fd30febae5f41ae9000 > 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, 4.0.21 > Reporter: Eric Milles > Assignee: Eric Milles > Priority: Major > Fix For: 3.0.22 > > > 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. In GROOVY-11367, these are noted > in #5: "this.any // getter (public, protected, package-private if > same-package) *or entry (private, package-private if other-package)*" > GROOVY-6277, GROOVY-11367 -- This message was sent by Atlassian Jira (v8.20.10#820010)