[fpc-devel] Error: Global Generic template references static symtable

Sven Barth pascaldragon at googlemail.com
Sat Jan 9 12:00:30 CET 2021


Bart via fpc-devel <fpc-devel at lists.freepascal.org> schrieb am Sa., 9. Jan.
2021, 05:17:

> On Fri, Jan 8, 2021 at 9:00 PM Sven Barth via fpc-devel
> <fpc-devel at lists.freepascal.org> wrote:
>
> >> It seems I cannot use a stand-alone function that is declared in the
> >> implementation of the unit?
>
> > Generics are a stream of tokens that is reparsed when specialized.
> Functions declared in the implementation section are simply not available
> then thus its forbidden right away. This is Delphi compatible.
>
> Thanks for explaining this.
> The errormessage is probably technically correct, but for me it might
> be a little more informative (so that I can tell what I did wrong).
>

Right click the error message in Lazarus, then click "Help". For me a
dialog with the following text appeared:

"A generic declared in the interface section of a unit must not reference
symbols that belong solely to the implementation section of that unit."

The *why* is not important for users. Those that are interested can ask,
just like you did.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20210109/0c805e1a/attachment.htm>


More information about the fpc-devel mailing list