aboutsummaryrefslogtreecommitdiff
path: root/testsuite/compilable/generic_base_chain.elna
blob: 736042b2fb8045fd9be244b33c2e52ffc34cb207 (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

  Map#[K, V] = record
    key: K;
    value: V
  end

  Cache#[K, V] = record(Map#[^Word8, V])
    newest: K
  end

var
  store: Cache#[^Int, ^File]
  byte_key: ^Word8
  upcast: ^Map#[^Word8, ^File]

proc put#[K2, V2](target: ^Map#[K2, V2]; key: K2)
begin
  target^.key := key
return

program()
begin
  upcast := @store;
  put(@store, byte_key)
return 0u8

end.