ref: 6d2f54a54d3f8e58f1063374ef82d07f665f5562
parent: 5248ba5079d913bb416ebbb1eea4b8750acd819a
author: Ori Bernstein <[email protected]>
date: Sat Jul 21 21:22:50 EDT 2012
Don't die when calling functions with the wrong arity.
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -418,6 +418,9 @@
unify(st, n, ft, type(st, n->expr.args[0]));
}
for (i = 1; i < n->expr.nargs; i++) {
+ if (i == ft->nsub)
+ fatal(n->line, "Calling %s with too many arguments (expected %zd, got %zd)",
+ ctxstr(st, n->expr.args[0]), ft->nsub, n->expr.nargs);
if (ft->sub[i]->type == Tyvalist)
break;
inferexpr(st, n->expr.args[i], NULL, NULL);