Negated type patterns in `catch`
Swift Forums
Negated type patterns in `catch`
Has anyone else wanted a negated type pattern in catch? I couldn't find an earlier thread on this. Particularly since the introduction of typed-throws (SE-0413) I find myself often writing a forwarding clause when a do body mixes typed and untyped throws. func fn() throws(MyError) { do { try someTypedThrows() // throws(MyError) try someUntypedThrows() } catch let error as MyError { throw error // making sure it doesn't end up wrapped in .unhandled } catch { throw...
0 comments
No comments yet.