implements varargs[untyped]; refs #2545; to be documented

This commit is contained in:
Araq
2015-07-02 16:18:11 +02:00
parent de5113805a
commit cabbcd411d
11 changed files with 75 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
discard """
exitcode: 0
"""
import mgenericprocmatcher
import moverloading_typedesc
import tables
type
@@ -10,7 +10,7 @@ type
when isMainModule:
doAssert FBar.new() == 3
# doAssert FBar.new() == 3
proc new(_: typedesc[LFoo]): int = 0
proc new[T](_: typedesc[T]): int = 1

View File

@@ -3,7 +3,7 @@
<tag>
<test arg="blah" arg2="test"/>
<test2>
bla ah absy hsh
bla ah absy hsh
hsh
sjj
</test2>

View File

@@ -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)