summary refs log tree commit diff stats
path: root/tests/distinct/t7165.nim
blob: b16c29c0ef95bcdc68fcb1b24c56cf2a3f88b6d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
type
  Table[K, V] = object
    key: K
    val: V

  MyTable = distinct Table[string, int]
  MyTableRef = ref MyTable

proc newTable[K, V](): ref Table[K, V] = discard

proc newMyTable: MyTableRef =
  MyTableRef(newTable[string, int]()) # <--- error here

discard newMyTable()