summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/test/tgeneric24.pp
blob: 53611e2d20e0dd3bde08dd5f868221b7a0848fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
program tgeneric24;

{$mode objfpc}{$H+}
{$apptype console}

type
  generic TFoo<T> = record
    F: T;
  end;
var
  FooInt: specialize TFoo<Integer>;
  FooStr: specialize TFoo<String>;
begin
  FooInt.F := 1;
  WriteLn(FooInt.F);
  FooStr.F := 'test';
  WriteLn(FooStr.F);
end.