You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniil Ovchinnikov (JIRA)" <ji...@apache.org> on 2017/01/13 15:47:26 UTC
[jira] [Created] (GROOVY-8050) Reference outer class property via
inner class
Daniil Ovchinnikov created GROOVY-8050:
------------------------------------------
Summary: 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
{code}
@CompileStatic
class Outer {
def foo = 1
Inner createInner() { new Inner() }
class Inner {}
}
@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
// works without @CompileStatic
}
}
{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
(v6.3.4#6332)