aboutsummaryrefslogtreecommitdiff
path: root/testsuite/compilable/generic_alias.elna
blob: 47ac63800db10b4c8fd36d867aa0df3b47f0361a (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
program()
type
  File = record
    fd: Int
  end

  Node#[T] = record
    next: ^Node#[T];
    value: T
  end

  Ref#[T] = ^T

  Boxed#[V] = record
    inner: ^Node#[V]
  end

var
  chain: Node#[^File]
  aliased: Ref#[^File]
  raw: ^^File
  boxed: Boxed#[^File]

begin
  chain.next := nil;
  aliased := raw;
  raw := aliased;
  boxed.inner := @chain
end.