aboutsummaryrefslogtreecommitdiff
path: root/tests/hover_test.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-28 19:05:23 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-28 19:05:23 -0400
commitab4f9363beeba79e26fdbcd61eff293ac50d6ef5 (patch)
tree8fb8f592e7bebe3479fbbeb8d51d0baa4021f4c4 /tests/hover_test.odin
parent9f911012c3496fdc5e56733f0e7e52229ec37726 (diff)
Correctly resolve implicit selector within a switch case
Diffstat (limited to 'tests/hover_test.odin')
-rw-r--r--tests/hover_test.odin26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index adddb89..4889df6 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -4417,6 +4417,32 @@ ast_hover_defer_statement :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.s: struct {\n\tbar: int,\n}")
}
+
+@(test)
+ast_hover_implicit_selector_return :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+
+ Foo :: enum {
+ A,
+ B,
+ }
+
+ Bar :: enum {
+ A,
+ B,
+ }
+
+ main :: proc(foo: Foo) -> Bar {
+ switch foo {
+ case .A:
+ return .A{*}
+ }
+ }
+ `
+ }
+ test.expect_hover(t, &source, "test.Bar: .A")
+}
/*
Waiting for odin fix