@@ -5,6 +5,23 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
5
5
6
6
## Swift 5.7
7
7
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
+
8
25
* [ SE-0336] [ ] :
9
26
10
27
It is now possible to declare ` distributed actor ` and ` distributed func ` s inside of them.
@@ -9065,6 +9082,7 @@ Swift 1.0
9065
9082
[SE- 0335 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md>
9066
9083
[SE- 0341 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0341-opaque-parameters.md>
9067
9084
[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>
9068
9086
9069
9087
[SR- 75 ]: < https: // bugs.swift.org/browse/SR-75>
9070
9088
[SR- 106 ]: < https: // bugs.swift.org/browse/SR-106>
0 commit comments