diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-28 20:28:57 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-28 20:28:57 -0400 |
| commit | d36eccd1ed440c14f6b0138daeaebd206cd1d208 (patch) | |
| tree | efa6052a920ac301e14cd5d8a09fb109c89001ec /tests | |
| parent | 8fbda6ec890ec1d5cf4b886898877b2abb6b9126 (diff) | |
Correct resolving binary expr implicit selector expr
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/references_test.odin | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/references_test.odin b/tests/references_test.odin index c9c4891..2464924 100644 --- a/tests/references_test.odin +++ b/tests/references_test.odin @@ -1228,3 +1228,37 @@ ast_references_nested_switch_cases :: proc(t: ^testing.T) { test.expect_reference_locations(t, &source, locations[:]) } + +@(test) +ast_references_switch_cases_binary_expr :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + Foo :: enum { + A, + B{*}, + } + + Bar :: enum { + C, + D, + } + + main :: proc() { + foo: Foo + bar: Bar + + switch foo { + case .A: + if bar == .C {} + case .B: + } + } + `, + } + locations := []common.Location { + {range = {start = {line = 3, character = 3}, end = {line = 3, character = 4}}}, + {range = {start = {line = 18, character = 9}, end = {line = 18, character = 10}}}, + } + + test.expect_reference_locations(t, &source, locations[:]) +} |