aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-06-20 11:44:00 +0100
committergingerBill <bill@gingerbill.org>2024-06-20 11:44:00 +0100
commit56383e45a7441fc789cd44c5e0dbaf9b2079a0f1 (patch)
tree8cf30a1aa9b3bf1ca35cdfddaff7c855cc00ba1a /src/check_expr.cpp
parent7184792f7ab31fcea9b892ece42440b3b225f414 (diff)
Fix #3768
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index e548eac88..a605957bb 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -2606,6 +2606,11 @@ gb_internal void check_unary_expr(CheckerContext *c, Operand *o, Token op, Ast *
if (o->mode == Addressing_Constant) {
Type *type = base_type(o->type);
if (!is_type_constant_type(o->type)) {
+ if (is_type_array_like(o->type)) {
+ o->mode = Addressing_Value;
+ return;
+ }
+
gbString xt = type_to_string(o->type);
gbString err_str = expr_to_string(node);
error(op, "Invalid type, '%s', for constant unary expression '%s'", xt, err_str);