Skip to content

Commit 4ad1572

Browse files
authored
Update concurrency proposals that are implemented in Swift 5.10. (#2300)
1 parent 87bcc99 commit 4ad1572

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

proposals/0327-actor-initializers.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Proposal: [SE-0327](0327-actor-initializers.md)
44
* Authors: [Kavon Farvardin](https://github.com/kavon), [John McCall](https://github.com/rjmccall), [Konrad Malawski](https://github.com/ktoso)
55
* Review Manager: [Doug Gregor](https://github.com/DougGregor)
6-
* Status: **Accepted**
6+
* Status: **Implemented (Swift 5.10)**
77
* Decision Notes: [Acceptance](https://forums.swift.org/t/accepted-se-0327-on-actors-and-initialization/54587)
88
* Previous Discussions:
99
* [On Actor Initializers](https://forums.swift.org/t/on-actor-initializers/49001)
@@ -737,6 +737,8 @@ In the above, the only difference between the `init` and the `deinit` is that th
737737

738738
### Global-actor isolation and instance members
739739

740+
**Note:** The isolation rules in this section for stored property initial values was never implemented because it was too onerous in existing code patterns that make use of `@MainActor`-isolated types. These rules have been subsumed by [SE-0411: Isolated default values](/proposals/0411-isolated-default-values.md).
741+
740742
The main problem with global-actor isolation on the stored properties of a type is that, if the property is isolated to a global actor, then its default-value expression is also isolated to that actor. Since global-actor isolation can be applied independently to each stored property, an impossible isolation requirement can be constructed. The isolation needed for a type's non-delegating *and* non-async initializers would be the union of all isolation applied to its stored properties that have a default value. That's because a non-async initializer cannot hop to any executor, and a function cannot be isolated to two global actors. Currently, Swift 5.5 accepts programs with these impossible requirements.
741743

742744
To fix this problem, we propose to remove any isolation applied to the default-value expressions of stored properties that are a member of a nominal type. Instead, those expressions will be treated by the type system as being `nonisolated`. If isolation is required to initialize those properties, then an `init` can always be defined and given the appropriate isolation.

proposals/0411-isolated-default-values.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Proposal: [SE-0411](0411-isolated-default-values.md)
44
* Authors: [Holly Borla](https://github.com/hborla)
55
* Review Manager: [Doug Gregor](https://github.com/DougGregor)
6-
* Status: **Accepted**
6+
* Status: **Implemented (Swift 5.10)**
77
* Bug: *if applicable* [apple/swift#58177](https://github.com/apple/swift/issues/58177)
88
* Implementation: [apple/swift#68794](https://github.com/apple/swift/pull/68794)
99
* Upcoming Feature Flag: `IsolatedDefaultValues`

proposals/0412-strict-concurrency-for-global-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Proposal: [SE-0412](0412-strict-concurrency-for-global-variables.md)
44
* Authors: [John McCall](https://github.com/rjmccall), [Sophia Poirier](https://github.com/sophiapoirier)
55
* Review Manager: [Holly Borla](https://github.com/hborla)
6-
* Status: **Accepted**
6+
* Status: **Implemented (Swift 5.10)**
77
* Implementation: On `main` gated behind `-enable-experimental-feature GlobalConcurrency`
88
* Previous Proposals: [SE-0302](0302-concurrent-value-and-concurrent-closures.md), [SE-0306](0306-actors.md), [SE-0316](0316-global-actors.md), [SE-0337](0337-support-incremental-migration-to-concurrency-checking.md), [SE-0343](0343-top-level-concurrency.md)
99
* Review: ([pitch](https://forums.swift.org/t/pitch-strict-concurrency-for-global-variables/66908)), ([review](https://forums.swift.org/t/se-0412-strict-concurrency-for-global-variables/68352)), ([acceptance](https://forums.swift.org/t/accepted-se-0412-strict-concurrency-for-global-variables/69004))

0 commit comments

Comments
 (0)