<< §5.4.(b) No side effects | ↑ Table of Contents ↑ | §5.4.1 Regular guards >> |
§5.4.(c) Exceptions
A guard predicate should not throw any exceptions.
Yet, any exception thrown within a guard predicate cause the guard to evaluate to false
rather than propagating the exception, meaning that the evaluation of a guard predicate will never
interrupt the current base behaviour.
A compiler should flag any checked exception that is thrown within a guard.
Such diagnosis should by default be treated as an error, with the option of configuring
its severity to warning or ignore.
<< §5.4.(b) No side effects | ↑ Table of Contents ↑ | §5.4.1 Regular guards >> |