summaryrefslogtreecommitdiff
path: root/tests/test/tgenfunc7.pp
blob: ab4f7b7a0f4d2d62f074036a04001b2422aa0b8a (plain)
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
{ generics in another unit work as well }

program tgenfunc7;

{$mode objfpc}

uses
  ugenfunc7;

var
  t: TTest;
begin
  if specialize Add<LongInt>(3, 4) <> 7 then
    Halt(1);
  if specialize Add<String>('Hello', 'World') <> 'HelloWorld' then
    Halt(2);
  if TTest.specialize AddClass<LongInt>(3, 4) <> 7 then
    Halt(3);
  if TTest.specialize AddClass<String>('Hello', 'World') <> 'HelloWorld' then
    Halt(4);
  if t.specialize Add<LongInt>(3, 4) <> 7 then
    Halt(5);
  if t.specialize Add<String>('Hello', 'World') <> 'HelloWorld' then
    Halt(6);
end.