Cannot implement abstract method with extension method
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Wed Aug 25 06:10:38 PDT 2010
On 25/08/10 13:01, Thomas Jung wrote:
> Hi,
>
> given the extension method m in interface A and abstract method m in
> the abstract class B. The definition of the extension method A.m is
> not used to "implement" B.m in C.
>
> interface A{
> extension boolean m(Object object) default As.m;
> }
>
> abstract class B {
> public abstract boolean m(Object object);
> }
>
> class C extends B implements A{}
>
Uhmm, it's not crystal clear as to whether this should work as you
expect - Brian any ideas?
> C is not abstract and does not override abstract method m(Object) in B
> class C extends B implements A{}
>
> Interfaces have the same problem:
>
> interface A{
> extension boolean m(Object object) default As.m;
> }
> interface B {
> boolean m(Object object);
> }
>
> class C implements A, B{}
>
> C is not abstract and does not override abstract method m(Object) in B
> class C implements A, B{}
>
I see. This looks more like a bug, but what about the following:
interface A{
extension boolean m(Object object) default As.m;
}
interface B {
extension boolean m(Object object) default Bs.m;
}
class C implements A, B{}
Maurizio
> Thomas
>
>
More information about the lambda-dev
mailing list