From 3bc8007c8135a9f47842bb100f1527793ef678f3 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:12:15 -0400 Subject: Correctly resolve bit_set union and intersections with comp lits --- src/server/analysis.odin | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/server') diff --git a/src/server/analysis.odin b/src/server/analysis.odin index b63c89b..e001294 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -2760,6 +2760,13 @@ resolve_binary_expression :: proc(ast_context: ^AstContext, binary: ^ast.Binary_ } if !ok_a || !ok_b { + // we return the type that was correctly resolved, if one of them was + if ok_a { + return symbol_a, true + } + if ok_b { + return symbol_b, true + } return {}, false } @@ -2778,6 +2785,13 @@ resolve_binary_expression :: proc(ast_context: ^AstContext, binary: ^ast.Binary_ } if !ok_a || !ok_b { + // we return the type that was correctly resolved, if one of them was + if ok_a { + return symbol_a, true + } + if ok_b { + return symbol_b, true + } return {}, false } @@ -2819,7 +2833,6 @@ resolve_binary_expression :: proc(ast_context: ^AstContext, binary: ^ast.Binary_ return symbol_b, true } - //Otherwise just choose the first type, we do not handle error cases - that is done with the checker return symbol_a, ok_a } -- cgit v1.2.3