summary refs log tree commit diff stats
path: root/tests/generics/tprevent_double_bind.nim
blob: d8fc6e5d3c499b2279602e5f9d5a6c47ee366804 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
discard """
  errormsg: "type mismatch: got <TT[seq[string]], proc (v: int){.gcsafe.}>"
  line: 20
"""

# bug #6732
import typetraits

type
  TT[T] = ref object of RootObj
    val: T
  CB[T] = proc (v: T)

proc testGeneric[T](val: TT[T], cb: CB[T]) =
  echo val.type.name
  echo $val.val

var tt = new(TT[seq[string]])
echo tt.type.name
tt.testGeneric( proc (v: int) =
    echo $v )