I've been digging through the archives on the topic of typed throws, and it's unclear to me where it's at. There's been an interesting story arc over the ~eight years it's been in sporadic discussion, where various factors have shifted as Swift has evolved, and some of the key opponents seem to have became [begruding] proponents, e.g. @John_McCall, yet the latest thread I can find on it just petered out without a conclusion (and it's not in Swift 5.9, at least).
I guess I'm mostly asking the Swift core team where they think it's at. It seems like it never actually got to the stage of being formally proposed (no SE-xxxx)? So it's never been officially approved or rejected… but what's the core team's temperature? Is it worth someone finally doing the real proposal?
For reference, the prior threads I've found, in reverse chronological order:
- Precise error typing in Swift by @John_McCall.
- typed throws by @Chris_Lattner3.
- [Pitch] Typed throws by Anton Zhilin.
- Type-annotated throws by Félix Cloutier.
- Proposal: Allow Type Annotations on Throws by Anton Zhilin.
- Proposal: Allow Type Annotations on Throws by @owensd.
- Proposal: Typed throws by Russ Bishop.
- Type Inferencing For Error Handling (try catch blocks) by @Manav_Gabhawala.
It also came up incidentally in another thread, [Pitch] Rethrowing protocol conformances, where @Philippe_Hausler seemed to say he'd actually developed a prototype implementation.
@ExFalsoQuodlibet also mentioned it a couple of months ago in the context of anonymous type unions (Multiple Types).