@@ -48,7 +48,7 @@ public func withThrowingTimeout<T>(
4848 try await _withThrowingTimeout ( isolation: isolation, body: body) {
4949 try await Task . sleep ( nanoseconds: UInt64 ( seconds * 1_000_000_000 ) )
5050 throw TimeoutError ( " Task timed out before completion. Timeout: \( seconds) seconds. " )
51- } . value
51+ }
5252}
5353
5454@available ( macOS 13 . 0 , iOS 16 . 0 , tvOS 16 . 0 , watchOS 9 . 0 , * )
@@ -62,7 +62,7 @@ public func withThrowingTimeout<T, C: Clock>(
6262 try await _withThrowingTimeout ( isolation: isolation, body: body) {
6363 try await Task . sleep ( until: instant, tolerance: tolerance, clock: clock)
6464 throw TimeoutError ( " Task timed out before completion. Deadline: \( instant) . " )
65- } . value
65+ }
6666}
6767
6868@available ( macOS 13 . 0 , iOS 16 . 0 , tvOS 16 . 0 , watchOS 9 . 0 , * )
@@ -75,14 +75,14 @@ public func withThrowingTimeout<T>(
7575 try await _withThrowingTimeout ( isolation: isolation, body: body) {
7676 try await Task . sleep ( until: instant, tolerance: tolerance, clock: ContinuousClock ( ) )
7777 throw TimeoutError ( " Task timed out before completion. Deadline: \( instant) . " )
78- } . value
78+ }
7979}
8080
8181private func _withThrowingTimeout< T> (
8282 isolation: isolated ( any Actor ) ? = #isolation,
8383 body: ( ) async throws -> sending T,
8484 timeout: @Sendable @escaping ( ) async throws -> Never
85- ) async throws -> Transferring < T > {
85+ ) async throws -> sending T {
8686 try await withoutActuallyEscaping ( body) { escapingBody in
8787 let bodyTask = Task {
8888 defer { _ = isolation }
@@ -106,7 +106,7 @@ private func _withThrowingTimeout<T>(
106106 } else {
107107 return try bodyResult. get ( )
108108 }
109- }
109+ } . value
110110}
111111
112112private struct Transferring < Value> : Sendable {
0 commit comments