@@ -13,14 +13,14 @@ private enum TaskTimeLimit {
1313
1414 enum Event < Success: Sendable > {
1515
16- case taskFinished( Result < Success , Error > )
16+ case taskFinished( Result < Success , any Error > )
1717 case parentTaskCancelled
1818 case timeLimitExceeded
1919 }
2020}
2121
2222internal func withTimeLimit< C: Clock , Success: Sendable > ( // swiftlint:disable:this function_parameter_count
23- throwing timeLimitExceededError: @autoclosure ( ) -> Error ,
23+ throwing timeLimitExceededError: @autoclosure ( ) -> any Error ,
2424 after deadline: C . Instant ,
2525 tolerance: C . Instant . Duration ? ,
2626 clock: C ,
@@ -32,13 +32,15 @@ internal func withTimeLimit<C: Clock, Success: Sendable>( // swiftlint:disable:t
3232
3333 let result = await withTaskGroup (
3434 of: TaskTimeLimit . Event< Success> . self ,
35- returning: Result< Success, Error> . self ,
35+ returning: Result < Success , any Error > . self,
3636 isolation: isolation,
3737 body: { group in
3838 var transfer = transfer. take ( )
3939
4040 group. addTask ( priority: priority) {
4141 do {
42+ // Review after closure isolation control gets implemented
43+ // https://forums.swift.org/t/closure-isolation-control/70378
4244 let success = try await transfer. finalize ( ) ( )
4345 return . taskFinished( . success( success) )
4446 } catch {
0 commit comments