Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6-rc-2
-
None
Description
take the following example:
// parent interface interface Foo{ def foo(); } // parent implementation - it's irrelevant class FooImpl implements Foo{ def foo(){ println 'this is a foo impl' } } // child interface interface Bar extends Foo{ def bar(); } // child implementation class BarImpl implements Bar{ @Delegate Foo foo; BarImpl(Foo f){ this.foo = f} def bar(){ println 'this is a bar impl'} //BarImpl doesn't implement foo() and it throws an exception } new BarImpl(new FooImpl()).bar()
reported the following error
Can't have an abstract method in a non-abstract class. The class 'BarImpl' must be declared abstract or the method 'java.lang.Object foo()' must be implemented.
refer to the following discussion
http://www.nabble.com/using-%40Delegate-to-implement-an-interface-td21308619.html#a21308619