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: Procedure Syntax


Procedure syntax

def f() { ... }

has been dropped. You need to write one of the following instead:

def f() = { ... }
def f(): Unit = { ... }

Scala 3 accepts the old syntax under the -source:3.0-migration option. If the -migration option is set, it can even rewrite old syntax to new. The Scalafix tool also can rewrite procedure syntax to make it Scala 3 compatible.

Contributors to this page: