Skip to content

Commit 5d2d622

Browse files
authored
Fix wording and code formatting in SE-0414
There are no constructors in Swift, where initializers are used instead. Additionally, a few keywords were not formatted as code in the proposal text.
1 parent 1922237 commit 5d2d622

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

proposals/0414-region-based-isolation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ point of transfer.
3232
[SE-0302](0302-concurrent-value-and-concurrent-closures.md) states
3333
that non-`Sendable` values cannot be passed across isolation boundaries. The
3434
following code demonstrates a `Sendable` violation when passing a
35-
newly-constructed value into an actor-isolated function:
35+
newly-initialized value into an actor-isolated function:
3636

3737
```swift
3838
// Not Sendable
@@ -58,9 +58,9 @@ func openNewAccount(name: String, initialBalance: Double) async {
5858

5959
This is overly conservative; the program is safe because:
6060

61-
* `client` does not have access to any non-`Sendable` state from its constructor
61+
* `client` does not have access to any non-`Sendable` state from its initializer
6262
parameters since Strings and Doubles are `Sendable`.
63-
* `client` just being constructed implies that `client` cannot have any uses
63+
* `client` just being initialized implies that `client` cannot have any uses
6464
outside of `openNewAccount`.
6565
* `client` is not used within `openNewAccount` beyond `addClient`.
6666

@@ -223,7 +223,7 @@ precise regions.
223223

224224
Now lets apply these rules to some specific examples in Swift code:
225225

226-
* **Initializing a let or var binding**. ``let y = x, var y = x``. Initializing
226+
* **Initializing a `let` or `var` binding**. ``let y = x, var y = x``. Initializing
227227
a let or var binding `y` with `x` results in `y` being in the same region as
228228
`x`. This follows from rule `(2)` since formally a copy is equivalent to calling a
229229
function that accepts `x` and returns a copy of `x`.
@@ -243,7 +243,7 @@ Now lets apply these rules to some specific examples in Swift code:
243243
change program semantics. A valid program must still obey the no-reuse
244244
constraints of `consume`.
245245

246-
* **Assigning a var binding**. ``y = x``. Assigning a var binding `y` with `x`
246+
* **Assigning a `var` binding**. ``y = x``. Assigning a var binding `y` with `x`
247247
results in `y` being in the same region as `x`. If `y` is not captured by
248248
reference in a closure, then `y`'s previous assigned region is forgotten due
249249
to `(3)(b)`:
@@ -1887,7 +1887,7 @@ func example(_ x: NonSendable) async -> NonSendable? {
18871887
}
18881888
```
18891889

1890-
In the above, the result of `example` is a newly constructed value that has no
1890+
In the above, the result of `example` is a newly initialized value that has no
18911891
data dependence on the parameter `x`, but as laid out in this proposal, we
18921892
cannot express this. We propose the addition of a new function parameter
18931893
modifier called `returnsIsolated` that causes callers to treat the result of a

0 commit comments

Comments
 (0)