aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-12-15 09:42:08 +0000
committergingerBill <gingerBill@users.noreply.github.com>2025-12-15 09:42:08 +0000
commit56876e32da90606671354216ed2fb273b158cc50 (patch)
treea0bf8f868e7242f2016a0b6983c6cd26761c3e3c
parentfc51998e35d540af2575a102d4ec2e122b4fd928 (diff)
Present constant array arithmetic error correctly
-rw-r--r--src/check_expr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 470290d49..5fae9ffc2 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -4390,6 +4390,10 @@ gb_internal void check_binary_expr(CheckerContext *c, Operand *x, Ast *node, Typ
return;
}
+ if (c->proc_name == "main") {
+ gb_printf_err("HERE! 1 %s\n", type_to_string(x->type));
+ }
+
if (op.kind == Token_Quo && is_type_integer(x->type)) {
op.kind = Token_QuoEq; // NOTE(bill): Hack to get division of integers
}
@@ -4451,7 +4455,7 @@ gb_internal void check_binary_expr(CheckerContext *c, Operand *x, Ast *node, Typ
break;
}
}
- } else {
+ } else if (!is_type_array_like(x->type)) {
x->value = exact_binary_operator_value(op.kind, a, b);
}