@@ -42,6 +42,27 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
42
42
Swift 5.6
43
43
---------
44
44
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
+
45
66
* Actor isolation checking now understands that ` defer ` bodies share the isolation of their enclosing function.
46
67
47
68
``` swift
@@ -8936,6 +8957,7 @@ Swift 1.0
8936
8957
[SE- 0322 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0322-temporary-buffers.md>
8937
8958
[SE- 0324 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0324-c-lang-pointer-arg-conversion.md>
8938
8959
[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>
8939
8961
[SE- 0328 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0328-structural-opaque-result-types.md>
8940
8962
[SE- 0331 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0331-remove-sendable-from-unsafepointer.md>
8941
8963
[SE- 0337 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0337-support-incremental-migration-to-concurrency-checking.md>
0 commit comments