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 @@ -22,6 +22,31 @@ Swift Next
2222Swift 5.5
2323---------
2424
25+ * [ SE-0313] [ ] :
26+
27+ Parameters of actor type can be declared as ` isolated ` , which means that they
28+ represent the actor on which that code will be executed. ` isolated ` parameters
29+ extend the actor-isolated semantics of the ` self ` parameter of actor methods
30+ to arbitrary parameters. For example:
31+
32+ ``` swift
33+ actor MyActor {
34+ func f () { }
35+ }
36+
37+ func g (actor : isolated MyActor) {
38+ actor.f () // okay, this code is always executing on "actor"
39+ }
40+
41+ func h (actor : MyActor) async {
42+ g (actor : actor) // error, call must be asynchronous
43+ await g (actor : actor) // okay, hops to "actor" before calling g
44+ }
45+ ```
46+
47+ The ` self ` parameter of actor methods are implicitly ` isolated ` . The
48+ ` nonisolated ` keyword makes the ` self ` parameter no longer ` isolated ` .
49+
2550* [ SR-14731] [ ] :
2651
2752 The compiler now correctly rejects the application of generic arguments to the
You can’t perform that action at this time.
0 commit comments