diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2020-09-21 19:37:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-21 13:37:14 +0200 |
commit | 40a868bccc6934aba99a9e490dad04296533b00f (patch) | |
tree | a20c8875064e4920cb65064219e77adf3bd77478 /tests/generics | |
parent | 6c83eb48c2686818a0527a64576e27f0dbb87560 (diff) | |
download | Nim-40a868bccc6934aba99a9e490dad04296533b00f.tar.gz |
add testcase for #6060 (#15366)
* add testcase for #6060 * Remove overspecific testament spec Co-authored-by: Clyybber <darkmine956@gmail.com>
Diffstat (limited to 'tests/generics')
-rw-r--r-- | tests/generics/t6060.nim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/generics/t6060.nim b/tests/generics/t6060.nim new file mode 100644 index 000000000..6b1856f1c --- /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 {:}" |