Often I'm faced with writing this code:
```
func handleError(error: Error) {}
var error: Error?
guard error == nil else {
handleError(error: error!)
return
}
```
which has an implicitly unwrapped optional and the `guard` enforces exiting. IUO's tend to cause bugs though, so it's generally best to avoid them even if in this case it will clearly always work.
The only alternative I know is:
```
func handleError(error: Error) {}
var error: Error?
if let error = error {
handleError(error: error)
return // not enforced
}
```
which nicely unwraps the optional, but does not force the exit.
Is there a way to both enforce the exit behavior and avoid the implicitly unwrapped optional?
Basically a `! let`, perhaps with different syntax, that could be used like:
```
guard ! let error = error else {
handleError(error: error)
return
}
```