summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-11-09 14:58:26 -0500
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-11-09 14:58:26 -0500
commitd9e64b659b4e3a6bd3e0b06683705dcb91b951df (patch)
tree2cf3febad5af9e14a516f4623bda2d89245dae0f /tests
parent0d6f26fa21ceb6c656ed19e008f74091a4cf6686 (diff)
Correctly resolve exprs when immediately indexing or slicing a function call
Diffstat (limited to 'tests')
-rw-r--r--tests/hover_test.odin28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 9a1f47e..09f4bb9 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -5571,6 +5571,34 @@ ast_hover_soa_poly_proc :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.bar: #soa^#soa[dynamic]struct{}")
}
+
+@(test)
+ast_hover_slice_function_call :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ foo :: proc() -> []int {}
+
+ main :: proc() {
+ x{*} := foo()[:1]
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.x: []int")
+}
+
+@(test)
+ast_hover_index_function_call :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ foo :: proc() -> []int {}
+
+ main :: proc() {
+ x{*} := foo()[0]
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.x: int")
+}
/*
Waiting for odin fix