aboutsummaryrefslogtreecommitdiff
path: root/src/AstGen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-04-24 14:41:27 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-04-24 14:41:27 -0700
commit15e891823e34ad57ccc5f1636323c5b7e718d44f (patch)
tree2ead1b5aca5e8c5745f0e631e635493cd7e02aff /src/AstGen.zig
parent15922069651ce964b6d12b9ad83ae02aa2266e89 (diff)
downloadzig-15e891823e34ad57ccc5f1636323c5b7e718d44f.tar.gz
zig-15e891823e34ad57ccc5f1636323c5b7e718d44f.zip
AstGen: parser ensures all suspend have blocks
See #8603.
Diffstat (limited to 'src/AstGen.zig')
-rw-r--r--src/AstGen.zig8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/AstGen.zig b/src/AstGen.zig
index 1954b10089..0f77c45767 100644
--- a/src/AstGen.zig
+++ b/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);