fpc/tests/webtbs/tw11435c.pp
paul 790f6b0a4b compiler: use delphi syntax for type, const and var section declarations in classes instead of fpc generics syntax
rtl: fix fgl to use the new syntax
tests: fix generics tests to use the new syntax

git-svn-id: trunk@15646 -
2010-07-27 00:59:32 +00:00

36 lines
509 B
ObjectPascal

unit tw11435c;
{$MODE ObjFPC}
interface
type
generic TList<_T>=class(TObject)
public
type
TCompareFunc = function(const Item1, Item2: _T): Integer;
public
var
data : _T;
procedure Add(item: _T);
procedure Sort(compare: TCompareFunc);
end;
type
TA = specialize TList<byte>;
implementation
procedure TList.Add(item: _T);
begin
data:=item;
end;
procedure TList.Sort(compare: TCompareFunc);
begin
if compare(data, 20) <= 0 then
halt(1);
end;
end.