ordinary parameters can follow a varargs parameter
This commit is contained in:
parent
41385f3aaf
commit
c4eddb3fda
4 changed files with 44 additions and 9 deletions
17
tests/overload/tparams_after_varargs.nim
Normal file
17
tests/overload/tparams_after_varargs.nim
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
discard """
|
||||
output: '''a 1 b 2 x @[3, 4, 5] y 6 z 7
|
||||
yay
|
||||
12'''
|
||||
"""
|
||||
|
||||
proc test(a, b: int, x: varargs[int]; y, z: int) =
|
||||
echo "a ", a, " b ", b, " x ", @x, " y ", y, " z ", z
|
||||
|
||||
test 1, 2, 3, 4, 5, 6, 7
|
||||
|
||||
template takesBlock(a, b: int, x: varargs[expr]; blck: stmt) =
|
||||
blck
|
||||
echo a, b
|
||||
|
||||
takesBlock 1, 2, "some", 0.90, "random stuff":
|
||||
echo "yay"
|
||||
Loading…
Add table
Add a link
Reference in a new issue