From 12deb18a07dc28f840555fb6c875d888ab5be13b Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Sun, 16 Nov 2025 15:30:54 -0500 Subject: Correct resolving unary exprs immediately after a function call --- tests/hover_test.odin | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'tests') diff --git a/tests/hover_test.odin b/tests/hover_test.odin index 52dca76..8d5f461 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -5642,6 +5642,39 @@ ast_hover_named_proc_arg_hover :: proc(t: ^testing.T) { } test.expect_hover(t, &source, "foo.bar: f32") } + +@(test) +ast_hover_unary_function_call :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + foo :: proc() -> int {} + + main :: proc() { + b{*}ar := -foo() + } + `, + } + test.expect_hover(t, &source, "test.bar: int") +} + +@(test) +ast_hover_unary_overload_function_call :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + foo_int :: proc() -> int {} + foo_string :: proc(s: string) -> string {} + foo :: proc { + foo_int, + foo_string, + } + + main :: proc() { + b{*}ar := -foo() + } + `, + } + test.expect_hover(t, &source, "test.bar: int") +} /* Waiting for odin fix -- cgit v1.2.3