Virtual extension methods -- a strawman design
Neal Gafter
neal at gafter.com
Mon May 24 06:44:13 PDT 2010
On Mon, May 24, 2010 at 1:06 AM, Howard Lovatt <howard.lovatt at gmail.com> wrote:
> Just to clarify my reading of the spec:
>
> If we initially have:
>
> interface IA {}
> interface IB {}
> class A implements IA {}
> class B implements IB {}
> class AB implements IA, IB {}
>
> Then modify:
>
> interface IA { extension int m() default IAs.m; }
> interface IB { extension int m() default IBs.m; }
>
> And we don't recompile the classes A, B, and AB then A and B will work
> just fine and as expected, however AB will throw an exception if m is
> called.
>
> I think that this combination of:
>
> 1. Adding the same extension method signature to multiple interfaces
> 2. Not recompiling classes that implement more than one of these interfaces
> 3. Calling the extension method on the non re-compiled classes
I would expect a compile-time ambiguity when compiling the invocation
in this case.
More information about the lambda-dev
mailing list