On 14.10.2014 15:34, Jonas Maebe wrote:

On 14 Oct 2014, at 14:21, Sven Barth wrote:

At least at first sight there don't seem to be any real (technical)
reasons
to not covariance for return values.

Delphi and/or FPC already support it to a certain extent, and the
compiler contains some code for it (see compatible_childmethod_resultdef
in defcmp.pas and its use in nobj.pas). I don't know the exact scenario
under which it currently works in though.

I just tested my example code (filled in the holes I left of course) and it works. So... we already have covariance support for result types! ;)

Regards,
Sven

_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to