diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-10-25 19:31:03 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-10-25 19:31:03 -0400 |
| commit | ebc70c286e1817f225525e7e27089cb5d7eb548a (patch) | |
| tree | a1bb099aad1e4c1915a464aaa82df45d8ae22328 /tests/hover_test.odin | |
| parent | 3ea1da1ff4f5d0a6e69339da9dd0f065a3455770 (diff) | |
Fix displayed return type when inlining a enum, struct, or union
Diffstat (limited to 'tests/hover_test.odin')
| -rw-r--r-- | tests/hover_test.odin | 30 |
1 files changed, 30 insertions, 0 deletions
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 |