diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/generics/t1056.nim | 3 | ||||
-rw-r--r-- | tests/template/tparams_gensymed.nim | 19 |
2 files changed, 20 insertions, 2 deletions
diff --git a/tests/generics/t1056.nim b/tests/generics/t1056.nim index 73a24a76a..b1fe25894 100644 --- a/tests/generics/t1056.nim +++ b/tests/generics/t1056.nim @@ -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 diff --git a/tests/template/tparams_gensymed.nim b/tests/template/tparams_gensymed.nim index 4178812af..33940874d 100644 --- a/tests/template/tparams_gensymed.nim +++ b/tests/template/tparams_gensymed.nim @@ -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) + + |