aboutsummaryrefslogtreecommitdiff
path: root/tests/hover_test.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-17 08:26:07 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-17 08:26:07 -0400
commit2d7c8bedac7d3e4780a8507a8b00b6dea254cd0d (patch)
tree05f6a69736343d24288c7847361680dcc52b0011 /tests/hover_test.odin
parent379c55200570277d68a78006844cd32b1802f328 (diff)
Correctly resolve local if and when ternary expressions
Diffstat (limited to 'tests/hover_test.odin')
-rw-r--r--tests/hover_test.odin13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 402e38a..071bcba 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -4821,6 +4821,19 @@ ast_hover_enum_implicit_if_statement :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.Foo: .A")
}
+
+@(test)
+ast_hover_if_ternary_expr :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ main :: proc() {
+ foo: []int
+ ba{*}r := len(foo) if true else 2
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.bar: int")
+}
/*
Waiting for odin fix