mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-29 17:34:34 +00:00
Disallow or_return within defer
This commit is contained in:
@@ -6890,6 +6890,10 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
|
||||
if (c->curr_proc_sig == nullptr) {
|
||||
error(node, "'%.*s' can only be used within a procedure", LIT(name));
|
||||
}
|
||||
|
||||
if (c->in_defer) {
|
||||
error(rs->token, "'or_return' cannot be used within a defer statement");
|
||||
}
|
||||
|
||||
return Expr_Expr;
|
||||
case_end;
|
||||
|
||||
Reference in New Issue
Block a user