8000 Highlight deprecation of early defintions · scala/docs.scala-lang@7f20e48 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f20e48

Browse files
committed
Highlight deprecation of early defintions
Document that early definitions are deprecated and going to be obsolete due to Tasty compatibly. See scala/scala-dev#513 for more details
1 parent 9da65ee commit 7f20e48

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 and will be removed in 2.14; they will be replaced by trait parameters in 3.0. This option is not recommended 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