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.0.0 / tests / webtbs / tw19511.pp
Size: Mime:
{ %NORUN }

{$MODE OBJFPC} { -*- text -*- }
program tw19511;

type
   generic TFoo<X> = class
   end;
   generic TBar<Y> = class
    type
     TIntegerSpecializedFoo = specialize TFoo<Integer>;
     TSelfSpecializedFoo = specialize TFoo<TBar>;
    function SelfTest(): TBar; // returns a TBar<Y>
      TSpecializedBar = specialize TBar<Y>; // this rightly would not compile since TBar here refers to the specialized TBar<Y>
   end;

function TBar.SelfTest(): TBar;
begin
   Result := Self;
end;

begin
end.