This commit is contained in:
Araq 2015-02-08 15:43:50 +01:00
commit 34b4e9fc96
4 changed files with 49 additions and 23 deletions

View file

@ -12,3 +12,22 @@ template genNodeKind(kind, name: expr): stmt =
result.add(c)
genNodeKind(nnkNone, None)
# Test that generics in templates still work (regression to fix #1915)
# bug #2004
type Something = object
proc testA(x: Something) = discard
template def(name: expr) {.immediate.} =
proc testB[T](reallyUniqueName: T) =
`test name`(reallyUniqueName)
def A
var x: Something
testB(x)