Where are currently using the following pattern in the project:
func foo() {
// some logic
guard condition else { return assertationFailure("message") }
guard condition else { return logError(SomeError("message")) }
}
It is ok for a void function to return the result of another void function. But in the sample provided by @wadetregaskis it is undesirable because of mutex.lock()
.
While I can imagine a warning emitted by compiler with the help of something like ~Escapable Types but on a value level (aka ~escapable returned Void value), it is not a solution that can be taken seriously. So the question is: what is the right way to get diagnostic warnings in such situations.