8000 Merge pull request #1755 from ollyw/patch-1 · leobenkel/docs.scala-lang@aa17cce · GitHub
[go: up one dir, main page]

Skip to content

Commit aa17cce

Browse files
authored
Merge pull request scala#1755 from ollyw/patch-1
Highlight deprecation of early definitions for initialization order
2 parents 029a061 + 1725f54 commit aa17cce

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

_overviews/FAQ/initialization-order.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ Note that using multiple lazy vals creates a new risk: cycles among lazy vals ca
124124

125125
Early definitions are a bit unwieldy, there are limitations as to what can appear and what can be referenced in an early definitions block, and they don't compose as well as lazy vals: but if a lazy val is undesirable, they present another option. They are specified in SLS 5.1.6.
126126

127+
Note that early definitions are deprecated in Scala 2.13; they will be replaced by trait parameters in Scala 3. So, early definitions are not recommended for use if future compatibility is a concern.
128+
127129
#### Use constant value definitions ####
128130
abstract class A {
129131
val x1: String

0 commit comments

Comments
 (0)
0