Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2026-10

question on generics for 3.2.2

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

P Padil

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.

Thanks
Pete

Marco van de Voort
to P Padil

Op 24-10-2026 om 23:07 schreef P Padil via fpc-pascal:

Show quoted text 6 lines
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.

P Padil
to Marco van de Voort

Thanks!

Show quoted text 16 lines
On Oct 25, 2026, at 3:52 AM, Marco van de Voort via fpc-pascal 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 - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal