Thank you for this proposal @grynspan! I think this will be a great usability enhancement to the #expect(throws:)
family of macros.
The topic of typed throws came up again while we were discussing this proposal offline. As @Jnosh mentioned above, that language feature could potentially be very useful so that the type of expected errors could be enforced statically, but as the proposal draft mentions, we don't want to break source compatibility for the common use case of APIs which are plain throws
. However, we discussed some ideas which may eventually allow adoption of typed throws in a way that only applies to the APIs with explicitly-specified thrown error types. Given that, I suggested the topic be moved from an "Alternative considered" to a "Future direction" in the proposal text.
There was no other significant feedback, and this proposal is accepted.