diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2020-09-21 19:32:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-21 13:32:05 +0200 |
commit | 6c83eb48c2686818a0527a64576e27f0dbb87560 (patch) | |
tree | 6101916f1ccff2ae78f39bb8cb8edb77725536d3 | |
parent | db9ab2a4c00bc650a8526115d659b57dcd38c39b (diff) | |
download | Nim-6c83eb48c2686818a0527a64576e27f0dbb87560.tar.gz |
add testcase for #7165 (#15368)
* add testcase for #7165 * Remove overspecific testament spec Co-authored-by: Clyybber <darkmine956@gmail.com>
-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() |