Work in Progress

We are still in the process of writing the documentation for Scala 3. You can help us to improve the documentation.

Are you searching for the Scala 2 documentation?

Scala 3 Language Reference

Dropped: Wildcard Initializer

Language

The syntax

  var x: A = _

that was used to indicate an uninitialized field, has been dropped. At its place there is a special value uninitialized in the scala.compiletime package. To get an uninitialized field, you now write

import scala.compiletime.uninitialized

var x: A = uninitialized

To enable cross-compilation, _ is still supported, but it will be dropped in a future 3.x version.

Contributors to this page: