diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-09-25 08:13:19 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-09-25 08:19:30 -0400 |
| commit | 8a014d117e86178e5b9ab5c91fd5c92d2ebf9422 (patch) | |
| tree | e4ba3a2edf14788d8abaf15b189dc24e443e3d93 /tests/hover_test.odin | |
| parent | a530e1c8eec638adf78f1c77720fbc07bdd31de5 (diff) | |
Correctly infer types when indexing matrices
Diffstat (limited to 'tests/hover_test.odin')
| -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 345e9f9..d0b844e 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -5033,7 +5033,6 @@ ast_hover_proc_overload_basic_type_alias :: proc(t: ^testing.T) { ast_hover_proc_overload_nil_pointer :: proc(t: ^testing.T) { source := test.Source { main = `package test - import "my_package" foo_int :: proc(i: int) {} foo_ptr :: proc(s: ^string) {} @@ -5086,6 +5085,33 @@ ast_hover_package_proc_naming_conflicting_with_another_package :: proc(t: ^testi test.expect_hover(t, &source, "my_package.foo :: proc()") } + +@(test) +ast_hover_matrix_index :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + main :: proc() { + foo: matrix[3, 2]f32 + a{*} := foo[0] + } + `, + } + test.expect_hover(t, &source, "test.a: [3]f32") +} + +@(test) +ast_hover_matrix_index_twice :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + main :: proc() { + foo: matrix[2, 3]f32 + a := foo[0] + b{*} := a[0] + } + `, + } + test.expect_hover(t, &source, "test.b: f32") +} /* Waiting for odin fix |