mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 22:58:46 +00:00
Disallow or_return within defer
This commit is contained in:
@@ -6891,6 +6891,10 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
|
|||||||
error(node, "'%.*s' can only be used within a procedure", LIT(name));
|
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;
|
return Expr_Expr;
|
||||||
case_end;
|
case_end;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user