@@ -172,7 +172,7 @@ the following notation:
172
172
173
173
* ` [(a), {(b), actorInstance}] ` : Two values in separate isolation regions. a's
174
174
region is disconnected but b's region is assigned to the isolation domain of
175
- the actor instance actorInstance.
175
+ the actor instance ` actorInstance ` .
176
176
177
177
* ` [{(x, y), @OtherActor}, (z), (w, t)] ` : Five values in three separate
178
178
isolation regions. ` x ` and ` y ` are within one isolation region that is
@@ -840,7 +840,7 @@ To achieve a *strong transfer* convention, one can use the *transferring* functi
840
840
parameter annotation. Please see extensions below for more information about
841
841
* transferring* .
842
842
843
- Since our transfer convention is a weak, a disconnected isolation region that
843
+ Since our transfer convention is weak, a disconnected isolation region that
844
844
was transferred into an isolation domain can be used again if the isolation
845
845
domain no longer maintains any references to the region. This occurs with
846
846
` nonisolated ` asynchronous functions. When we transfer a disconnected value into
@@ -974,8 +974,7 @@ actor-isolated closure argument cannot introduce races by transferring function
974
974
parameters of nonisolated functions into an isolated closure:
975
975
976
976
``` swift
977
- @MainActor
978
- final class ContainsNonSendable {
977
+ actor ContainsNonSendable {
979
978
var ns: NonSendableType = .init ()
980
979
981
980
nonisolated func unsafeSet (_ ns : NonSendableType) {
@@ -987,7 +986,7 @@ final class ContainsNonSendable {
987
986
988
987
func assumeIsolatedError (actor : ContainsNonSendable) async {
989
988
let x = NonSendableType ()
990
- actor1 .unsafeSet (x)
989
+ actor .unsafeSet (x)
991
990
useValue (x) // Race is here
992
991
}
993
992
```
@@ -1130,7 +1129,7 @@ assume that the closure must also be isolated to that global actor:
1130
1129
```
1131
1130
1132
1131
If ` mainActorUtility ` was not called within ` closure ` 's body then ` closure `
1133
- would be disconnected and could be transferred:"
1132
+ would be disconnected and could be transferred:
1134
1133
1135
1134
``` swift
1136
1135
@MainActor func mainActorUtility () {}
@@ -1230,7 +1229,7 @@ func keyPathInDisconnectedRegionDueToCapture() async {
1230
1229
When an async let binding is initialized with an expression that uses a
1231
1230
disconnected non-` Sendable ` value, the value is treated as being transferred
1232
1231
into a ` nonisolated ` asynchronous callee that additionally allows for the value
1233
- to be transferred. If the value is used only be synchronous code and
1232
+ to be transferred. If the value is used only by synchronous code and
1234
1233
` nonisolated ` asynchronous functions, we allow for the value to be reused again
1235
1234
once the async let binding has been awaited upon:
1236
1235
@@ -1372,7 +1371,7 @@ transferred to another task by callMethod, it is no longer safe to directly
1372
1371
access self's memory and thus we emit an error when we access
1373
1372
` self.nonSendableField ` .
1374
1373
1375
- deinits as well as inits with one additional rule. Just like with initializers,
1374
+ Deinits work just like inits with one additional rule. Just like with initializers,
1376
1375
self is considered initially to be strongly transferred and non-` Sendable ` . One
1377
1376
is allowed to access the ` Sendable ` stored properties of self while self is
1378
1377
non-` Sendable ` . One can access the non-` Sendable ` fields of self if one knows
@@ -1694,7 +1693,7 @@ reference. If `x` is captured by reference, it is captured mutably implying that
1694
1693
when accessing ` x.f ` , we could race against an assignment to ` x.f ` in the
1695
1694
closure:
1696
1695
1697
- ```
1696
+ ``` swift
1698
1697
struct NonSendableStruct {
1699
1698
let letSendableField: Sendable
1700
1699
var varSendableField: Sendable
@@ -1812,7 +1811,7 @@ the value outside of the callee's parameter. The implications of this are:
1812
1811
```
1813
1812
1814
1813
if we did not have the strong isolation, then ` x ` could still be used in the
1815
- caller of someSynchronousFunction.
1814
+ caller of ` someSynchronousFunction ` .
1816
1815
1817
1816
* Due to the isolation of a transferring parameter, it is legal to have a
1818
1817
non-` Sendable ` transferring parameter of a synchronous actor designated
0 commit comments