From ebc70c286e1817f225525e7e27089cb5d7eb548a Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Sat, 25 Oct 2025 19:31:03 -0400 Subject: Fix displayed return type when inlining a enum, struct, or union --- tests/hover_test.odin | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tests/hover_test.odin') diff --git a/tests/hover_test.odin b/tests/hover_test.odin index a90346e..e51d116 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -5282,6 +5282,36 @@ ast_hover_proc_group_named_arg_with_nil :: proc(t: ^testing.T) { } test.expect_hover(t, &source, "test.bar :: proc(i: int, foo: ^Foo)") } + +@(test) +ast_hover_proc_return_with_union :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + f{*}oo :: proc() -> union{string, [4]u8} {} + `, + } + test.expect_hover(t, &source, "test.foo :: proc() -> union{string, [4]u8}") +} + +@(test) +ast_hover_proc_return_with_struct :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + f{*}oo :: proc() -> struct{s: string, i: int} {} + `, + } + test.expect_hover(t, &source, "test.foo :: proc() -> struct{s: string, i: int}") +} + +@(test) +ast_hover_proc_return_with_enum :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + f{*}oo :: proc() -> enum{A, B} {} + `, + } + test.expect_hover(t, &source, "test.foo :: proc() -> enum{A, B}") +} /* Waiting for odin fix -- cgit v1.2.3