Skip to content

Commit 008fd71

Browse files
authored
Merge pull request #41130 from kavon/changelog-se327-default-value
2 parents cb27114 + 822804c commit 008fd71

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,27 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
4242
Swift 5.6
4343
---------
4444

45+
* [SE-0327][]:
46+
47+
In Swift 5 mode, a warning is now emitted if the default-value expression of an
48+
instance-member property requires global-actor isolation. For example:
49+
50+
```swift
51+
@MainActor
52+
func partyGenerator() -> [PartyMember] { fatalError("todo") }
53+
54+
class Party {
55+
@MainActor var members: [PartyMember] = partyGenerator()
56+
// ^~~~~~~~~~~~~~~~
57+
// warning: expression requiring global actor 'MainActor' cannot
58+
// appear in default-value expression of property 'members'
59+
}
60+
```
61+
62+
Previously, the isolation granted by the type checker matched the isolation of
63+
the property itself, but at runtime that is not guaranteed. In Swift 6,
64+
such default-value expressions will become an error if they require isolation.
65+
4566
* Actor isolation checking now understands that `defer` bodies share the isolation of their enclosing function.
4667

4768
```swift
@@ -8936,6 +8957,7 @@ Swift 1.0
89368957
[SE-0322]: <https://github.com/apple/swift-evolution/blob/main/proposals/0322-temporary-buffers.md>
89378958
[SE-0324]: <https://github.com/apple/swift-evolution/blob/main/proposals/0324-c-lang-pointer-arg-conversion.md>
89388959
[SE-0323]: <https://github.com/apple/swift-evolution/blob/main/proposals/0323-async-main-semantics.md>
8960+
[SE-0327]: <https://github.com/apple/swift-evolution/blob/main/proposals/0327-actor-initializers.md>
89398961
[SE-0328]: <https://github.com/apple/swift-evolution/blob/main/proposals/0328-structural-opaque-result-types.md>
89408962
[SE-0331]: <https://github.com/apple/swift-evolution/blob/main/proposals/0331-remove-sendable-from-unsafepointer.md>
89418963
[SE-0337]: <https://github.com/apple/swift-evolution/blob/main/proposals/0337-support-incremental-migration-to-concurrency-checking.md>

0 commit comments

Comments
 (0)