From 9a7b6af5fab3dc418ca4e63e071f3764ec1b73de Mon Sep 17 00:00:00 2001 From: Matthew Baulch Date: Tue, 5 Jul 2016 06:14:36 +1000 Subject: [PATCH] Report wrong arg count when too many params and no varargs. --- compiler/ccgcalls.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim index bd17f85e46..879b574235 100644 --- a/compiler/ccgcalls.nim +++ b/compiler/ccgcalls.nim @@ -260,6 +260,8 @@ proc genOtherArg(p: BProc; ri: PNode; i: int; typ: PType): Rope = else: result = genArgNoParam(p, ri.sons[i]) #, typ.n.sons[i].sym) else: + if tfVarargs notin typ.flags: + localError(ri.info, "wrong argument count") result = genArgNoParam(p, ri.sons[i]) discard """