mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-22 07:15:22 +00:00
implements varargs[untyped]; refs #2545; to be documented
This commit is contained in:
@@ -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
|
||||
2
tests/testdata/doc1.xml
vendored
2
tests/testdata/doc1.xml
vendored
@@ -3,7 +3,7 @@
|
||||
<tag>
|
||||
<test arg="blah" arg2="test"/>
|
||||
<test2>
|
||||
bla ah absy hsh
|
||||
bla ah absy hsh
|
||||
hsh
|
||||
sjj
|
||||
</test2>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user