diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/check_expr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index d2505c047..417d1b9a4 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -6977,6 +6977,10 @@ gb_internal CallArgumentData check_call_arguments_proc_group(CheckerContext *c, array_unordered_remove(&procs, proc_index); continue; } + if (!pt->Proc.variadic && max_arg_count != ISIZE_MAX && param_count < max_arg_count) { + array_unordered_remove(&procs, proc_index); + continue; + } proc_index++; } } @@ -7014,6 +7018,8 @@ gb_internal CallArgumentData check_call_arguments_proc_group(CheckerContext *c, { // NOTE(bill, 2019-07-13): This code is used to improve the type inference for procedure groups // where the same positional parameter has the same type value (and ellipsis) + + //TODO: get rid of proc_arg_count. make lhs as long as longest proc with most params. watch out for null safety isize proc_arg_count = -1; for (Entity *p : procs) { Type *pt = base_type(p->type); |