Skip to content

Commit 7fde75e

Browse files
committed
Update docs
1 parent ae566b4 commit 7fde75e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ With the established principles and design goals, following rules are imposed:
185185
initialization in order to enforce different rules. Scala
186186
has different syntax for them, it thus is not an issue.
187187

188-
2. References to objects under initialization may not be passed as arguments to method calls or constructors.
188+
2. Objects under initialization may not be passed as arguments to method calls.
189189

190-
Escape of `this` in the constructor is commonly regarded as an
191-
anti-pattern, and it's rarely used in practice. This rule is simple
192-
for the programmer to reason about initialization and it simplifies
193-
implementation. The theory supports safe escape of `this` with the help of
194-
annotations, we delay the extension until there is a strong need.
190+
Escape of `this` in the constructor is commonly regarded as an anti-pattern.
191+
However, escape of `this` as constructor arguments are allowed, to support
192+
creation of cyclic data structures. The checker will ensure that the escaped
193+
non-initialized object is not used, i.e. calling methods or accessing fields
194+
on the escaped object is not allowed.
195195

196196
3. Local definitions may only refer to transitively initialized objects.
197197

0 commit comments

Comments
 (0)