'This' type (original) (raw)

Adrian Kuhn akuhn at gmx.ch
Tue Mar 3 13:51:11 PST 2009


On Mar 3, 2009, at 21:17 , Marek KozieĊ‚ wrote:

ALTERNATIVES: Rewriting each method's signature on every class / interface.

Using self-bound generics, such as

abstract class A<Self extends A> { abstract Self self(); }

class B extends A { B self(); }

class C extends A { C self(); }

This is used in java.lang.Enum for example.

See also http://www.artima.com/forums/flat.jsp?forum=106&thread=136394

--AA



More information about the coin-dev mailing list