Whither extension methods?

Mark Thornton mthornton at optrak.co.uk
Tue Dec 15 03:16:11 PST 2009


Howard Lovatt wrote:
> Note Traits as proposed in the blog referenced above do not need old code to
> be recompiled to use the new Trait methods; the linker will add missing
> methods. There is a backward compatibility problem if an existing method in
> someone's internal implementation clashes with a new Trait method. EG if
> someone had an implementation of List that added "List<E> sort()" then the
> linker could not add "void sort()", in such a case a linking error
>   
In Java "List<E> sort()" isn't compatible with "void sort()", but at the 
JVM level the signature includes the return type. Would this make it 
possible to resolve such a 'clash' without needing to throw a linking error?

Mark Thornton



More information about the lambda-dev mailing list