[
https://issues.apache.org/jira/browse/GROOVY-11762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-11762:
---------------------------------
Description:
One case missed by GROOVY-8283 is that of callable property. Consider the
following:
{code:groovy}
import java.util.concurrent.Callable
class A {
Callable getThing() {
return { println "call A" }
}
}
class B extends A {
protected Callable thing = { println "call B" }
}
class C extends B {
void test() {
thing()
}
}
new C().test()
{code}
This prints "call A". However, the rules established in 8283 suggest it should
print "call B".
was:
One case missed by GROOVY-8283 is that of callable property. Consider the
following:
{code:groovy}
class A {
Callable getThing() {
return { println "call A" }
}
}
class B extends A {
protected Callable thing = { println "call B" }
}
class C extends B {
void test() {
thing()
}
}
new C().test()
{code}
This prints "call A". However, the rules established in 8283 suggest it should
print "call B".
> callable property field shadowing
> ---------------------------------
>
> Key: GROOVY-11762
> URL: https://issues.apache.org/jira/browse/GROOVY-11762
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 5.0.1
> Reporter: Eric Milles
> Priority: Major
>
> One case missed by GROOVY-8283 is that of callable property. Consider the
> following:
> {code:groovy}
> import java.util.concurrent.Callable
> class A {
> Callable getThing() {
> return { println "call A" }
> }
> }
> class B extends A {
> protected Callable thing = { println "call B" }
> }
> class C extends B {
> void test() {
> thing()
> }
> }
> new C().test()
> {code}
> This prints "call A". However, the rules established in 8283 suggest it
> should print "call B".
--
This message was sent by Atlassian Jira
(v8.20.10#820010)