[fpc-devel] suggestion: virtual method co-variance

Marco van de Voort marcov at stack.nl
Tue Oct 14 15:32:51 CEST 2014


In our previous episode, Sven Barth said:
> At least at first sight there don't seem to be any real (technical) reasons
> to not covariance for return values. Parameters would be a different topic
> though...

Specially since afaik we can't overload on returnvalue and require override,
so there is no ambiguity.
 
> Would this be the correct equivalent in Object Pascal?

Yes, that is about it. Mostly useful for layered frameworks, so that you can
add a bit of typing on every level.



More information about the fpc-devel mailing list