[
https://issues.apache.org/jira/browse/GROOVY-11412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17864818#comment-17864818
]
Eric Milles commented on GROOVY-11412:
--------------------------------------
https://github.com/apache/groovy/commit/37021a0089c2fb4af53912b14cebb97356106e51
> 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
>
> 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)