aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-01-16 11:45:15 +0000
committergingerBill <bill@gingerbill.org>2023-01-16 11:45:15 +0000
commitd55248ab0ffcf796cfdc4961e813e69b2c71b723 (patch)
treeb40c801846283807b7ad50ddbac677231d98fbc7 /src
parent68b2d4b9e243d40a8e488f5f623532a46a53fb3a (diff)
Fix #2301
Diffstat (limited to 'src')
-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 ff74a2547..491114344 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -7535,7 +7535,7 @@ gb_internal ExprKind check_ternary_if_expr(CheckerContext *c, Operand *o, Ast *n
o->mode = Addressing_Value;
o->expr = node;
- if (type_hint != nullptr && is_type_untyped(o->type)) {
+ if (type_hint != nullptr && is_type_untyped(o->type) && !is_type_any(type_hint)) {
if (check_cast_internal(c, &x, type_hint) &&
check_cast_internal(c, &y, type_hint)) {
convert_to_typed(c, o, type_hint);