Skip to content

Commit c950ffa

Browse files
committed
Add ChangeLog entry for SE-0313, which is now implemented.
1 parent b1b64df commit c950ffa

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,31 @@ Swift Next
2222
Swift 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

0 commit comments

Comments
 (0)