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 33> ** Note** \
44> This is in reverse chronological order, so newer entries are added to the top.
55
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+
630## Swift 5.9.2
731
832* [ SE-0407] [ ] :
@@ -9846,6 +9870,7 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
98469870[SE- 0394 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0394-swiftpm-expression-macros.md
98479871[SE- 0397 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0397-freestanding-declaration-macros.md
98489872[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
98499874[#64927 ]: < https: // github.com/apple/swift/issues/64927>
98509875[#42697 ]: < https: // github.com/apple/swift/issues/42697>
98519876[#42728 ]: < https: // github.com/apple/swift/issues/42728>
You can’t perform that action at this time.
0 commit comments