diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-09 09:45:33 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-09 10:11:41 -0400 |
| commit | 5b4b6564584ccf544f5fe7e0ce9bafd2e77cdd09 (patch) | |
| tree | 1f35776123ece621ad6309a142379c18a1b30467 /tests | |
| parent | 3e183972229782baefc269d8ca940a60caad83c1 (diff) | |
Implement method to resolve poly return types based on the types of local variables
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hover_test.odin | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin index edba279..9a43587 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -3590,6 +3590,41 @@ ast_hover_parapoly_proc_dynamic_array_elems :: proc(t: ^testing.T) { "test.elem: ^$T" ) } + +@(test) +ast_hover_parapoly_proc_slice_param :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + foo :: proc(x: $T) -> T { + return x + } + + main :: proc() { + x : []u8 + b{*}ar := foo(x) + } + `, + } + test.expect_hover(t, &source, "test.bar: []u8") +} + +@(test) +ast_hover_parapoly_proc_multi_pointer_param :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + foo :: proc(x: ^$T) -> ^T { + return x + } + + + main :: proc() { + x : [^]u8 + b{*}ar := foo(x) + } + `, + } + test.expect_hover(t, &source, "test.bar: ^[^]u8") +} /* Waiting for odin fix |