[fpc-pascal] Re: Use generic class as parameter (was: how to write enumerator for trees)

Sven Barth pascaldragon at googlemail.com
Fri Mar 22 09:48:01 CET 2013


Am 22.03.2013 08:13, schrieb Xiangrong Fang:
> 2013/3/22 Sven Barth <pascaldragon at googlemail.com 
> <mailto:pascaldragon at googlemail.com>>
>
>     > The problem is gone, because PNode is not a generic class, but only a
>     record.   However, the following errors are generated:
>
>     2.6.x does not support nested types in generics. Generic fixes and
>     improvements are only found in 2.7.1 as most of them were to
>     invasive to be merged back.
>
> OK, then why this error happened:
>
> demo2.lpr(76,13) Error: Incompatible types: got 
> "TRoller.TTreap$PPerson$Byte" expected "TRoller"

AFAIR there was also a problem with result types in generics. Could you 
please test your code with 2.7.1 to be sure?

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130322/8cf3f565/attachment.html>


More information about the fpc-pascal mailing list