Open finestructure opened 2 months ago
For all other purposes, I've been using forceCastError
from Cast
. But
Capturing 'async let' variables is not supported
If you come up with better than explicit do/catch, please post it here!
do { return try await a }
catch { throw error as! AppError }
Description
According to SE-0413, async let should preserve the error type of typed throws.
However, this does not seem to be the case in Xcode 16.0 beta 6 (16A5230g).
Reproduction
fails to compile with
Expected behavior
try await a
should satisfythrows(AppError)
of the function.Environment
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2) Target: arm64-apple-macosx15.0
Additional information
No response