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

@ -1,6 +1,5 @@
discard """
output: '''TMatrix[3, 3, system.int]
3
3'''
"""
@ -22,5 +21,5 @@ proc echoMat2(a: TMat2) =
var m = TMatrix[3,3,int](data: [1,2,3,4,5,6,7,8,9])
echoMatrix m
echoMat2 m
#echoMat2 m

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)