Eric Milles created GROOVY-10637:
------------------------------------
Summary: SC: implicit-this reference to outer class super property
produces access error
Key: GROOVY-10637
URL: https://issues.apache.org/jira/browse/GROOVY-10637
Project: Groovy
Issue Type: Bug
Components: Static compilation
Affects Versions: 4.0.2
Reporter: Eric Milles
Assignee: Eric Milles
Consider the following:
{code:java}
public class JavaBean<T> {
private T value;
public T getValue() {
return value;
}
public void setValue(T value) {
this.value = value;
}
}
{code}
{code:groovy}
class Outer extends groovy.transform.stc.JavaBean<Inner> {
static class Inner {
String string
}
def bar() {
{ -> value.string }.call() // "value" is parameterized
property
}
}
def foo = new Outer(value: new Outer.Inner(string:'hello world'))
assert foo.bar() == 'hello world'
{code}
"Access to T#string is forbidden"
--
This message was sent by Atlassian Jira
(v8.20.7#820007)