Skip to content

Commit 3a920cd

Browse files
authored
Merge pull request #42383 from ktoso/pick-changelog-formatting
[5.7][Changelog] fix formatting of recent items
2 parents 57463c9 + 5c67216 commit 3a920cd

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

CHANGELOG.md

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -107,54 +107,54 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
107107

108108
* [SE-0343][]:
109109

110-
Top-level scripts support asynchronous calls.
110+
Top-level scripts support asynchronous calls.
111111

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`.
116116

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.
119119

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.
124124

125125
* [SE-0336][]:
126126

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.
128128

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-
distributed actor Greeter {
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.
136132

137-
distributed func greet(name: String) -> String {
138-
greetingsSent += 1
139-
return "Hello, \(name)!"
133+
```swift
134+
distributed actor Greeter {
135+
var greetingsSent = 0
136+
137+
distributed func greet(name: String) -> String {
138+
greetingsSent += 1
139+
return "Hello, \(name)!"
140+
}
140141
}
141-
}
142-
143-
func talkTo(greeter: Greeter) async throws {
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
147142

148-
// remote calls are implicitly throwing and async,
149-
// to account for the potential networking involved:
150-
let greeting = try await greeter.greet(name: "Alice")
151-
print(greeting) // Hello, Alice!
152-
}
153-
```
143+
func talkTo(greeter: Greeter) async throws {
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 = try await greeter.greet(name: "Alice")
151+
print(greeting) // Hello, Alice!
152+
}
153+
```
154154

155155
* 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.
156156

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:
158158

159159
```swift
160160
protocol P {
@@ -262,24 +262,24 @@ Swift 5.6
262262

263263
* [SE-0327][]:
264264

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:
267-
268-
```swift
269-
@MainActor
270-
func partyGenerator() -> [PartyMember] { fatalError("todo") }
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:
271267

272-
class Party {
273-
@MainActor var members: [PartyMember] = partyGenerator()
274-
// ^~~~~~~~~~~~~~~~
275-
// warning: expression requiring global actor 'MainActor' cannot
276-
// appear in default-value expression of property 'members'
277-
}
278-
```
279-
280-
Previously, the isolation granted by the type checker matched the isolation of
281-
the property itself, but at runtime that is not guaranteed. In Swift 6,
282-
such default-value expressions will become an error if they require isolation.
268+
```swift
269+
@MainActor
270+
func partyGenerator() -> [PartyMember] { fatalError("todo") }
271+
272+
class Party {
273+
@MainActor var members: [PartyMember] = partyGenerator()
274+
// ^~~~~~~~~~~~~~~~
275+
// warning: expression requiring global actor 'MainActor' cannot
276+
// appear in default-value expression of property 'members'
277+
}
278+
```
279+
280+
Previously, the isolation granted by the type checker matched the isolation of
281+
the property itself, but at runtime that is not guaranteed. In Swift 6,
282+
such default-value expressions will become an error if they require isolation.
283283

284284
* Actor isolation checking now understands that `defer` bodies share the isolation of their enclosing function.
285285

0 commit comments

Comments
 (0)