Prevent statements after branch statements.

This commit is contained in:
Ginger Bill
2017-09-24 14:58:15 +01:00
parent 96bf6a5bcb
commit 572ac616c1
+4
View File
@@ -32,6 +32,10 @@ void check_stmt_list(Checker *c, Array<AstNode *> stmts, u32 flags) {
case AstNode_ReturnStmt:
error(n, "Statements after this `return` are never executed");
break;
case AstNode_BranchStmt:
error(n, "Statements after this `%.*s` are never executed", LIT(n->BranchStmt.token.string));
break;
}
}