diff options
| author | gingerBill <bill@gingerbill.org> | 2021-10-22 13:14:19 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-10-22 13:14:19 +0100 |
| commit | 48de1a01a9bc5cdc2edda363681455078bae3e52 (patch) | |
| tree | 646515681912d3d27fa1f682ed60c2ab1d249faf /src/check_stmt.cpp | |
| parent | 1405420935ea2a343c8bb50ed243a4568aa217c1 (diff) | |
Correct update propagation of type for ternary if expressions
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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); } |