Skip to content

Commit e343407

Browse files
committed
Fix typos in documentation
1 parent f3b4834 commit e343407

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/docs/reference/other-new-features/safe-initialization.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ var x: T = _
125125
Monotonicity means that the initialization status of an object should
126126
not go backward: initialized fields continue to be initialized, a
127127
field points to an initialized object may not later point to an
128-
object under initialization. It means the following code will be rejected:
128+
object under initialization. As an example, the following code will be rejected:
129129

130130
``` scala
131131
trait Reporter { def report(msg: String): Unit }
@@ -231,26 +231,27 @@ We impose the following rules to enforce modularity:
231231

232232
Theoretically, we may analyze across project boundaries based on tasty. However,
233233
from our experience with Dotty community projects, most subtle initialization
234-
patterns are restricted in the same project. We think it is good to first impose
235-
more strict rules. The feedback from the community is welcome.
234+
patterns are restricted in the same project. As the rules only report warnings
235+
instead of errors, we think it is good to first impose more strict rules, The
236+
feedback from the community is welcome.
236237

237238
## Theory
238239

239240
The theory is based on type-and-effect systems [1]. We introduce two concepts,
240241
_effects_ and _potentials_:
241242

242243
```
243-
π = C.this | Warm[C, π] | π.f | π.m | C.super[D] | Cold | Fun(Π, Φ) | Outer(C, π)
244+
π = C.this | Warm(C, π) | π.f | π.m | π.super[D] | Cold | Fun(Π, Φ) | Outer(C, π)
244245
ϕ = π↑ | π.f! | π.m!
245246
```
246247

247248
Potentials (π) represent values that are possibly under initialization.
248249

249250
- `C.this`: current object
250-
- `Warm[C, π]`: an object of type `C` where all its fields are assigned, and the potential for `this` of its enclosing class is `π`.
251+
- `Warm(C, π)`: an object of type `C` where all its fields are assigned, and the potential for `this` of its enclosing class is `π`.
251252
- `π.f`: the potential of the field `f` in the potential `π`
252253
- `π.m`: the potential of the field `f` in the potential `π`
253-
- `C.super[D]`: essentially the current object, used for virtual method resolution
254+
- `π.super[D]`: essentially the object π, used for virtual method resolution
254255
- `Cold`: an object with unknown initialization status
255256
- `Fun(Π, Φ)`: a function, when called produce effects Φ and return potentials Π.
256257
- `Outer(C, π)`: the potential of `this` for the enclosing class of `C` when `C.this` is ` π`.

0 commit comments

Comments
 (0)