summary refs log blame commit diff stats
path: root/tests/generics/t6060.nim
blob: 6b1856f1c85a0e7de6d83c45424c5e019ab3ea89 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
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 {:}"