Updated State of the Lambda
Talden
talden at gmail.com
Mon Dec 12 11:43:45 PST 2011
> On a semantic issue, I'm a bit confused as to what happens in diamond
> inheritance situations? Specifically I'm thinking of a case similar to
> the following:
>
> interface A { void m() }
> interface B1 extends A { void m() default { System.out.println("one"); } ... }
> interface B2 extends A { void m() default { System.out.println("two"); } ... }
> class C extends B1, B2 {}
I believe this is considered a compiler error - C would need to have
an implementation of m.
Of course, with the new spec it can choose one of the existing
defaults. Something like...
class C extends B1, B2 {
public void m() { B1.super.m(); }
}
--
Aaron Scott-Boddendijk
More information about the lambda-dev
mailing list