diff --git a/src/parsec.cpp b/src/parsec.cpp index 988bf351ee..b389400f58 100644 --- a/src/parsec.cpp +++ b/src/parsec.cpp @@ -985,6 +985,7 @@ static AstNode *trans_create_assign(Context *c, bool result_used, AstNode *block // _tmp child_block->data.block.statements.append(trans_create_node_symbol(c, tmp_var_name)); + child_block->data.block.last_statement_is_result_expression = true; return child_block; } diff --git a/test/parsec.zig b/test/parsec.zig index 54fd1c4c5d..23707ab9da 100644 --- a/test/parsec.zig +++ b/test/parsec.zig @@ -478,7 +478,7 @@ pub fn addCases(cases: &tests.ParseCContext) { \\ c = { \\ const _tmp = a; \\ b = _tmp; - \\ _tmp; + \\ _tmp \\ }; \\} );