From 3e31055ca7dbfa42998f7f6b42c45d15b967622e Mon Sep 17 00:00:00 2001 From: ske Date: Sat, 10 Jan 2026 10:46:53 -0300 Subject: [PATCH] Fix regression in #6118 --- src/check_expr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 2b2ae09cc..98185b0d3 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -3528,7 +3528,7 @@ gb_internal bool check_cast_internal(CheckerContext *c, Operand *x, Type *type) if (core_type(bt)->kind == Type_Basic) { return check_representable_as_constant(c, x->value, type, &x->value) || (is_type_pointer(type) && check_is_castable_to(c, x, type)); - } else if (!are_types_identical(elem, bt) && elem->kind == Type_Basic) { + } else if (!are_types_identical(elem, bt) && elem->kind == Type_Basic && x->type->kind == Type_Basic) { return check_representable_as_constant(c, x->value, elem, &x->value) || (is_type_pointer(elem) && check_is_castable_to(c, x, elem)); } else if (check_is_castable_to(c, x, type)) {