You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+52-52Lines changed: 52 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -107,54 +107,54 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
107
107
108
108
*[SE-0343][]:
109
109
110
-
Top-level scripts support asynchronous calls.
110
+
Top-level scripts support asynchronous calls.
111
111
112
-
Using an `await` by calling an asynchronous function or accessing an isolated
113
-
variable transitions the top-level to an asynchronous context. As an
114
-
asynchronous context, top-level variables are `@MainActor`-isolated and the
115
-
top-level is run on the `@MainActor`.
112
+
Using an `await` by calling an asynchronous function or accessing an isolated
113
+
variable transitions the top-level to an asynchronous context. As an
114
+
asynchronous context, top-level variables are `@MainActor`-isolated and the
115
+
top-level is run on the `@MainActor`.
116
116
117
-
Note that the transition affects function overload resolution and starts an
118
-
implicit run loop to drive the concurrency machinery.
117
+
Note that the transition affects function overload resolution and starts an
118
+
implicit run loop to drive the concurrency machinery.
119
119
120
-
Unmodified scripts are not affected by this change unless `-warn-concurrency` is
121
-
passed to the compiler invocation. With `-warn-concurrency`, variables in the
122
-
top-level are isolated to the main actor and the top-level context is isolated
123
-
to the main actor, but is not an asynchronous context.
120
+
Unmodified scripts are not affected by this change unless `-warn-concurrency` is
121
+
passed to the compiler invocation. With `-warn-concurrency`, variables in the
122
+
top-level are isolated to the main actor and the top-level context is isolated
123
+
to the main actor, but is not an asynchronous context.
124
124
125
125
*[SE-0336][]:
126
126
127
-
It is now possible to declare `distributed actor` and `distributed func`s inside of them.
127
+
It is now possible to declare `distributed actor` and `distributed func`s inside of them.
128
128
129
-
Distributed actors provide stronger isolation guarantees than "local" actors, and enable additional checks to be made on return types and parameters of distributed methods, e.g. checking if they conform to `Codable`. Distributed methods can be called on "remote" references of distributed actors, turning those invocations into remote procedure calls, by means of pluggable and user extensible distributed actor system implementations.
130
-
131
-
Swift does not provide any specific distributed actor system by itself, however, packages in the ecosystem fulfil the role of providing those implementations.
132
-
133
-
```swift
134
-
distributedactorGreeter {
135
-
var greetingsSent =0
129
+
Distributed actors provide stronger isolation guarantees than "local" actors, and enable additional checks to be made on return types and parameters of distributed methods, e.g. checking if they conform to `Codable`. Distributed methods can be called on "remote" references of distributed actors, turning those invocations into remote procedure calls, by means of pluggable and user extensible distributed actor system implementations.
130
+
131
+
Swift does not provide any specific distributed actor system by itself, however, packages in the ecosystem fulfil the role of providing those implementations.
136
132
137
-
distributedfuncgreet(name: String) ->String {
138
-
greetingsSent +=1
139
-
return"Hello, \(name)!"
133
+
```swift
134
+
distributedactorGreeter {
135
+
var greetingsSent =0
136
+
137
+
distributedfuncgreet(name: String) ->String {
138
+
greetingsSent +=1
139
+
return"Hello, \(name)!"
140
+
}
140
141
}
141
-
}
142
-
143
-
functalkTo(greeter: Greeter) asyncthrows {
144
-
// isolation of distributed actors is stronger, it is impossible to refer to
145
-
// any stored properties of distributed actors from outside of them:
146
-
greeter.greetingsSent// distributed actor-isolated property 'name' can not be accessed from a non-isolated context
147
142
148
-
// remote calls are implicitly throwing and async,
149
-
// to account for the potential networking involved:
150
-
let greeting =tryawait greeter.greet(name: "Alice")
151
-
print(greeting) // Hello, Alice!
152
-
}
153
-
```
143
+
functalkTo(greeter: Greeter) asyncthrows {
144
+
// isolation of distributed actors is stronger, it is impossible to refer to
145
+
// any stored properties of distributed actors from outside of them:
146
+
greeter.greetingsSent// distributed actor-isolated property 'name' can not be accessed from a non-isolated context
147
+
148
+
// remote calls are implicitly throwing and async,
149
+
// to account for the potential networking involved:
150
+
let greeting =tryawait greeter.greet(name: "Alice")
151
+
print(greeting) // Hello, Alice!
152
+
}
153
+
```
154
154
155
155
* The compiler now emits a warning when a non-final class conforms to a protocol that imposes a same-type requirement between `Self` and an associated type. This is because such a requirement makes the conformance unsound for subclasses.
156
156
157
-
For example, Swift 5.6 would allow the following code, which at runtime would construct an instance of `C` and not `SubC` as expected:
157
+
For example, Swift 5.6 would allow the following code, which at runtime would construct an instance of `C` and not `SubC` as expected:
158
158
159
159
```swift
160
160
protocolP {
@@ -262,24 +262,24 @@ Swift 5.6
262
262
263
263
*[SE-0327][]:
264
264
265
-
In Swift 5 mode, a warning is now emitted if the default-value expression of an
266
-
instance-member property requires global-actor isolation. For example:
0 commit comments