This commit is contained in:
gingerBill
2025-03-07 10:48:49 +00:00
parent 97eeb25adc
commit 7f61e53286

View File

@@ -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)) {