Correct update propagation of type for ternary if expressions

This commit is contained in:
gingerBill
2021-10-22 13:14:19 +01:00
parent 1405420935
commit 48de1a01a9
4 changed files with 30 additions and 15 deletions

View File

@@ -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);
}