[
https://issues.apache.org/jira/browse/GROOVY-11390?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-11390:
---------------------------------
Description:
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.
GROOVY-6277, GROOVY-11367
was:
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,
> 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
> Priority: Major
>
> 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.
> GROOVY-6277, GROOVY-11367
--
This message was sent by Atlassian Jira
(v8.20.10#820010)