eric-milles opened a new pull request, #2316:
URL: https://github.com/apache/groovy/pull/2316
Prevent ambiguous or unexpected dynamic dispatch by setting method target
for trait forwarder methods.
```groovy
trait A {
def foo(Map<String, Object> m) {
println("foo(m)")
}
def foo(Object o) {
println("foo(o)")
}
}
class B implements A {
def bar(Map<String, Object> m) {
println("bar(m)")
}
def bar(Object o) {
println("bar(o)")
}
/*
@TraitBridge(traitClass=Foo, desc="...")
Object foo(Object o) {
Foo$Trait$Helper.foo(this, o) // HERE
}
@TraitBridge(traitClass=Foo, desc="...")
Object foo(Map<String, Object> m) {
Foo$Trait$Helper.foo(this, m) // HERE
}
*/
}
new B().with {
foo((Object) null)
foo(null as Object)
bar((Object) null)
bar(null as Object)
}
(new Object() as A).with {
foo((Object) null)
foo(null as Object)
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]