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

program()
begin
  chain.next := nil;
  aliased := raw;
  raw := aliased;
  boxed.inner := @chain
return 0u8

end.