fpc/tests/webtbs/tw35735.pp
2019-07-05 14:12:13 +00:00

34 lines
412 B
ObjectPascal

{ %NORUN }
program tw35735;
{$Mode objfpc}
uses
Classes, SysUtils;
type
{ TObjectHelper }
TObjectHelper = class helper for TObject
public
generic function Test<T>(): String;
end;
{ TComponentHelper }
generic function TObjectHelper.Test<T>: String;
begin
Result := T.ClassName
end;
var
O: TObject;
begin
O := TObject.Create;
WriteLn(O.specialize Test<TPersistent>);
O.Free;
end.