8000 Highlight deprecation of early definitions for initialization order by ollyw · Pull Request #1755 · scala/docs.scala-lang · GitHub
[go: up one dir, main page]

Skip to content

Highlight deprecation of early definitions for initialization order #1755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Highlight deprecation of early definitions
Document that early definitions are deprecated and going to be obsolete due to Tasty compatibly. See
scala/scala-dev#513 for more details
  • Loading branch information
ollyw committed Aug 14, 2020
commit c847b684ce3ecc7ab592e77d6ffa0684fafbe130
2 changes: 2 additions & 0 deletions _overviews/FAQ/initialization-order.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ Note that using multiple lazy vals creates a new risk: cycles among lazy vals ca

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.

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.

#### Use constant value definitions ####
abstract class A {
val x1: String
Expand Down
0