Skip to content

Commit 72e03b7

Browse files
committed
SE-0343 Update changelog for async top-level
1 parent 3321c32 commit 72e03b7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
55

66
## Swift 5.7
77

8+
* [SE-0343][]:
9+
10+
Top-level scripts support asynchronous calls.
11+
12+
Using an `await` by calling an asynchronous function or accessing an isolated
13+
variable transitions the top-level to an asynchronous context. As an
14+
asynchronous context, top-level variables are `@MainActor`-isolated and the
15+
top-level is run on the `@MainActor`.
16+
17+
Note that the transition affects function overload resolution and starts an
18+
implicit run loop to drive the concurrency machinery.
19+
20+
Unmodified scripts are not affected by this change unless `-warn-concurrency` is
21+
passed to the compiler invocation. With `-warn-concurrency`, variables in the
22+
top-level are isolated to the main actor and the top-level context is isolated
23+
to the main actor, but is not an asynchronous context.
24+
825
* [SE-0336][]:
926

1027
It is now possible to declare `distributed actor` and `distributed func`s inside of them.
@@ -9065,6 +9082,7 @@ Swift 1.0
90659082
[SE-0335]: <https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md>
90669083
[SE-0341]: <https://github.com/apple/swift-evolution/blob/main/proposals/0341-opaque-parameters.md>
90679084
[SE-0336]: <https://github.com/apple/swift-evolution/blob/main/proposals/0336-distributed-actor-isolation.md>
9085+
[SE-0343]: <https://github.com/apple/swift-evolution/blob/main/proposals/0343-top-level-concurrency.md>
90689086

90699087
[SR-75]: <https://bugs.swift.org/browse/SR-75>
90709088
[SR-106]: <https://bugs.swift.org/browse/SR-106>

0 commit comments

Comments
 (0)