summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-07-02 21:22:56 +0200
committerAraq <rumpf_a@web.de>2015-07-02 21:22:56 +0200
commitbbf7e18e5b5bbaede2061f2002965d9572274c67 (patch)
treee99b73eececa20a5729d4708ff720d0ccebcc649
parent560cfd48fc21205a7e7e0d4f17e2173e98fe76d3 (diff)
downloadNim-bbf7e18e5b5bbaede2061f2002965d9572274c67.tar.gz
varargs[untyped] actually works
-rw-r--r--compiler/sigmatch.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index fa27a8c95..540f0a04f 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: