aboutsummaryrefslogtreecommitdiff
path: root/tests/hover_test.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-11-03 17:54:43 -0500
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-11-03 17:54:43 -0500
commitf80b0d2b3d379aa74af88f7502fb4b2d186e13b3 (patch)
treed76006ac93a64edbcf48756cd1f5681a3cf3cdf5 /tests/hover_test.odin
parentff012d06212e524aee21933b484df1d3c4e5e1e2 (diff)
Score overload candidates higher if they contain the correct number of args
Diffstat (limited to 'tests/hover_test.odin')
-rw-r--r--tests/hover_test.odin22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 657bc9e..5df5ba7 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -5493,6 +5493,28 @@ ast_hover_parapoly_return_dynamic_array :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.foo: [dynamic]string")
}
+
+@(test)
+ast_hover_proc_overload_with_less_args :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: struct {}
+
+ foo_out :: proc(input: int, out_struct: ^Foo) -> (ok: bool) {}
+ foo_helper :: proc(input: int) -> (out_struct: Foo, ok: bool) {}
+
+ foo :: proc {
+ foo_out,
+ foo_helper,
+ }
+
+ main :: proc() {
+ some, ok := f{*}oo(1)
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.foo :: proc(input: int) -> (out_struct: Foo, ok: bool)")
+}
/*
Waiting for odin fix