diff options
| author | gingerBill <bill@gingerbill.org> | 2021-05-16 14:44:02 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-05-16 14:44:02 +0100 |
| commit | 6ef96d33003d2fbdedd283ea432e70afc2f1d7ec (patch) | |
| tree | 785fee0309dea6a1f9c786a626ee2ed3541fca9c /src/check_stmt.cpp | |
| parent | 2e633f57a065b09c9b0c7ad16f393762475a308a (diff) | |
Improve untyped to typed logic for aiding the backend
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 2c9d8e00e..ee60a4acd 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1621,7 +1621,11 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) { } else { for (isize i = 0; i < result_count; i++) { Entity *e = pt->results->Tuple.variables[i]; - check_assignment(ctx, &operands[i], e->type, str_lit("return statement")); + Operand *o = &operands[i]; + check_assignment(ctx, o, e->type, str_lit("return statement")); + if (is_type_untyped(o->type)) { + update_expr_type(ctx, o->expr, e->type, true); + } } } case_end; |