Result.init(catching:)
doesn't infer typed throw but instead falls back to any Error
#80193
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
While working with typed throws, I found that the Result.init(catching:) doesn't infer the typed error. But its signature implies that it should.
This issue might be related to other
typed throws
issues like #75430 or #69985.Reproduction
Expected behavior
In this example, I expect the inferred result type to be
Result<(), MyServiceError>
.Environment
swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx15.0
Additional information
Reproducible in Xcode playground + Swift REPL.
The text was updated successfully, but these errors were encountered: