Skip to content

Commit 55e8ec1

Browse files
committed
Correct the difference between throwing/nonthrowing.
Per tech review from @jckarter
1 parent 5395d62 commit 55e8ec1

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

stdlib/public/Concurrency/CheckedContinuation.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ extension CheckedContinuation {
252252
}
253253
}
254254

255-
/// Calls the given closure with a checked continuation.
255+
/// Suspends the current task,
256+
/// then calls the given closure with a checked continuation for the current task.
256257
///
257258
/// - Parameters:
258259
/// - function: A string identifying the declaration that is the notional
@@ -270,7 +271,8 @@ public func withCheckedContinuation<T>(
270271
}
271272
}
272273

273-
/// Calls the given throwing closure with a checked continuation.
274+
/// Suspends the current task,
275+
/// then calls the given closure with a checked throwing continuation for the current task.
274276
///
275277
/// - Parameters:
276278
/// - function: A string identifying the declaration that is the notional
@@ -279,8 +281,8 @@ public func withCheckedContinuation<T>(
279281
/// - body: A closure that takes an `UnsafeContinuation` parameter.
280282
/// The closure must resume the continuation exactly once.
281283
///
282-
/// If the closure throws an error,
283-
/// this function rethrows that error.
284+
/// If the closure calls `resume(throwing:)` on the continuation,
285+
/// this method thows that error.
284286
@available(SwiftStdlib 5.5, *)
285287
public func withCheckedThrowingContinuation<T>(
286288
function: String = #function,

stdlib/public/Concurrency/PartialAsyncTask.swift

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,16 @@ internal func _resumeUnsafeThrowingContinuationWithError<T>(
235235

236236
#endif
237237

238-
/// Calls the given closure with an unsafe continuation
239-
/// and returns its result.
238+
/// Suspends the current task,
239+
/// then calls the given closure with the an unsafe continuation for the current task.
240240
///
241241
/// - Parameter fn: A closure that takes an `UnsafeContinuation` parameter.
242242
/// The closure must resume the continuation exactly once.
243243
///
244244
/// - Returns: The value passed to the continuation by the closure.
245245
///
246-
/// The continuation won't start executing until the operation function returns.
247-
/// ◊TR: What does this mean?
246+
/// If the closure calls `resume(throwing:)` on the continuation,
247+
/// this method thows that error.
248248
@available(SwiftStdlib 5.5, *)
249249
@_alwaysEmitIntoClient
250250
public func withUnsafeContinuation<T>(
@@ -255,16 +255,13 @@ public func withUnsafeContinuation<T>(
255255
}
256256
}
257257

258-
/// Calls the given closure with an unsafe continuation
259-
/// and returns its result or throws its error.
258+
/// Suspends the current task,
259+
/// then calls the given closure with the an unsafe throwing continuation for the current task.
260260
///
261261
/// - Parameter fn: A closure that takes an `UnsafeContinuation` parameter.
262262
/// The closure must resume the continuation exactly once.
263263
///
264264
/// - Returns: The value passed to the continuation by the closure.
265-
///
266-
/// The continuation won't start executing until the operation function returns.
267-
/// ◊TR: What does this mean?
268265
@available(SwiftStdlib 5.5, *)
269266
@_alwaysEmitIntoClient
270267
public func withUnsafeThrowingContinuation<T>(

0 commit comments

Comments
 (0)