[ 
https://issues.apache.org/jira/browse/GROOVY-10985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17705375#comment-17705375
 ] 

Eric Milles commented on GROOVY-10985:
--------------------------------------

This is one of the test cases fixed near the release of Groovy 2.5: 
https://github.com/apache/groovy/pull/724

> Precedence of self property over outer class field
> --------------------------------------------------
>
>                 Key: GROOVY-10985
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10985
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Priority: Major
>
> Consider the following:
> {code:groovy}
> class Outer {
>   private static int VALUE = 1
>   static class Inner {
>     def getProperty(String name) {
>       if (name == "VALUE") return 2
>     }
>     void test() {
>       print VALUE
>     }
>   }
> }
> new Outer.Inner().test()
> {code}
> Expecting "2" but prints "1".  If {{Inner}} provides a "generic" property via 
> getProperty, get or via a Map interface it is not used.



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

Reply via email to