Skip to content

Commit 4934fbc

Browse files
Typos (#2453)
1 parent 7ad18e0 commit 4934fbc

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

proposals/0414-region-based-isolation.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ the following notation:
172172

173173
* `[(a), {(b), actorInstance}]`: Two values in separate isolation regions. a's
174174
region is disconnected but b's region is assigned to the isolation domain of
175-
the actor instance actorInstance.
175+
the actor instance `actorInstance`.
176176

177177
* `[{(x, y), @OtherActor}, (z), (w, t)]`: Five values in three separate
178178
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
840840
parameter annotation. Please see extensions below for more information about
841841
*transferring*.
842842

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
844844
was transferred into an isolation domain can be used again if the isolation
845845
domain no longer maintains any references to the region. This occurs with
846846
`nonisolated` asynchronous functions. When we transfer a disconnected value into
@@ -974,8 +974,7 @@ actor-isolated closure argument cannot introduce races by transferring function
974974
parameters of nonisolated functions into an isolated closure:
975975

976976
```swift
977-
@MainActor
978-
final class ContainsNonSendable {
977+
actor ContainsNonSendable {
979978
var ns: NonSendableType = .init()
980979

981980
nonisolated func unsafeSet(_ ns: NonSendableType) {
@@ -987,7 +986,7 @@ final class ContainsNonSendable {
987986

988987
func assumeIsolatedError(actor: ContainsNonSendable) async {
989988
let x = NonSendableType()
990-
actor1.unsafeSet(x)
989+
actor.unsafeSet(x)
991990
useValue(x) // Race is here
992991
}
993992
```
@@ -1130,7 +1129,7 @@ assume that the closure must also be isolated to that global actor:
11301129
```
11311130

11321131
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:
11341133

11351134
```swift
11361135
@MainActor func mainActorUtility() {}
@@ -1230,7 +1229,7 @@ func keyPathInDisconnectedRegionDueToCapture() async {
12301229
When an async let binding is initialized with an expression that uses a
12311230
disconnected non-`Sendable` value, the value is treated as being transferred
12321231
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
12341233
`nonisolated` asynchronous functions, we allow for the value to be reused again
12351234
once the async let binding has been awaited upon:
12361235

@@ -1372,7 +1371,7 @@ transferred to another task by callMethod, it is no longer safe to directly
13721371
access self's memory and thus we emit an error when we access
13731372
`self.nonSendableField`.
13741373

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,
13761375
self is considered initially to be strongly transferred and non-`Sendable`. One
13771376
is allowed to access the `Sendable` stored properties of self while self is
13781377
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
16941693
when accessing `x.f`, we could race against an assignment to `x.f` in the
16951694
closure:
16961695

1697-
```
1696+
```swift
16981697
struct NonSendableStruct {
16991698
let letSendableField: Sendable
17001699
var varSendableField: Sendable
@@ -1812,7 +1811,7 @@ the value outside of the callee's parameter. The implications of this are:
18121811
```
18131812

18141813
if we did not have the strong isolation, then `x` could still be used in the
1815-
caller of someSynchronousFunction.
1814+
caller of `someSynchronousFunction`.
18161815

18171816
* Due to the isolation of a transferring parameter, it is legal to have a
18181817
non-`Sendable` transferring parameter of a synchronous actor designated

0 commit comments

Comments
 (0)