aboutsummaryrefslogtreecommitdiff
path: root/testsuite/compilable/generic_alias.elna
blob: da9501a7521868254434e45d2423694491cc0f9c (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.