@@ -93,11 +93,11 @@ The checker reports:
93
93
94
94
We establish the following design goals:
95
95
96
- - __ Safe__ : checking always terminates, and is sound for common and reasonable usage (over-approximation)
97
- - __ Fast__ : instant feedback
96
+ - __ Sound__ : checking always terminates, and is sound for common and reasonable usage (over-approximation)
98
97
- __ Expressive__ : support common and reasonable initialization patterns
99
98
- __ Friendly__ : simple rules, minimal syntactic overhead, informative error messages
100
99
- __ Modular__ : modular checking, no analysis beyond project boundary
100
+ - __ Fast__ : instant feedback
101
101
- __ Simple__ : no changes to core type system, explainable by a simple theory
102
102
103
103
By _ reasonable usage_ , we include the following use cases (but not restricted to them):
@@ -154,15 +154,16 @@ With the established principles and design goals, following rules are imposed:
154
154
This is how monotonicity is enforced in the system. Note that in an
155
155
initialization ` val f: T = e ` , the expression ` e ` may point to an object
156
156
under initialization. This requires a distinction between mutation and
157
- initialization in syntax in order to enforce different rules. The Scala
158
- syntax makes it easy to distinguish initialization from mutation .
157
+ initialization in order to enforce different rules. Scala
158
+ has different syntax for them, it thus is not an issue .
159
159
160
160
2 . References to objects under initialization may not be passed as arguments to method calls or constructors.
161
161
162
162
Escape of ` this ` in the constructor is commonly regarded as an
163
163
anti-pattern, and it's rarely used in practice. This rule is simple
164
164
for the programmer to reason about initialization and it simplifies
165
- implementation.
165
+ implementation. The theory supports safe escape of ` this ` with the help of
166
+ annotations, we delay the extension until there is a strong need.
166
167
167
168
3 . Local definitions may only refer to transitively initialized objects.
168
169
0 commit comments