1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
{
./testcodetools --format=plain --suite=TestFindDeclaration_Generics
}
unit fdt_generics;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
type
generic TGenBaseAction<GenParam1> = class
BaseName: GenParam1{declaration:fdt_generics.TGenBaseAction.GenParam1};
end;
generic TGenCustomAction<GenParam2> = class(specialize TGenBaseAction{declaration:fdt_generics.TGenBaseAction}<GenParam2>)
CustomName: GenParam2;
end;
{ TGenAction }
generic TGenAction<GenParam3> = class(specialize TGenCustomAction{declaration:fdt_generics.TGenCustomAction}<GenParam3>)
ActionName: GenParam3;
procedure InitActionName;
end;
TIntegerAction = specialize TGenAction<integer>;
implementation
procedure DoSomething;
var
Action: TIntegerAction;
begin
Action.ActionName{declaration:fdt_generics.TGenAction.ActionName}:=3;
end;
{ TGenAction }
procedure TGenAction.InitActionName;
begin
ActionName{declaration:fdt_generics.TGenAction.ActionName}:=3;
end;
end.
|