Skip to content

Commit 5c1e32e

Browse files
committed
Add ChangeLog entry for SE-0313, which is now implemented.
1 parent 81d191c commit 5c1e32e

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
@@ -29,6 +29,31 @@ CHANGELOG
2929
Swift 5.5
3030
---------
3131

32+
* [SE-0313][]:
33+
34+
Parameters of actor type can be declared as `isolated`, which means that they
35+
represent the actor on which that code will be executed. `isolated` parameters
36+
extend the actor-isolated semantics of the `self` parameter of actor methods
37+
to arbitrary parameters. For example:
38+
39+
```swift
40+
actor MyActor {
41+
func f() { }
42+
}
43+
44+
func g(actor: isolated MyActor) {
45+
actor.f() // okay, this code is always executing on "actor"
46+
}
47+
48+
func h(actor: MyActor) async {
49+
g(actor: actor) // error, call must be asynchronous
50+
await g(actor: actor) // okay, hops to "actor" before calling g
51+
}
52+
```
53+
54+
The `self` parameter of actor methods are implicitly `isolated`. The
55+
`nonisolated` keyword makes the `self` parameter no longer `isolated`.
56+
3257
* [SR-14731][]:
3358

3459
The compiler now correctly rejects the application of generic arguments to the

0 commit comments

Comments
 (0)