From 6c83eb48c2686818a0527a64576e27f0dbb87560 Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Mon, 21 Sep 2020 19:32:05 +0800 Subject: add testcase for #7165 (#15368) * add testcase for #7165 * Remove overspecific testament spec Co-authored-by: Clyybber --- tests/distinct/t7165.nim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/distinct/t7165.nim 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() -- cgit 1.4.1-2-gfad0