File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 3
3
> ** Note** \
4
4
> This is in reverse chronological order, so newer entries are added to the top.
5
5
6
+ ## Swift 5.10
7
+
8
+ * [ SE-0411] [ ] :
9
+
10
+ Default value expressions can now have the same isolation as the enclosing
11
+ function or the corresponding stored property:
12
+
13
+ ``` swift
14
+ @MainActor
15
+ func requiresMainActor () -> Int { ... }
16
+
17
+ class C {
18
+ @MainActor
19
+ var x: Int = requiresMainActor ()
20
+ }
21
+
22
+ @MainActor func defaultArg (value : Int = requiresMainActor ()) { ... }
23
+ ```
24
+
25
+ For isolated default values of stored properties, the implicit initialization
26
+ only happens in the body of an ` init ` with the same isolation. This closes
27
+ an important data-race safety hole where global-actor-isolated default values
28
+ could inadvertently run synchronously from outside the actor.
29
+
6
30
## Swift 5.9.2
7
31
8
32
* [ SE-0407] [ ] :
@@ -9846,6 +9870,7 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
9846
9870
[SE- 0394 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0394-swiftpm-expression-macros.md
9847
9871
[SE- 0397 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0397-freestanding-declaration-macros.md
9848
9872
[SE- 0407 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0407-member-macro-conformances.md
9873
+ [SE- 0411 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0411-isolated-default-values.md
9849
9874
[#64927 ]: < https: // github.com/apple/swift/issues/64927>
9850
9875
[#42697 ]: < https: // github.com/apple/swift/issues/42697>
9851
9876
[#42728 ]: < https: // github.com/apple/swift/issues/42728>
You can’t perform that action at this time.
0 commit comments