[ https://issues.apache.org/jira/browse/GROOVY-11212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-11212. ------------------------------ > Access to private fields of superclass from a block fails in subclass > --------------------------------------------------------------------- > > Key: GROOVY-11212 > URL: https://issues.apache.org/jira/browse/GROOVY-11212 > Project: Groovy > Issue Type: Bug > Components: Compiler > Affects Versions: 4.x > Reporter: OC > Assignee: Eric Milles > Priority: Minor > Fix For: 5.0.0-alpha-1 > > > Test code: > {code:groovy} > class Foo { > private static final String wth='wth' > def foo() { > 1.times { > println wth > } > } > } > class Bar extends Foo { } > new Bar().foo() > {code} > Causes “groovy.lang.MissingPropertyException: No such property: wth for > class: Bar”. Seems to affect all 4* versions (myself I've tested just a > couple of them), did work in 3 and I am told it again works in 5. > There's an easy work-around, an explicit qualifier, in this case "println > Foo.wth", fixes the problem. -- This message was sent by Atlassian Jira (v8.20.10#820010)