summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-09-21 19:32:05 +0800
committerGitHub <noreply@github.com>2020-09-21 13:32:05 +0200
commit6c83eb48c2686818a0527a64576e27f0dbb87560 (patch)
tree6101916f1ccff2ae78f39bb8cb8edb77725536d3
parentdb9ab2a4c00bc650a8526115d659b57dcd38c39b (diff)
downloadNim-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.nim15
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()