mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00: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:
|
case AstNode_ReturnStmt:
|
||||||
error(n, "Statements after this `return` are never executed");
|
error(n, "Statements after this `return` are never executed");
|
||||||
break;
|
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