fixes #2004
This commit is contained in:
parent
ada0f14711
commit
34b4e9fc96
4 changed files with 49 additions and 23 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue