From bbf7e18e5b5bbaede2061f2002965d9572274c67 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 2 Jul 2015 21:22:56 +0200 Subject: [PATCH] varargs[untyped] actually works --- compiler/sigmatch.nim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index fa27a8c95d..540f0a04f6 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -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: