[fpc-pascal] question on generics for 3.2.2

P Padil ppadilcdx at gmail.com
Mon Oct 26 03:46:31 CET 2026


Thanks!

> On Oct 25, 2026, at 3:52 AM, Marco van de Voort via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> 
> Op 24-10-2026 om 23:07 schreef P Padil via fpc-pascal:
>> Was trying to code a recursive generic function but kept getting an error:
>> "Error: Global Generic template references static symtable
>> A generic declared in the interface section of a unit must not reference symbols that belong solely to the implementation section of that unit.”
>> 
>> Is there a trick to this and I missed the memo, or just not allowed? Resorted to concrete types to get it to compile.
>> 
> Yes. If your code refers constants declare them in the body of the function, rather than as a separate block in the function.
> 
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal



More information about the fpc-pascal mailing list