diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-11 16:19:36 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-11 16:19:36 -0400 |
| commit | ea35f53bb5f972aa417c58160d80ff357b4b597b (patch) | |
| tree | 5126d54e818ba597a15b35e447bfc491d44e8f80 | |
| parent | 55acd3fe129551dd0ce231390f8d07a446754efe (diff) | |
Add missing binary expr operators
| -rw-r--r-- | src/server/analysis.odin | 2 | ||||
| -rw-r--r-- | tests/hover_test.odin | 36 |
2 files changed, 37 insertions, 1 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index e001294..4401d5b 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -2738,7 +2738,7 @@ resolve_binary_expression :: proc(ast_context: ^AstContext, binary: ^ast.Binary_ ok_a, ok_b: bool #partial switch binary.op.kind { - case .Cmp_Eq, .Gt, .Gt_Eq, .Lt, .Lt_Eq: + case .Cmp_Eq, .Gt, .Gt_Eq, .Lt, .Lt_Eq, .Not_Eq, .In, .Not_In: symbol_a.value = SymbolUntypedValue { type = .Bool, } diff --git a/tests/hover_test.odin b/tests/hover_test.odin index 916a247..46bd45c 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -3698,6 +3698,42 @@ ast_hover_bit_set_union :: proc(t: ^testing.T) { "test.foo_b: bit_set[Flag]\n// hover for foo_b" ) } + +@(test) +ast_hover_binary_expr_not_eq :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + + main :: proc() { + fo{*}o := 1 != 2 + } + `, + } + test.expect_hover( + t, + &source, + "test.foo: bool" + ) +} + +@(test) +ast_hover_bit_set_in :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + Foo :: enum {A, B} + + main :: proc() { + foos: bit_set[Foo] + f{*}oo := .A in foos + } + `, + } + test.expect_hover( + t, + &source, + "test.foo: bool" + ) +} /* Waiting for odin fix |