aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2026-01-10 18:48:15 +0000
committerGitHub <noreply@github.com>2026-01-10 18:48:15 +0000
commit3345ed0622954abc1bb5a781445c152735661bb6 (patch)
tree30554594ec1a8ffd91c1560536b3697c4bf8d6da
parente88776e00fbb6dec367b2cb54d764c9a52edc15a (diff)
parent3e31055ca7dbfa42998f7f6b42c45d15b967622e (diff)
Merge pull request #6120 from ske2004/fix-regression-6118
Fix regression for #6118 in #6104
-rw-r--r--src/check_expr.cpp2
1 files changed, 1 insertions, 1 deletions
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)) {