SE-0413: Typed throws

An alternative might be to specify the type not in the catch clause's pattern, but as an effect on the do block instead:

do throws(CatError) {
    try callCats()
} catch let myError { ... }

You might even be able to apply the typed throws effect to a catch-less do statement if you simply want to state the allowable error type explicitly.

15 Likes