summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/sigmatch.nim3
-rw-r--r--tests/js/tvarargs.nim12
2 files changed, 14 insertions, 1 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 354cf965e..96df0c5c6 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -1635,6 +1635,7 @@ proc matchesAux(c: PContext, n, nOrig: PNode,
           if arg != nil and m.baseTypeMatch and container != nil:
             addSon(container, arg)
             incrIndexType(container.typ)
+            checkConstraint(n.sons[a])
           else:
             m.state = csNoMatch
             return
@@ -1675,7 +1676,7 @@ proc matchesAux(c: PContext, n, nOrig: PNode,
           setSon(m.call, formal.position + 1, arg)
           inc(f)
           container = nil
-      checkConstraint(n.sons[a])
+        checkConstraint(n.sons[a])
     inc(a)
 
 proc semFinishOperands*(c: PContext, n: PNode) =
diff --git a/tests/js/tvarargs.nim b/tests/js/tvarargs.nim
new file mode 100644
index 000000000..e2366d7a9
--- /dev/null
+++ b/tests/js/tvarargs.nim
@@ -0,0 +1,12 @@
+
+# bug #3584
+
+type
+  ConsoleObj {.importc.} = object of RootObj
+    log*: proc() {.nimcall varargs.}
+  Console = ref ConsoleObj
+
+var console* {.importc nodecl.}: Console
+
+when isMainModule:
+  console.log "Hello, world"