Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fpc-src / usr / share / fpcsrc / 3.2.0 / tests / webtbs / tw30626.pp
Size: Mime:
{ %NORUN }

program tw30626;

{$mode objfpc}

type
  generic IBase<T> = interface(IUnknown)
  end;

  generic TBase<T> = class(TInterfacedObject, specialize IBase<T>)
  public
    function Test: specialize IBase<T>;
  end;

  generic TDerived<T> = class(specialize TBase<T>)

  end;

function TBase.Test: specialize IBase<T>;
begin
  result := (specialize TDerived<T>).Create;
end;

type
  TIntDerived = specialize TDerived<Integer>;

var
  t: TIntDerived;

begin
  t := TIntDerived.Create;
  t.Test;
end.