You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/05/26 20:35:00 UTC

[jira] [Resolved] (GROOVY-10637) SC: implicit-this reference to outer class super property produces access error

     [ https://issues.apache.org/jira/browse/GROOVY-10637?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles resolved GROOVY-10637.
----------------------------------
    Fix Version/s: 5.0.0-alpha-1
       Resolution: Fixed

https://github.com/apache/groovy/commit/9eb74c2ee938204030bae1bb8ab7eaae77687ab0

> 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
>            Priority: Major
>             Fix For: 5.0.0-alpha-1
>
>
> 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}
> @groovy.transform.CompileStatic
> 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)