[otj-users] Binding inheritance and covariance

Carsten Pfeiffer carsten.pfeiffer at alumni.tu-berlin.de
Mon Oct 1 17:52:46 CEST 2007


Hi,

a nice solution to an interesting problem. Will the compiler make sure that 
the callin-method will /really/ return the result of the base-call and not 
something else that would be fine according to "normal" generics rules? E.g.
from looking at

[callin] <E extends List> E getList() {

}

it would appear perfectly fine to return any subclass/implementation of List.


BTW, is it allowed to bind to a parameterized type or method? E.g. to a base 
method:

public <T extends Something> T getSomething() {...}
or
public T getSomething() {..} 
if the enclosing class is parameterized with T.

Then this syntax might become a little confusing.

Cheers,
Carsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 447 bytes
Desc: This is a digitally signed message part.
Url : http://collegium-musicum.tu-berlin.de/pipermail/otj-users/attachments/20071001/bae8f205/attachment.pgp


More information about the otj-users mailing list