Report wrong arg count when too many params and no varargs.

This commit is contained in:
Matthew Baulch 2016-07-05 06:14:36 +10:00
commit 9a7b6af5fa

View file

@ -260,6 +260,8 @@ proc genOtherArg(p: BProc; ri: PNode; i: int; typ: PType): Rope =
else: else:
result = genArgNoParam(p, ri.sons[i]) #, typ.n.sons[i].sym) result = genArgNoParam(p, ri.sons[i]) #, typ.n.sons[i].sym)
else: else:
if tfVarargs notin typ.flags:
localError(ri.info, "wrong argument count")
result = genArgNoParam(p, ri.sons[i]) result = genArgNoParam(p, ri.sons[i])
discard """ discard """