add testcase for #6060 (#15366)

* add testcase for #6060

* Remove overspecific testament spec

Co-authored-by: Clyybber <darkmine956@gmail.com>
This commit is contained in:
flywind 2020-09-21 19:37:14 +08:00 • committed by GitHub
commit 40a868bccc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

11
tests/generics/t6060.nim Normal file
View file

@ -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 {:}"