[fpc-pascal] Feature announcement: Generic functions, procedures and methods
DougC
doug at moosemail.net
Tue Nov 24 14:43:00 CET 2015
But first fix the code so the test is correct. (The Min function is exactly the same as the Max function. Min should have A < B, not A > B.)
---- On Tue, 24 Nov 2015 08:31:08 -0500 Sven Barth <pascaldragon at googlemail.com>wrote ----
Am 24.11.2015 14:26 schrieb "Anthony Walter" <sysrpl at gmail.com>:
>
> Sven, it would seem you cannot currently cannot pass a generic T to resolve the type of another generic subroutine.
>
> In this example, Test<T> cannot reuse T in its call to Min<T>. I believe this line should be legal "Value := Min<T>(A, B);" (see the code below for context)
>
> Currently when you try to compile the unit GenericTest you'll receive a compiler error on line marked below. Would you like me to enter this into issue into mantis?
Yes, please. That's definitely something that should work :)
Regards,
Sven
_______________________________________________
fpc-pascal maillist - fpc-pascal at lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20151124/890dd871/attachment.html>
More information about the fpc-pascal
mailing list