fpc/tests/webtbs/tw10247b.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

45 lines
580 B
ObjectPascal

{$mode objfpc}{$h+}
type
generic TNode<T> = class
public
type
PT = T;
private
var
Data: T;
public
constructor Create;
destructor Destroy; override;
end;
TTNodeLongint = specialize TNode<Longint>;
TTNodeString = specialize TNode<String>;
constructor TNode.Create;
begin
end;
destructor TNode.Destroy;
begin
inherited Destroy;
end;
function GetIntNode: TTNodeLongint.T;
begin
result := 10;
end;
function GetStringNode: TTNodeString.PT;
begin
result := 'abc';
end;
begin
writeln(GetIntNode);
writeln(GetStringNode);
end.