Can extension methods be overriden?

Paulo Levi i30817 at gmail.com
Mon Dec 14 07:02:34 PST 2009


When i thought about this a while ago it seemed obvious that extension
methods would be methods that didn't depend on any non-public methods or any
state (since they are to be used in interfaces).

Many times, while using the public methods of a interface is possible to
implement a feature, using it efficiently requires using internal structures
of the implementation class.
(doing this requires that extension methods can be overriden).

A example is CharSequence and the getChars method (that exists on all (?)
classes that implement it, but not on the interface, but could be
implemented inefficiently by using charAt).

BTW if extension methods are in, that is one of the alterations i would like
to see.


More information about the lambda-dev mailing list