File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public func withThrowingTimeout<T>(
8181private func _withThrowingTimeout< T> (
8282 isolation: isolated ( any Actor ) ? = #isolation,
8383 body: ( ) async throws -> sending T,
84- timeout: @Sendable @escaping ( ) async throws -> Void
84+ timeout: @Sendable @escaping ( ) async throws -> Never
8585) async throws -> Transferring < T > {
8686 try await withoutActuallyEscaping ( body) { escapingBody in
8787 let bodyTask = Task {
@@ -155,15 +155,14 @@ public func withThrowingTimeout<T>(
155155// Sendable
156156private func _withThrowingTimeout< T: Sendable > (
157157 body: @Sendable @escaping ( ) async throws -> T ,
158- timeout: @Sendable @escaping ( ) async throws -> Void
158+ timeout: @Sendable @escaping ( ) async throws -> Never
159159) async throws -> T {
160160 try await withThrowingTaskGroup ( of: T . self) { group in
161161 group. addTask {
162162 try await body ( )
163163 }
164164 group. addTask {
165165 try await timeout ( )
166- throw TimeoutError ( " expired " )
167166 }
168167 let success = try await group. next ( ) !
169168 group. cancelAll ( )
You can’t perform that action at this time.
0 commit comments