diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-04-09 13:06:38 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-04-09 13:06:38 +0200 |
commit | 1d5c28fc14b92a2b2df4e9d6fa4b1fee0e213685 (patch) | |
tree | 9a237aba08cc8a156b7a625afc8866ac9b6f6c8e /tests | |
parent | 7d3f47cef91a07549bb568d5ac538df3bf312887 (diff) | |
parent | 3922a0871dfafa7a57155db19efa15b73e3d7fb7 (diff) | |
download | Nim-1d5c28fc14b92a2b2df4e9d6fa4b1fee0e213685.tar.gz |
Merge pull request #4050 from yglukhov/tr-varargs
Fixed tr pattern matching for varargs
Diffstat (limited to 'tests')
-rw-r--r-- | tests/trmacros/tpatterns.nim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/trmacros/tpatterns.nim b/tests/trmacros/tpatterns.nim index 6bc8772e3..907973637 100644 --- a/tests/trmacros/tpatterns.nim +++ b/tests/trmacros/tpatterns.nim @@ -1,6 +1,7 @@ discard """ output: '''48 -hel''' +hel +lo''' """ template optZero{x+x}(x: int): int = x*3 @@ -15,3 +16,8 @@ s[0] = "hello" s[0] = substr(s[0], 0, 2) echo s[0] + +# Test varargs matching +proc someVarargProc(k: varargs[string]) = doAssert(false) # this should not get called +template someVarargProcSingleArg{someVarargProc([a])}(a: string) = echo a +someVarargProc("lo") |