Skip to content

Commit d565ac6

Browse files
authored
Merge pull request #73994 from gottesmm/release/6.0-changelist
[6.0] Add ChangeLog entries for SE-0414 and SE-0430
2 parents f97d0c9 + 9e01cb0 commit d565ac6

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,50 @@
55
66
## Swift 6.0
77

8+
* [SE-0430][]:
9+
10+
Region Based Isolation is now extended to enable the application of an
11+
explicit `sending` annotation to function parameters and results. A function
12+
parameter or result that is annotated with `sending` is required to be
13+
disconnected at the function boundary and thus possesses the capability of
14+
being safely sent across an isolation domain or merged into an actor-isolated
15+
region in the function's body or the function's caller respectively. Example:
16+
17+
```swift
18+
func parameterWithoutSending(_ x: NonSendableType) async {
19+
// Error! Cannot send a task-isolated value to the main actor!
20+
await transferToMainActor(x)
21+
}
22+
23+
func parameterWithSending(_ x: sending NonSendableType) async {
24+
// Ok since `x` is `sending` and thus disconnected.
25+
await transferToMainActor(x)
26+
}
27+
```
28+
29+
* [SE-0414][]:
30+
31+
The compiler is now capable of determining whether or not a value that does
32+
not conform to the `Sendable` protocol can safely be sent over an isolation
33+
boundary. This is done by introducing the concept of *isolation regions* that
34+
allows the compiler to reason conservatively if two values can affect each
35+
other. Through the usage of isolation regions, the compiler can now prove that
36+
sending a value that does not conform to the `Sendable` protocol over an
37+
isolation boundary cannot result in races because the value (and any other
38+
value that might reference it) is not used in the caller after the point of
39+
sending allowing code like the following to compile:
40+
41+
```swift
42+
actor MyActor {
43+
init(_ x: NonSendableType) { ... }
44+
}
45+
46+
func useValue() {
47+
let x = NonSendableType()
48+
let a = await MyActor(x) // Error without Region Based Isolation!
49+
}
50+
```
51+
852
* [SE-0427][]:
953
You can now suppress `Copyable` on protocols, generic parameters,
1054
and existentials:
@@ -10287,6 +10331,8 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
1028710331
[SE-0413]: https://github.com/apple/swift-evolution/blob/main/proposals/0413-typed-throws.md
1028810332
[SE-0422]: https://github.com/apple/swift-evolution/blob/main/proposals/0422-caller-side-default-argument-macro-expression.md
1028910333
[SE-0427]: https://github.com/apple/swift-evolution/blob/main/proposals/0427-noncopyable-generics.md
10334+
[SE-0414]: https://github.com/apple/swift-evolution/blob/main/proposals/0414-region-based-isolation.md
10335+
[SE-0430]: https://github.com/apple/swift-evolution/blob/main/proposals/0430-transferring-parameters-and-results.md
1029010336
[#64927]: <https://github.com/apple/swift/issues/64927>
1029110337
[#42697]: <https://github.com/apple/swift/issues/42697>
1029210338
[#42728]: <https://github.com/apple/swift/issues/42728>

0 commit comments

Comments
 (0)