[fpc-pascal] fcl-passrc errors
Ryan Joseph
genericptr at gmail.com
Wed Oct 16 00:33:10 CEST 2019
> On Oct 15, 2019, at 6:13 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
>
> Of course there is: make the list the correct type. No typecasting needed then.
I guess I’ll get used to it but we have lots of code like this (snippet I posted earlier from the parser):
Declarations: TFPList; // list of TPasElement
// Declarations contains all the following:
Attributes, // TPasAttributes
Classes, // TPasClassType, TPasRecordType
Consts, // TPasConst
ExportSymbols,// TPasExportSymbol
Functions, // TPasProcedure
Properties, // TPasProperty
ResStrings, // TPasResString
Types, // TPasType, except TPasClassType, TPasRecordType
Variables // TPasVariable, not descendants
: TFPList;
where we have generic lists that we cast later to get the correct type. All these now are going to require new specializations for each class and changing the declarations. In fact this means using TFPList is not really a good idea at all anymore unless you don’t plan to use for..in loops.
Regards,
Ryan Joseph
More information about the fpc-pascal
mailing list