fpc/tests/test/ugenfunc19.pp
2019-12-02 22:29:34 +00:00

38 lines
479 B
ObjectPascal

unit ugenfunc19;
{$mode objfpc}{$H+}
interface
type
TTest = class
class function Test: LongInt; static;
end;
TTestHelper = class helper for TTest
class function Test: LongInt; static;
end;
generic function DoTest<T: TTest>: LongInt;
implementation
class function TTest.Test: LongInt;
begin
Result := 1;
end;
class function TTestHelper.Test: LongInt;
begin
Result := 2;
end;
generic function DoTest<T>: LongInt;
begin
Result := T.Test;
end;
end.