Hi. I'm trying to implement a generic class that would hold a circular reference. As I've found, it should be possible starting from FPC 3.0.
The code:
type
{ TLC_EL_Connector }
generic TLC_EL_Connector<T, TLinked: TEntity> = class;
generic TLC_EL_Connector<T, TLinked: TEntity> = class(TObject)
published
LCFrame: TListControlFrame;
private
type PTEntityList = ^specialize TEntityList<T>;
type LinkedConnector = specialize TLC_EL_Connector<TLinked, T>;
...
private
...
Linked: LinkedConnector;
public
procedure Link(constref OtherConnector: LinkedConnector);
procedure AssignData(EList: PTEntityList);
constructor Create(TheOwner: TWinControl);
destructor Destroy(); override;
end;
implementation
At the implementation line, the complier stops with an Internal Error 200602034. According to FPC source:
function FindUnitSymtable(st:TSymtable):TSymtable;
begin
result:=nil;
repeat
if not assigned(st) then
internalerror(200602034);
The error occurs regardless of
{$mode ObjFPC} or
{$mode delphi}.
FPC 3.2.2, Lazarus 3.4