Skip to content

Commit 5c67216

Browse files
committed
[Changelog] fix formatting of recent items
Without these spaces the items break out of the listing. With them they look correct and are aligned with the `*`
1 parent f2cfe49 commit 5c67216

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
@@ -85,54 +85,54 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
8585

8686
* [SE-0343][]:
8787

88-
Top-level scripts support asynchronous calls.
88+
Top-level scripts support asynchronous calls.
8989

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

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

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

103103
* [SE-0336][]:
104104

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

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

115-
distributed func greet(name: String) -> String {
116-
greetingsSent += 1
117-
return "Hello, \(name)!"
111+
```swift
112+
distributed actor Greeter {
113+
var greetingsSent = 0
114+
115+
distributed func greet(name: String) -> String {
116+
greetingsSent += 1
117+
return "Hello, \(name)!"
118+
}
118119
}
119-
}
120-
121-
func talkTo(greeter: Greeter) async throws {
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
125120

126-
// remote calls are implicitly throwing and async,
127-
// to account for the potential networking involved:
128-
let greeting = try await greeter.greet(name: "Alice")
129-
print(greeting) // Hello, Alice!
130-
}
131-
```
121+
func talkTo(greeter: Greeter) async throws {
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 = try await greeter.greet(name: "Alice")
129+
print(greeting) // Hello, Alice!
130+
}
131+
```
132132

133133
* 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.
134134

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

137137
```swift
138138
protocol P {
@@ -240,24 +240,24 @@ Swift 5.6
240240

241241
* [SE-0327][]:
242242

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:
245-
246-
```swift
247-
@MainActor
248-
func partyGenerator() -> [PartyMember] { fatalError("todo") }
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:
249245

250-
class Party {
251-
@MainActor var members: [PartyMember] = partyGenerator()
252-
// ^~~~~~~~~~~~~~~~
253-
// warning: expression requiring global actor 'MainActor' cannot
254-
// appear in default-value expression of property 'members'
255-
}
256-
```
257-
258-
Previously, the isolation granted by the type checker matched the isolation of
259-
the property itself, but at runtime that is not guaranteed. In Swift 6,
260-
such default-value expressions will become an error if they require isolation.
246+
```swift
247+
@MainActor
248+
func partyGenerator() -> [PartyMember] { fatalError("todo") }
249+
250+
class Party {
251+
@MainActor var members: [PartyMember] = partyGenerator()
252+
// ^~~~~~~~~~~~~~~~
253+
// warning: expression requiring global actor 'MainActor' cannot
254+
// appear in default-value expression of property 'members'
255+
}
256+
```
257+
258+
Previously, the isolation granted by the type checker matched the isolation of
259+
the property itself, but at runtime that is not guaranteed. In Swift 6,
260+
such default-value expressions will become an error if they require isolation.
261261

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

0 commit comments

Comments
 (0)