diff options
| author | Bradley Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-11-03 17:58:34 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-03 17:58:34 -0500 |
| commit | ade7ec02e3aa4e8b198e4853699d4a3484caa1cc (patch) | |
| tree | d76006ac93a64edbcf48756cd1f5681a3cf3cdf5 /src | |
| parent | ff012d06212e524aee21933b484df1d3c4e5e1e2 (diff) | |
| parent | f80b0d2b3d379aa74af88f7502fb4b2d186e13b3 (diff) | |
Merge pull request #1148 from BradLewis/fix/overload-procs-incorrect-arg-count
Score overload candidates higher if they contain the correct number of args
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/analysis.odin | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 4ed56b7..9d93f39 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -734,6 +734,9 @@ resolve_function_overload :: proc(ast_context: ^AstContext, group: ast.Proc_Grou if call_expr != nil && arg_count < len(call_expr.args) { break next_fn } + if arg_count == len(call_expr.args) { + candidate.score /= 2 + } } for proc_arg in procedure.arg_types { for name in proc_arg.names { |