mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-29 01:14:40 +00:00
Improve type inferencing of literals when calling proc groups
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user