[fpc-pascal] Unexpected duplicate identifiers

dhkblaszyk at zeelandnet.nl dhkblaszyk at zeelandnet.nl
Mon Dec 22 12:24:30 CET 2008


> I've got a class that looks in part like this:
>
> TTextStore= CLASS(TStringList)
>              PRIVATE
>                PROCEDURE NeverSort(sort: BOOLEAN);
>              PUBLIC
>                FUNCTION HereDocument(CONST name: STRING; VAR strings:
> TStringList): BOOLEAN;
>                PROCEDURE Sort; OVERRIDE;
>
> FPC 2.2.0 is giving me duplicate identifier errors for "sort" and
> "strings" above.
>
> I've got nothing against going through the comparatively small amount of
> code affected but I'm a little mystified as to why this is happening:
> the rather elderly version of Delphi I'm using doesn't object, and I
> don't see why there should be a conflict between the class procedure and
> procedure parameter names.

Add {$mode delphi} to the top of your unit. ObjFPC mode is more strict.

Darius




More information about the fpc-pascal mailing list