aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-17 19:41:00 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-17 19:44:45 -0400
commit753404b760316aed6c612be1c2bb6d6ebf70ebce (patch)
treef31e480002b6177c16d714646772e46df06dcb7c /tests
parent761f556b80abe30d7b2b6c1c692d584eeff91795 (diff)
Correctly type fixed array selector fields
Diffstat (limited to 'tests')
-rw-r--r--tests/semantic_tokens_test.odin23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/semantic_tokens_test.odin b/tests/semantic_tokens_test.odin
index 8fd8468..afb6b6a 100644
--- a/tests/semantic_tokens_test.odin
+++ b/tests/semantic_tokens_test.odin
@@ -117,7 +117,28 @@ semantic_tokens_proc_return :: proc(t: ^testing.T) {
test.expect_semantic_tokens(t, &src, {
{1, 2, 3, .Function, {.ReadOnly}}, // [0] foo
{0, 18, 3, .Variable, {}}, // [1] ret
- {0, 5, 3, .Type, {.ReadOnly}}, // [2] proc
+ {0, 5, 3, .Type, {.ReadOnly}}, // [2] int
{1, 3, 3, .Variable, {}}, // [3] ret
})
}
+
+@(test)
+semantic_tokens_fixed_array_fields :: proc(t: ^testing.T) {
+ src := test.Source {
+ main = `package test
+ main :: proc() {
+ foo: [2]f32
+ y := foo.x
+ }
+ `
+ }
+
+ test.expect_semantic_tokens(t, &src, {
+ {1, 2, 4, .Function, {.ReadOnly}}, // [0] main
+ {1, 3, 3, .Variable, {}}, // [1] foo
+ {0, 8, 3, .Type, {.ReadOnly}}, // [2] f32
+ {1, 3, 1, .Variable, {}}, // [3] y
+ {0, 5, 3, .Variable, {}}, // [4] foo
+ {0, 4, 1, .Property, {}}, // [5] x
+ })
+}