From be1e889abbdafbbda4223611175dbc1d6e349073 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 19 Sep 2025 12:29:26 +0100 Subject: [PATCH] Remove debug message --- src/check_expr.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 0ea0952f9..18302efc3 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -3504,14 +3504,17 @@ gb_internal bool is_type_union_constantable(Type *type) { Type *bt = base_type(type); GB_ASSERT(bt->kind == Type_Union); - - if (bt->Union.variants.count <= 1) { + if (bt->Union.variants.count == 0) { return true; + } else if (bt->Union.variants.count == 1) { + return is_type_constant_type(bt->Union.variants[0]); } - // for (Type *v : bt->Union.variants) { - - // } + for (Type *v : bt->Union.variants) { + if (!is_type_constant_type(v)) { + return false; + } + } return false; } @@ -8175,9 +8178,6 @@ gb_internal ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *c // as it assumes it is determining the type AddressingMode old_mode = operand->mode; check_cast(c, operand, t); - if (old_mode == Addressing_Constant && old_mode != operand->mode) { - gb_printf_err("HERE: %d -> %d %s\n", old_mode, operand->mode, expr_to_string(operand->expr)); - } } } operand->type = t;