mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-15 23:54:07 +00:00
Correct update propagation of type for ternary if expressions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user