aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-07 22:34:43 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-07 22:34:43 -0400
commitfd12714250f96b8dbdb65825ac8b265edbe3bd10 (patch)
treedea664ed82d7f5671adaf28203165aa7689ef227 /tests
parenta3ebb67fd1893881a7e88021341f712461fc3a79 (diff)
Proc named returns should not be marked as parameters
Diffstat (limited to 'tests')
-rw-r--r--tests/semantic_tokens_test.odin19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/semantic_tokens_test.odin b/tests/semantic_tokens_test.odin
index 35714df..8fd8468 100644
--- a/tests/semantic_tokens_test.odin
+++ b/tests/semantic_tokens_test.odin
@@ -102,3 +102,22 @@ semantic_tokens_struct_fields :: proc(t: ^testing.T) {
{0, 4, 3, .Property, {}}, // [7] bar
})
}
+
+@(test)
+semantic_tokens_proc_return :: proc(t: ^testing.T) {
+ src := test.Source {
+ main = `package test
+ foo :: proc() -> (ret: int) {
+ ret += 1
+ return
+ }
+ `
+ }
+
+ 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
+ {1, 3, 3, .Variable, {}}, // [3] ret
+ })
+}