[
https://issues.apache.org/jira/browse/GROOVY-8050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-8050:
--------------------------------
Fix Version/s: 3.0.10
> Reference outer class property via inner class
> ----------------------------------------------
>
> Key: GROOVY-8050
> URL: https://issues.apache.org/jira/browse/GROOVY-8050
> Project: Groovy
> Issue Type: Bug
> Components: Compiler, Static compilation, Static Type Checker
> Affects Versions: 2.4.7
> Reporter: Daniil Ovchinnikov
> Assignee: Eric Milles
> Priority: Major
> Fix For: 3.0.10, 4.0.0-rc-2
>
>
> {code}
> @CompileStatic
> class Outer {
> def foo = 1
> Inner createInner() { new Inner() }
> class Inner {}
> }
> @CompileStatic // works without @CompileStatic
> class Main {
> static void main(String[] args) {
> def i = new Outer().createInner()
> println i.foo // [Static type checking] - No such property: foo for
> class: Outer$Inner
> }
> }
> {code}
> I think should work in both static and dynamic contexts or fail in both.
> Please close this issue if this is by design.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)