[fpc-pascal] parent class as a parameter type

ik idokan at gmail.com
Sat Nov 12 22:18:48 CET 2011


Hello List,

Since 2.6.0, when you write something like this:

procedure foo(AClass : TStrings);
foo(MyStringList); // Will return an error that TStrings is expected ...

I can not use TStringList as the parameter without casting it to TStrings.
But I do not understand why this limitation added. Can you please explain
it to me ?

What can be done in order to make it supported again ? should it be
declared as an abstract class or something ?

Thanks,
Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20111112/32b9d24e/attachment.html>


More information about the fpc-pascal mailing list