[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 ===

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

{ or even }

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

=== 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.

Regards,
Sven



More information about the fpc-pascal mailing list