[fpc-devel] Generic List in Advanded record does not compile with -MobjFPC, works with -MDelphi (perhaps related to Generics.Collections that I am using)
Sven Barth
pascaldragon at googlemail.com
Mon Apr 27 20:28:17 CEST 2015
On 27.04.2015 20:19, Michael Ring wrote:
> I am not sure if this is a problem of the Generics.Collections unit I am
> using (https://github.com/dathox/generics.collections) as this unit is
> always compiled with -Mdelphi or if this is an issue with fpc's parser.
>
> The following snippet compiles fine in delphi mode, but does not compile
> in ObjectFPC Mode:
>
> type
> TSpecialFunctionBits = record
> name: String;
> Position: longWord;
> Mask: longWord;
> notMask: longWord;
> Length: longWord;
> constructor create(theName: String; thePosition, theMask,
> theLength: longWord);
> end;
>
> Error is:
>
> Fatal: Syntax error, ";" expected but "<" found
>
> I saw this error with trunk fpc.
Are you sure that's the correct location? I don't see a "<" anywhere
there. Can it be that you are missing a "specialize" where you're
specializing the generic? Also note that ObjFPC does not support inline
specializations (yet), specializations must be done in "type" sections.
Regards,
Sven
More information about the fpc-devel
mailing list