aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-11 16:25:16 -0400
committerGitHub <noreply@github.com>2025-08-11 16:25:16 -0400
commit03cbe19af2b3c74519be11c4de220eb9d36fa90d (patch)
tree5126d54e818ba597a15b35e447bfc491d44e8f80
parent55acd3fe129551dd0ce231390f8d07a446754efe (diff)
parentea35f53bb5f972aa417c58160d80ff357b4b597b (diff)
Merge pull request #854 from BradLewis/fix/binary-expr-not-eq
Add missing binary expr operators
-rw-r--r--src/server/analysis.odin2
-rw-r--r--tests/hover_test.odin36
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