Skip to content

Commit 3aa3ca2

Browse files
committed
Track 'release/5.5' to resolve merge conflict.
2 parents 464c4e0 + 7236b83 commit 3aa3ca2

File tree

12 files changed

+1253
-542
lines changed

12 files changed

+1253
-542
lines changed

lib/IDE/Refactoring.cpp

Lines changed: 258 additions & 61 deletions
Large diffs are not rendered by default.

lib/Sema/TypeCheckPropertyWrapper.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,11 @@ PropertyWrapperBackingPropertyTypeRequest::evaluate(
622622
if (!type)
623623
return Type();
624624

625+
// If the declaration came from a module file, there's no need to
626+
// compute the auxiliary variables.
627+
if (!var->getDeclContext()->getParentSourceFile())
628+
return type;
629+
625630
// Set the interface type of each synthesized declaration.
626631
auto auxiliaryVars = var->getPropertyWrapperAuxiliaryVariables();
627632
auxiliaryVars.backingVar->setInterfaceType(type);

stdlib/public/Concurrency/PartialAsyncTask.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import Swift
1414
@_implementationOnly import _SwiftConcurrencyShims
1515

1616
/// A unit of scheduleable work.
17+
///
18+
/// Unless you're implementing a scheduler,
19+
/// you don't generally interact with partial tasks directly.
1720
@available(SwiftStdlib 5.5, *)
1821
@frozen
1922
public struct PartialAsyncTask {

stdlib/public/Concurrency/Task.swift

Lines changed: 316 additions & 209 deletions
Large diffs are not rendered by default.

stdlib/public/Concurrency/TaskCancellation.swift

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ import Swift
1515

1616
// ==== Task Cancellation ------------------------------------------------------
1717

18-
/// Execute an operation with cancellation handler which will immediately be
19-
/// invoked if the current task is cancelled.
18+
/// Execute an operation with a cancellation handler that's immediately
19+
/// invoked if the current task is canceled.
2020
///
2121
/// This differs from the operation cooperatively checking for cancellation
2222
/// and reacting to it in that the cancellation handler is _always_ and
23-
/// _immediately_ invoked when the task is cancelled. For example, even if the
24-
/// operation is running code which never checks for cancellation, a cancellation
25-
/// handler still would run and give us a chance to run some cleanup code.
23+
/// _immediately_ invoked when the task is canceled. For example, even if the
24+
/// operation is running code that never checks for cancellation, a cancellation
25+
/// handler still runs and provides a chance to run some cleanup code.
2626
///
27-
/// Does not check for cancellation, and always executes the passed `operation`.
27+
/// Doesn't check for cancellation, and always executes the passed `operation`.
2828
///
29-
/// This function returns instantly and will never suspend.
29+
/// This function returns immediately and never suspends.
3030
@available(SwiftStdlib 5.5, *)
3131
public func withTaskCancellationHandler<T>(
3232
handler: @Sendable () -> (),
@@ -49,10 +49,10 @@ public func withTaskCancellationHandler<T>(
4949
@available(SwiftStdlib 5.5, *)
5050
extension Task {
5151

52-
/// Returns `true` if the task is cancelled, and should stop executing.
52+
/// A Boolean value that indicates whether
53+
/// the current task should stop executing.
5354
///
54-
/// If no current `Task` is available, returns `false`, as outside of a task
55-
/// context no task cancellation may be observed.
55+
/// If there is no current task, the value of this property is `false`.
5656
///
5757
/// - SeeAlso: `checkCancellation()`
5858
public static var isCancelled: Bool {
@@ -61,26 +61,17 @@ extension Task {
6161
}
6262
}
6363

64-
/// Returns `true` if the task is cancelled, and should stop executing.
64+
/// A Boolean value that indicates whether the task should stop executing.
6565
///
6666
/// - SeeAlso: `checkCancellation()`
6767
@available(*, deprecated, message: "Storing `Task` instances has been deprecated and will be removed soon. Use the static 'Task.isCancelled' instead.")
6868
public var isCancelled: Bool {
6969
_taskIsCancelled(_task)
7070
}
7171

72-
/// Check if the task is cancelled and throw an `CancellationError` if it was.
72+
/// Throws a cancellation error if the current task was canceled.
7373
///
74-
/// It is intentional that no information is passed to the task about why it
75-
/// was cancelled. A task may be cancelled for many reasons, and additional
76-
/// reasons may accrue / after the initial cancellation (for example, if the
77-
/// task fails to immediately exit, it may pass a deadline).
78-
///
79-
/// The goal of cancellation is to allow tasks to be cancelled in a
80-
/// lightweight way, not to be a secondary method of inter-task communication.
81-
///
82-
/// ### Suspension
83-
/// This function returns instantly and will never suspend.
74+
/// The error is always an instance of `Task.CancellationError`.
8475
///
8576
/// - SeeAlso: `isCancelled()`
8677
public static func checkCancellation() throws {
@@ -97,10 +88,12 @@ extension Task {
9788
try await withTaskCancellationHandler(handler: handler, operation: operation)
9889
}
9990

100-
/// The default cancellation thrown when a task is cancelled.
91+
/// The default error thrown by a canceled task.
10192
///
102-
/// This error is also thrown automatically by `Task.checkCancellation()`,
103-
/// if the current task has been cancelled.
93+
/// The `Task.checkCancellation()` method throws this error
94+
/// if the current task has been canceled.
95+
/// You can throw this error in your cancellation-checking code,
96+
/// or another more specific error if needed.
10497
public struct CancellationError: Error {
10598
// no extra information, cancellation is intended to be light-weight
10699
public init() {}

0 commit comments

Comments
 (0)