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
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,54 +85,54 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
85
85
86
86
*[SE-0343][]:
87
87
88
-
Top-level scripts support asynchronous calls.
88
+
Top-level scripts support asynchronous calls.
89
89
90
-
Using an `await` by calling an asynchronous function or accessing an isolated
91
-
variable transitions the top-level to an asynchronous context. As an
92
-
asynchronous context, top-level variables are `@MainActor`-isolated and the
93
-
top-level is run on the `@MainActor`.
90
+
Using an `await` by calling an asynchronous function or accessing an isolated
91
+
variable transitions the top-level to an asynchronous context. As an
92
+
asynchronous context, top-level variables are `@MainActor`-isolated and the
93
+
top-level is run on the `@MainActor`.
94
94
95
-
Note that the transition affects function overload resolution and starts an
96
-
implicit run loop to drive the concurrency machinery.
95
+
Note that the transition affects function overload resolution and starts an
96
+
implicit run loop to drive the concurrency machinery.
97
97
98
-
Unmodified scripts are not affected by this change unless `-warn-concurrency` is
99
-
passed to the compiler invocation. With `-warn-concurrency`, variables in the
100
-
top-level are isolated to the main actor and the top-level context is isolated
101
-
to the main actor, but is not an asynchronous context.
98
+
Unmodified scripts are not affected by this change unless `-warn-concurrency` is
99
+
passed to the compiler invocation. With `-warn-concurrency`, variables in the
100
+
top-level are isolated to the main actor and the top-level context is isolated
101
+
to the main actor, but is not an asynchronous context.
102
102
103
103
*[SE-0336][]:
104
104
105
-
It is now possible to declare `distributed actor` and `distributed func`s inside of them.
105
+
It is now possible to declare `distributed actor` and `distributed func`s inside of them.
106
106
107
-
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.
108
-
109
-
Swift does not provide any specific distributed actor system by itself, however, packages in the ecosystem fulfil the role of providing those implementations.
110
-
111
-
```swift
112
-
distributedactorGreeter {
113
-
var greetingsSent =0
107
+
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.
108
+
109
+
Swift does not provide any specific distributed actor system by itself, however, packages in the ecosystem fulfil the role of providing those implementations.
114
110
115
-
distributedfuncgreet(name: String) ->String {
116
-
greetingsSent +=1
117
-
return"Hello, \(name)!"
111
+
```swift
112
+
distributedactorGreeter {
113
+
var greetingsSent =0
114
+
115
+
distributedfuncgreet(name: String) ->String {
116
+
greetingsSent +=1
117
+
return"Hello, \(name)!"
118
+
}
118
119
}
119
-
}
120
-
121
-
functalkTo(greeter: Greeter) asyncthrows {
122
-
// isolation of distributed actors is stronger, it is impossible to refer to
123
-
// any stored properties of distributed actors from outside of them:
124
-
greeter.greetingsSent// distributed actor-isolated property 'name' can not be accessed from a non-isolated context
125
120
126
-
// remote calls are implicitly throwing and async,
127
-
// to account for the potential networking involved:
128
-
let greeting =tryawait greeter.greet(name: "Alice")
129
-
print(greeting) // Hello, Alice!
130
-
}
131
-
```
121
+
functalkTo(greeter: Greeter) asyncthrows {
122
+
// isolation of distributed actors is stronger, it is impossible to refer to
123
+
// any stored properties of distributed actors from outside of them:
124
+
greeter.greetingsSent// distributed actor-isolated property 'name' can not be accessed from a non-isolated context
125
+
126
+
// remote calls are implicitly throwing and async,
127
+
// to account for the potential networking involved:
128
+
let greeting =tryawait greeter.greet(name: "Alice")
129
+
print(greeting) // Hello, Alice!
130
+
}
131
+
```
132
132
133
133
* 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.
134
134
135
-
For example, Swift 5.6 would allow the following code, which at runtime would construct an instance of `C` and not `SubC` as expected:
135
+
For example, Swift 5.6 would allow the following code, which at runtime would construct an instance of `C` and not `SubC` as expected:
136
136
137
137
```swift
138
138
protocolP {
@@ -240,24 +240,24 @@ Swift 5.6
240
240
241
241
*[SE-0327][]:
242
242
243
-
In Swift 5 mode, a warning is now emitted if the default-value expression of an
244
-
instance-member property requires global-actor isolation. For example:
0 commit comments