Commit 15e891823e

Andrew Kelley <andrew@ziglang.org>
2021-04-24 23:41:27
AstGen: parser ensures all suspend have blocks
See #8603.
1 parent 1592206
Changed files (1)
src/AstGen.zig
@@ -928,13 +928,7 @@ pub fn suspendExpr(
             try astgen.errNoteNode(gz.suspend_node, "other suspend block here", .{}),
         });
     }
-    if (body_node == 0) {
-        // Accepted proposal to remove block-less suspend from the language:
-        // https://github.com/ziglang/zig/issues/8603
-        // TODO: simplify the parser and make this an assert instead of
-        // a compile error.
-        return astgen.failNode(node, "suspend without a block", .{});
-    }
+    assert(body_node != 0);
 
     const suspend_inst = try gz.addBlock(.suspend_block, node);
     try gz.instructions.append(gpa, suspend_inst);