aboutsummaryrefslogtreecommitdiff
path: root/testsuite/compilable/generic_inference.elna
blob: ab1ff3a03ac483446b0e6b62eb8d5fbb455db44d (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
27
28
29
30
31
program()
type
  File = record
    fd: Int
  end

  Cell#[T] = record
    held: T
  end

var
  files: Cell#[^File]
  bytes: Cell#[^Word8]
  f: File
  b: Word8

proc store#[T](target: ^Cell#[T]; value: T)
begin
  target^.held := value
return

proc relay#[T](target: ^Cell#[T]; value: T)
begin
  store(target, value)
return

begin
  store(@files, @f);
  relay(@bytes, @b);
  store(@files, nil)
end.