Skip to content

Commit e6cf064

Browse files
authored
[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 b952184 commit e6cf064

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

7272
* [SE-0343][]:
7373

74-
Top-level scripts support asynchronous calls.
74+
Top-level scripts support asynchronous calls.
7575

76-
Using an `await` by calling an asynchronous function or accessing an isolated
77-
variable transitions the top-level to an asynchronous context. As an
78-
asynchronous context, top-level variables are `@MainActor`-isolated and the
79-
top-level is run on the `@MainActor`.
76+
Using an `await` by calling an asynchronous function or accessing an isolated
77+
variable transitions the top-level to an asynchronous context. As an
78+
asynchronous context, top-level variables are `@MainActor`-isolated and the
79+
top-level is run on the `@MainActor`.
8080

81-
Note that the transition affects function overload resolution and starts an
82-
implicit run loop to drive the concurrency machinery.
81+
Note that the transition affects function overload resolution and starts an
82+
implicit run loop to drive the concurrency machinery.
8383

84-
Unmodified scripts are not affected by this change unless `-warn-concurrency` is
85-
passed to the compiler invocation. With `-warn-concurrency`, variables in the
86-
top-level are isolated to the main actor and the top-level context is isolated
87-
to the main actor, but is not an asynchronous context.
84+
Unmodified scripts are not affected by this change unless `-warn-concurrency` is
85+
passed to the compiler invocation. With `-warn-concurrency`, variables in the
86+
top-level are isolated to the main actor and the top-level context is isolated
87+
to the main actor, but is not an asynchronous context.
8888

8989
* [SE-0336][]:
9090

91-
It is now possible to declare `distributed actor` and `distributed func`s inside of them.
91+
It is now possible to declare `distributed actor` and `distributed func`s inside of them.
9292

93-
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.
94-
95-
Swift does not provide any specific distributed actor system by itself, however, packages in the ecosystem fulfil the role of providing those implementations.
96-
97-
```swift
98-
distributed actor Greeter {
99-
var greetingsSent = 0
93+
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.
94+
95+
Swift does not provide any specific distributed actor system by itself, however, packages in the ecosystem fulfil the role of providing those implementations.
10096

101-
distributed func greet(name: String) -> String {
102-
greetingsSent += 1
103-
return "Hello, \(name)!"
97+
```swift
98+
distributed actor Greeter {
99+
var greetingsSent = 0
100+
101+
distributed func greet(name: String) -> String {
102+
greetingsSent += 1
103+
return "Hello, \(name)!"
104+
}
104105
}
105-
}
106-
107-
func talkTo(greeter: Greeter) async throws {
108-
// isolation of distributed actors is stronger, it is impossible to refer to
109-
// any stored properties of distributed actors from outside of them:
110-
greeter.greetingsSent // distributed actor-isolated property 'name' can not be accessed from a non-isolated context
111106

112-
// remote calls are implicitly throwing and async,
113-
// to account for the potential networking involved:
114-
let greeting = try await greeter.greet(name: "Alice")
115-
print(greeting) // Hello, Alice!
116-
}
117-
```
107+
func talkTo(greeter: Greeter) async throws {
108+
// isolation of distributed actors is stronger, it is impossible to refer to
109+
// any stored properties of distributed actors from outside of them:
110+
greeter.greetingsSent // distributed actor-isolated property 'name' can not be accessed from a non-isolated context
111+
112+
// remote calls are implicitly throwing and async,
113+
// to account for the potential networking involved:
114+
let greeting = try await greeter.greet(name: "Alice")
115+
print(greeting) // Hello, Alice!
116+
}
117+
```
118118

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

121-
For example, Swift 5.6 would allow the following code, which at runtime would construct an instance of `C` and not `SubC` as expected:
121+
For example, Swift 5.6 would allow the following code, which at runtime would construct an instance of `C` and not `SubC` as expected:
122122

123123
```swift
124124
protocol P {
@@ -226,24 +226,24 @@ Swift 5.6
226226

227227
* [SE-0327][]:
228228

229-
In Swift 5 mode, a warning is now emitted if the default-value expression of an
230-
instance-member property requires global-actor isolation. For example:
231-
232-
```swift
233-
@MainActor
234-
func partyGenerator() -> [PartyMember] { fatalError("todo") }
229+
In Swift 5 mode, a warning is now emitted if the default-value expression of an
230+
instance-member property requires global-actor isolation. For example:
235231

236-
class Party {
237-
@MainActor var members: [PartyMember] = partyGenerator()
238-
// ^~~~~~~~~~~~~~~~
239-
// warning: expression requiring global actor 'MainActor' cannot
240-
// appear in default-value expression of property 'members'
241-
}
242-
```
243-
244-
Previously, the isolation granted by the type checker matched the isolation of
245-
the property itself, but at runtime that is not guaranteed. In Swift 6,
246-
such default-value expressions will become an error if they require isolation.
232+
```swift
233+
@MainActor
234+
func partyGenerator() -> [PartyMember] { fatalError("todo") }
235+
236+
class Party {
237+
@MainActor var members: [PartyMember] = partyGenerator()
238+
// ^~~~~~~~~~~~~~~~
239+
// warning: expression requiring global actor 'MainActor' cannot
240+
// appear in default-value expression of property 'members'
241+
}
242+
```
243+
244+
Previously, the isolation granted by the type checker matched the isolation of
245+
the property itself, but at runtime that is not guaranteed. In Swift 6,
246+
such default-value expressions will become an error if they require isolation.
247247

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

0 commit comments

Comments
 (0)