diff options
Diffstat (limited to 'tests/distinct/t7165.nim')
-rw-r--r-- | tests/distinct/t7165.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/distinct/t7165.nim b/tests/distinct/t7165.nim new file mode 100644 index 000000000..b16c29c0e --- /dev/null +++ b/tests/distinct/t7165.nim @@ -0,0 +1,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() |