@@ -125,7 +125,7 @@ var x: T = _
125125Monotonicity means that the initialization status of an object should
126126not go backward: initialized fields continue to be initialized, a
127127field 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
131131trait Reporter { def report (msg : String ): Unit }
@@ -231,26 +231,27 @@ We impose the following rules to enforce modularity:
231231
232232Theoretically, we may analyze across project boundaries based on tasty. However,
233233from 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
239- The theory is based on type-and-effect systems [ 1 ] . We introduce two concepts,
240+ The theory is based on type-and-effect systems [ 2 ] . 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
247248Potentials (π) 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