diff options
| author | gingerBill <bill@gingerbill.org> | 2025-03-07 10:48:49 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2025-03-07 10:48:49 +0000 |
| commit | 7f61e53286581cac121386a0d9eaadc6b92ec816 (patch) | |
| tree | d9f98115b366d6034be4d85445223227b0b49202 /src/check_expr.cpp | |
| parent | 97eeb25adc68fbc0ad797f4a2a1e701c909b2265 (diff) | |
Fix #3955
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 287fbb37d..6fba64765 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -3670,6 +3670,11 @@ gb_internal bool check_transmute(CheckerContext *c, Ast *node, Operand *o, Type } gb_internal bool check_binary_array_expr(CheckerContext *c, Token op, Operand *x, Operand *y) { + if (is_type_array_like(x->type) || is_type_array_like(y->type)) { + if (op.kind == Token_CmpAnd || op.kind == Token_CmpOr) { + error(op, "Array programming is not allowed with the operator '%.*s'", LIT(op.string)); + } + } if (is_type_array(x->type) && !is_type_array(y->type)) { if (check_is_assignable_to(c, y, x->type)) { if (check_binary_op(c, x, op)) { |