From ae1280d6f98d58426f5146e359b8b0ae1c9f750f Mon Sep 17 00:00:00 2001 From: misomosi Date: Wed, 1 Jul 2026 12:47:52 -0400 Subject: [PATCH] Convert untyped to variant type unconditionally --- src/check_expr.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 4709691c5..e184db924 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -5161,16 +5161,12 @@ gb_internal void convert_to_typed(CheckerContext *c, Operand *operand, Type *tar if (valid_count == 1) { Type *new_type = t->Union.variants[first_success_index]; - target_type = new_type; - if (is_type_union(new_type)) { - convert_to_typed(c, operand, new_type); - break; - } - operand->type = new_type; if (operand->mode != Addressing_Constant || - !elem_type_can_be_constant(operand->type)) { + !elem_type_can_be_constant(new_type)) { operand->mode = Addressing_Value; } + convert_to_typed(c, operand, new_type); + target_type = new_type; break; } else if (valid_count > 1) { ERROR_BLOCK();