From 48de1a01a9bc5cdc2edda363681455078bae3e52 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 22 Oct 2021 13:14:19 +0100 Subject: Correct update propagation of type for ternary if expressions --- src/check_stmt.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/check_stmt.cpp') diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 103ffa071..4dbc76578 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1728,6 +1728,8 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) { Entity *e = pt->results->Tuple.variables[i]; Operand *o = &operands[i]; check_assignment(ctx, o, e->type, str_lit("return statement")); + convert_to_typed(ctx, o, e->type); + if (is_type_untyped(o->type)) { update_untyped_expr_type(ctx, o->expr, e->type, true); } -- cgit v1.2.3