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

Bart bartjunk64 at gmail.com
Fri Jan 8 19:54:36 CET 2021


Hi,

While trying to solve https://bugs.freepascal.org/view.php?id=38306 I
got this error I have never seen before.

_gdeque.pp(249,4) Error: Global Generic template references static symtable
_gdeque.pp(302) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted

Line 249 is the "end;" of a method (IncreaseCapacity) of a generic class.

If I remove this line the error goes away:

Elems := Min(EmptyElems, FStart);
Elems and EmptyElems are local vars to that method.
FStart is a private variable of the class.

function Min(const A,B: SizeUInt): SizeUInt;  //no need to drag in the
entire Math unit ;-)
begin
  if (A<B) then
    Result := A
  else
    Result := B;
end;

This function is not part of the class definition.
I defined it in the implementation section of the unit.

Once I moved that function to be a nested function of the method
IncreaseCapacity (it's only used there), the error goes away.

It seems I cannot use a stand-alone function that is declared in the
implementation of the unit?
Why is that?

Bart

-- 
Bart


More information about the fpc-devel mailing list