Am 20.11.2016 08:31 schrieb "Le Duc Hieu" <[email protected]>:
>
> Here is the complete snippet that i wanted to create
>
>
> Type
> generic PGList<T> = ^specialize TGList<T>;
>
> generic TGList<T> = record
> data: T;
> next: specialize PGList<T>
> end;
You'll need to use nested types (they require modeswitch advancedrecords),
like this:
=== code begin ===
type
generic TGList<T> = record
public type
TSelf = specialize TGList<T>;
PGList = ^TSelf;
public
data: T;
next: PGList;
end;
=== code end ===
Note: the TSelf construct is currently needed due to a bug in the compiler.
Regards,
Sven
_______________________________________________
fpc-pascal maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal