varargs[untyped] actually works

This commit is contained in:
Araq
2015-07-02 21:22:56 +02:00
parent 560cfd48fc
commit bbf7e18e5b

View File

@@ -1512,7 +1512,12 @@ proc matchesAux(c: PContext, n, nOrig: PNode,
while a < n.len:
if a >= formalLen-1 and formal != nil and formal.typ.isVarargsUntyped:
discard
if container.isNil:
container = newNodeIT(nkBracket, n.sons[a].info, arrayConstr(c, n.info))
setSon(m.call, formal.position + 1, container)
else:
incrIndexType(container.typ)
addSon(container, n.sons[a])
elif n.sons[a].kind == nkExprEqExpr:
# named param
# check if m.callee has such a param: