Hopefully the to-be-squashed commit 35ab376 survives as a reference for the implementation.
The description of the issue is as follows:
if (A) {
stop("A is bad!")
} else {
warning("!A is worrying, but not catastrophic!")
}
Is a common pattern that could in principle be unnested:
if (A) {
stop("A is bad!")
}
warning("!A is worrying, but not catastrophic!")
But this format is a bit more awkward / doesn't leverage the clear if/else structure to make it clear what's happening.
We should do the following:
- Decide when exactly this reasoning applies. The example above is very clear, but what about if there's intervening code before/after
warning() in the latter branch?
- Decide how to expose this to users. In principle there could be two parameters to this function [1] "exit" calls like
stop()/q() that are guaranteed to terminate a branch [2] "signal" calls that can be "companion" calls to an "exit call", e.g. warning()