Skip to content

Conversation

@hborla
Copy link
Member

@hborla hborla commented Sep 29, 2023

  • Explanation: This change fills a number of known holes and bugs in the static data-race-safety checking, including:
    • An issue where a nonisolated initializer of a subclass could invoke global-actor-isolated properties in the superclass.
    • An issue with Sendable checking for function references where parameter and result types were Sendable-checked at the point of partial application when there was no function conversion. Sendability of function references depends only on captures, and applies when the function itself is passed across isolation boundaries. Parameter and result values can only cross isolation boundaries when the function is called, so they shouldn't be checked when checking a reference for Sendable violations.
    • Diagnose Sendable violations in captures of local functions, which were previously completely unchecked.
    • Correctness issues / false positives with the diagnostics for erasing actor-isolation via function conversions

This change also includes a minor refactoring to consolidate the representation of actor isolation across function declarations and closures.

…nt'.

This commit is NFC; it's mostly renames.

(cherry picked from commit a6d078b)
…ties

from nonisolated subclass initializers.

(cherry picked from commit 90ccc75)
nonisolated closure in an actor-isolated context.

(cherry picked from commit 9b16d47)
…rences for

Sendability.

Sendability of function references depends only on captures, and applies when the
function itself is passed across isolation boundaries. Parameter and result
values can only cross isolation boundaries when the function is called.

(cherry picked from commit 553fe45)
getClosureActorIsolation.

This is preparation for changing AbstractClosureExpr to store
ActorIsolation instead of ClosureActorIsolation, and convert to
ClosureActorIsolation when needed to allow incrementally updating
callers. This change is NFC.

(cherry picked from commit 4b23564)
ClosureActorIsolation.

(cherry picked from commit 54f5fef)
…ghout

the isolation query APIs.

(cherry picked from commit 97f1e61)
…versions

to impact constraint solving.

(cherry picked from commit 2e9c64d)
Now that there's only one call-site of `safeToDropGlobalActor`, it doesn't
need to be exposed in the ActorIsolation header, and it doesn't need to
avoid `warnUntilSwiftVersion` to match constraint system diagnostics.

(cherry picked from commit 2fb14ce)
@hborla hborla requested a review from a team as a code owner September 29, 2023 01:33
@hborla
Copy link
Member Author

hborla commented Sep 29, 2023

@swift-ci please test

@hborla hborla merged commit df95779 into swiftlang:release/5.10 Sep 29, 2023
@hborla hborla deleted the 5.10-sendable-fixes branch September 29, 2023 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants