Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6-rc-1
-
None
-
None
Description
The following script throws StackOverfloeError on the last line:
class SampleA {
public void foo()
protected Object receive()
{ return "Message" }protected Object receive(Object param)
{ receive() + param }}
class SampleB {}
SampleB.metaClass {
mixin SampleA
foo = {->
println 'New foo ' + receive('')
}
}
final SampleA a = new SampleA()
a.foo()
final SampleB b = new SampleB()
b.foo()
Basically I'm trying to mix-in the SampleA functionality into SampleB and override the SampleA.foo() behavior at the same time. It works until I try to call the receive(String) method, which calls the receive(void) method in turn.