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

Xiangrong Fang xrfang at gmail.com
Sun Mar 24 03:49:10 CET 2013


I think the problem is not fixed in 2.7.1:

xrfang at laptop ~/fpc $ ./compiler/ppcx64 -n -Furtl/units/x86_64-linux
-Fupackages/fcl-base/units/x86_64-linux -viwn -FE/home/xrfang -Sc demo2.lpr
Target OS: Linux for x86-64
Compiling demo2.lpr
Compiling treap.pas
demo2.lpr(88,11) Error: Incompatible types: got "TTreap$2$crc94C56373"
expected "TRoller"
demo2.lpr(98) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted


2013/3/24 Sven Barth <pascaldragon at googlemail.com>

> On 23.03.2013 14:51, Xiangrong Fang wrote:
>
>> I got this error now:
>>
>> treap.pas(311,48) Error: Illegal expression
>> treap.pas(311,50) Error: Illegal expression
>> treap.pas(311,50) Fatal: Syntax error, ";" expected but "ordinal const"
>> found
>> Fatal: Compilation aborted
>>
>> The line that generated this error is:
>>
>>    if Result = NullNode then begin
>> if (Rank = 0) or (Anchor < Key) then Rank += 1;   <-- error here
>>      Result := nil;
>>    end;
>>
>> It seems that the += operator is not supported anymore??  Is there any
>> switches in the new 2.7.1?
>>
>
> The C style operators need to be enabled using a switch which is AFAIK
> either normally done in the fpc.cfg or by Lazarus. Nevertheless the command
> line switch you need is "-Sc".
>
>
> Regards,
> Sven
>
> ______________________________**_________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.**org<fpc-pascal at lists.freepascal.org>
> http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130324/5ac2f99c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: treap.pas
Type: application/octet-stream
Size: 10271 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130324/5ac2f99c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demo2.lpr
Type: application/octet-stream
Size: 2083 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130324/5ac2f99c/attachment-0001.obj>


More information about the fpc-pascal mailing list