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

Eric Milles resolved GROOVY-11412.
----------------------------------
    Fix Version/s: 5.0.0-alpha-11
       Resolution: Fixed

> SC: outer class field and self dynamic property
> -----------------------------------------------
>
>                 Key: GROOVY-11412
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11412
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 5.0.0-alpha-8
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 5.0.0-alpha-11
>
>
> The test case described in GROOVY-10985 fails to execute as expected under 
> static compilation if a single reference to the private outer class field is 
> introduced.
> {code:groovy}
> @groovy.transform.CompileStatic
> class Outer {
>   private static int VALUE = 1
>   class Inner { // NOTE: adding static stops use of bridge method
>     def getProperty(String name) {
>       if (name == "VALUE") return 2
>     }
>     void test() {
>       if (Outer.VALUE > 0) print 'positive' // creates private access bridge
>       print VALUE // classgen now targets private access bridge
>     }
>   }
>   void test() {
>     new Inner().test()
>   }
> }
> new Outer().test()
> {code}



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

Reply via email to