{ %NORUN } { This tests that the two specializations of TUsedGeneric (once with TGeneric.TSubType and once with TGeneric.TSubType) inside TGeneric are unique } program tgeneric72; {$mode objfpc} type generic TUsedGeneric = class type PT = ^T; var f: PT; end; generic TGeneric = class type TSubType = record Field: T; end; PSubType = ^TSubType; TMyUsedGeneric = specialize TUsedGeneric; private f: PSubType; public function GetUsedGeneric: TMyUsedGeneric; end; function TGeneric.GetUsedGeneric: TMyUsedGeneric; begin Result := TMyUsedGeneric.Create; Result.f := f; end; type TGenericLongInt = specialize TGeneric; TGenericPointer = specialize TGeneric; begin end.