diff options
author | Yuriy Glukhov <yutiy.glukhov@gmail.com> | 2016-04-05 22:44:10 +0300 |
---|---|---|
committer | Yuriy Glukhov <yutiy.glukhov@gmail.com> | 2016-04-07 21:24:43 +0300 |
commit | b6f5c12158a9ecfd602898970c2535ae88ce9d98 (patch) | |
tree | 45fb2ada87c186e1bab2e5114c7e3f913650751d /tests/trmacros | |
parent | 9a747828feeb3c25e5fe0caedc04a2af10ca3ce2 (diff) | |
download | Nim-b6f5c12158a9ecfd602898970c2535ae88ce9d98.tar.gz |
Fixed tr pattern matching for varargs
Diffstat (limited to 'tests/trmacros')
-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") |