aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/analysis.odin2
-rw-r--r--tests/hover_test.odin13
2 files changed, 15 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 723ec85..80370d9 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -3113,6 +3113,8 @@ resolve_binary_expression :: proc(ast_context: ^AstContext, binary: ^ast.Binary_
type = .Bool,
}
return symbol_a, true
+ case .Shl, .Shr:
+ return resolve_type_expression(ast_context, binary.left)
}
if expr, ok := binary.left.derived.(^ast.Binary_Expr); ok {
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 282ffb7..06d3dce 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -5703,6 +5703,19 @@ ast_hover_function_call_with_parens :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.bar: bool")
}
+
+@(test)
+ast_hover_bitshift_integer_type :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ main :: proc() {
+ foo: u16
+ b{*}ar := 6 << foo
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.bar: int")
+}
/*
Waiting for odin fix