fix varargs forwarding for templates; fixes #5455 (#5505)

* fix varargs forwarding for templates; fixes #5455
* document the macros' varargs change in the news for 0.16.2
This commit is contained in:
zah 2017-03-13 23:02:11 +02:00 • committed by Andreas Rumpf
commit 650b20dc5e
3 changed files with 42 additions and 2 deletions

View file

@ -1651,7 +1651,7 @@ proc matchesAux(c: PContext, n, nOrig: PNode,
if a >= formalLen-1 and formal != nil and formal.typ.isVarargsUntyped:
incl(marker, formal.position)
if container.isNil:
container = newNodeIT(nkBracket, n.sons[a].info, arrayConstr(c, n.info))
container = newNodeIT(nkArgList, n.sons[a].info, arrayConstr(c, n.info))
setSon(m.call, formal.position + 1, container)
else:
incrIndexType(container.typ)
@ -1739,7 +1739,7 @@ proc matchesAux(c: PContext, n, nOrig: PNode,
if formal.typ.isVarargsUntyped:
if container.isNil:
container = newNodeIT(nkBracket, n.sons[a].info, arrayConstr(c, n.info))
container = newNodeIT(nkArgList, n.sons[a].info, arrayConstr(c, n.info))
setSon(m.call, formal.position + 1, container)
else:
incrIndexType(container.typ)