diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-09-14 08:19:46 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-09-14 08:19:46 -0400 |
| commit | 53307cd6b31b031c9b718df66eec8ba2f56d7f7b (patch) | |
| tree | 1636f71bc2bc50481ccc9e294249e9496021e1a5 /tests | |
| parent | e1bbebd377a15b1833c89fa00c23edb8e702c1e3 (diff) | |
Correct resolved types when slicing multi-pointers
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hover_test.odin | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin index 51e53bf..37d0362 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -4202,7 +4202,7 @@ ast_hover_untyped_string_index :: proc(t: ^testing.T) { } @(test) -ast_hover_multi_pointer_slice_range :: proc(t: ^testing.T) { +ast_hover_multi_pointer_slice_end_range :: proc(t: ^testing.T) { source := test.Source { main = `package test main :: proc() { @@ -4215,6 +4215,32 @@ ast_hover_multi_pointer_slice_range :: proc(t: ^testing.T) { } @(test) +ast_hover_multi_pointer_slice_start_range :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + main :: proc() { + foo: [^]int + b{*}ar := foo[1:] + } + `, + } + test.expect_hover(t, &source, "test.bar: [^]int") +} + +@(test) +ast_hover_multi_pointer_slice_no_range :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + main :: proc() { + foo: [^]int + b{*}ar := foo[:] + } + `, + } + test.expect_hover(t, &source, "test.bar: [^]int") +} + +@(test) ast_hover_binary_expr_with_type :: proc(t: ^testing.T) { source := test.Source { main = `package test |