diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 2f2f3212..e9809133 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -906,6 +906,7 @@ resolve_function_overload :: proc(ast_context: ^AstContext, group: ^ast.Proc_Gro // TODO: check intrinsics for parapoly types? if _, is_poly := arg_symbol.value.(SymbolPolyTypeValue); is_poly { + candidate.score += 1 continue } diff --git a/tests/hover_test.odin b/tests/hover_test.odin index fa841ade..0e42a7ab 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -6243,6 +6243,33 @@ ast_hover_generic_overload_multiple_params :: proc(t: ^testing.T) { test.expect_hover(t, &source, "test.bazz: int") } +@(test) +ast_hover_generic_overload_parapoly_with_exact_match :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + Foo :: struct {} + + foo :: proc { + foo_bool, + foo_foo, + } + + foo_bool :: proc(value: $T, ok: $B) -> (T, bool) {} + + foo_foo :: proc(value: $T, result: Foo) -> (T, Foo) {} + + bar :: proc() -> (object: u64, result: Foo) { + return + } + + main :: proc() { + object, r{*}esult := foo(bar()) + } + `, + } + + test.expect_hover(t, &source, "test.result: test.Foo") +} /* Waiting for odin fix