mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-17 11:22:22 -07:00
Prevent statements after branch statements.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user