[fpc-pascal] Is there a way to create a generic pointer to a generic record

Sven Barth pascaldragon at googlemail.com
Tue Dec 6 22:57:21 CET 2016

On 21.11.2016 02:05, Le Duc Hieu wrote:
> Is there any entry on Mantis for me to keep track of this bug status?

I've fixed that bug now (it did already work in mode Delphi by the way),
so now you can use this:

=== code begin ===

  generic TGList<T> = record
  public type
    PGList = ^specialize TGList<T>;
    data: T;
    next: PGList<T>;

{ or even }

  generic TGList<T> = record
    data: T;
    next: ^specialize TGList<T>;

=== code end ===

Please note that the specialization must always be *inside* the record
and the top one needs modeswitch advancedrecords due to the type section.


More information about the fpc-pascal mailing list