summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/types.c b/types.c
index b57b7a5..2e02b49 100644
--- a/types.c
+++ b/types.c
@@ -1217,7 +1217,9 @@ static Status call_arg_param_order(FnExpr *fn, Type *fn_type, Argument *args, Lo
arr_foreach(fn->params, Declaration, decl) {
arr_foreach(decl->idents, Identifier, ident) {
if (order[param_idx] == -1) {
- if (!(decl->flags & DECL_HAS_EXPR) && !(decl->flags & DECL_INFER)) {
+ if (type_is_builtin(&decl->type, BUILTIN_VARARGS)) {
+ order[param_idx] = (I16)nargs;
+ } else if (!(decl->flags & DECL_HAS_EXPR) && !(decl->flags & DECL_INFER)) {
char *s = ident_to_str(*ident);
err_print(where, "Parameter #%lu (%s) was not set in function call.", param_idx+1, s);
free(s);