Typed throws doesn't infer error type for do/catch block #75260
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
Typed throws seems to presume a do/catch block rethrowing the error it caught, is always throwing
any Error, when in fact it may know the type of the thrown error.Reproduction
(Same behavior with FullTypedThrows enabled)
Expected behavior
This should compile — the inner
doblock can only throwE, and therefore the outercatchblock can only throwEEnvironment
swift-driver version: 1.111.2 Apple Swift version 6.0 (swiftlang-6.0.0.5.15 clang-1600.0.22.6)
Target: arm64-apple-macosx14.0
Additional information
No response
The text was updated successfully, but these errors were encountered: