implements varargs[untyped]; refs #2545; to be documented
This commit is contained in:
parent
de5113805a
commit
cabbcd411d
11 changed files with 75 additions and 37 deletions
|
|
@ -1,12 +1,14 @@
|
|||
discard """
|
||||
output: '''success'''
|
||||
output: '''success
|
||||
true
|
||||
true'''
|
||||
"""
|
||||
|
||||
#bug #913
|
||||
|
||||
import macros
|
||||
|
||||
macro thirteen(args: varargs[expr]): expr =
|
||||
macro thirteen(args: varargs[expr]): expr =
|
||||
result = newIntLitNode(13)
|
||||
|
||||
doAssert(13==thirteen([1,2])) # works
|
||||
|
|
@ -16,3 +18,11 @@ doAssert(13==thirteen(1,[2])) # does not work
|
|||
doAssert(13==thirteen([1], 2)) # does not work
|
||||
|
||||
echo "success"
|
||||
|
||||
# bug #2545
|
||||
|
||||
import macros
|
||||
macro test(e: varargs[untyped]): expr = bindSym"true"
|
||||
|
||||
echo test(a)
|
||||
echo test(fake=90, arguments=80, also="false", possible=true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue