diff options
| author | Bradley Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-11 16:16:48 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-11 16:16:48 -0400 |
| commit | 55acd3fe129551dd0ce231390f8d07a446754efe (patch) | |
| tree | 3529baa929ad360af1922f786843160f1287065d /src | |
| parent | fa321af72d7b8c5614a5d9745b56e9df119f5842 (diff) | |
| parent | 3bc8007c8135a9f47842bb100f1527793ef678f3 (diff) | |
Merge pull request #853 from BradLewis/fix/resolve-bit-set-union-intersection
Correctly resolve bit_set union and intersections with comp lits
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/analysis.odin | 15 |
1 files changed, 14 insertions, 1 deletions
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 } |