From 7f61e53286581cac121386a0d9eaadc6b92ec816 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 7 Mar 2025 10:48:49 +0000 Subject: Fix #3955 --- src/check_expr.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/check_expr.cpp') 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)) { -- cgit v1.2.3