You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Schalk Cronjé <ys...@gmail.com> on 2015/06/01 13:25:19 UTC

Change in method selection behaviour between 2.3.x and 2.4.x

Was this change intentional?

In Groovy 2.4.x, getRole() is called, but in 2.3.x isRole() is called.

    class A {
       boolean isRole() {true}
       String getRole() {'role'}
    }

    def a = new A()
    println a.role


-- 
Schalk W. Cronjé
Twitter / Ello / Toeter : @ysb33r


Re: Change in method selection behaviour between 2.3.x and 2.4.x

Posted by Cédric Champeau <ce...@gmail.com>.
It must be a side effect of multi-properties support. In your example is it
indeed ambiguous.

2015-06-01 13:25 GMT+02:00 Schalk Cronjé <ys...@gmail.com>:

>  Was this change intentional?
>
> In Groovy 2.4.x, getRole() is called, but in 2.3.x isRole() is called.
>
> class A {
>   boolean isRole() {true}
>   String getRole() {'role'}
> }
>
> def a = new A()
> println a.role
>
>
> --
> Schalk W. Cronjé
> Twitter / Ello / Toeter : @ysb33r
>
>