From a2a0b83162bb96e2675b666b8ae6b8e5a5810721 Mon Sep 17 00:00:00 2001 From: misomosi Date: Wed, 1 Jul 2026 07:59:08 -0400 Subject: [PATCH] Allow casts to change mode for array programming --- src/check_expr.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 4709691c5..7969f8ce4 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -3926,6 +3926,11 @@ gb_internal void check_cast(CheckerContext *c, Operand *x, Type *type, bool forb } } + // In this case, the cast involves array programming + // so the operand needs to be a computed value + if (!is_type_array_like(x->type) && is_type_array_like(type)) { + x->mode = Addressing_Value; + } x->type = type; }