stage2: astgen for non-labeled blocks

This commit is contained in:
Andrew Kelley
2020-08-14 11:28:40 -07:00
parent 4adc052f0b
commit 5f7c7191ab
3 changed files with 20 additions and 4 deletions

View File

@@ -1343,7 +1343,7 @@ fn astGenAndAnalyzeDecl(self: *Module, decl: *Decl) !bool {
const body_block = body_node.cast(ast.Node.Block).?;
try astgen.blockExpr(self, params_scope, body_block);
_ = try astgen.blockExpr(self, params_scope, .none, body_block);
if (!fn_type.fnReturnType().isNoReturn() and (gen_scope.instructions.items.len == 0 or
!gen_scope.instructions.items[gen_scope.instructions.items.len - 1].tag.isNoReturn()))