From 40a868bccc6934aba99a9e490dad04296533b00f Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Mon, 21 Sep 2020 19:37:14 +0800 Subject: [PATCH] add testcase for #6060 (#15366) * add testcase for #6060 * Remove overspecific testament spec Co-authored-by: Clyybber --- tests/generics/t6060.nim | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/generics/t6060.nim diff --git a/tests/generics/t6060.nim b/tests/generics/t6060.nim new file mode 100644 index 0000000000..6b1856f1c8 --- /dev/null +++ b/tests/generics/t6060.nim @@ -0,0 +1,11 @@ +import tables + +type MyTab[A,B] = distinct TableRef[A,B] + +proc `$`[A,B](t: MyTab[A,B]): string = + "My special table " & $TableRef[A,B](t) + +proc create[A,B](): MyTab[A,B] = MyTab(newTable[A,B]()) + +var a = create[int,int]() +doAssert $a == "My special table {:}"