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?

Guide to Scala 3 Compiler Contribution

Cheatsheets

Language

This page is a quick-reference guide for common tasks while working with the compiler. For more in-depth explanations, see the rest of this chapter.

sbt Commands

The following commands can be run within sbt in the dotty directory:

Commands
testCompilation Run compilation tests on files that match the first argument.
scala3/scalac Run the compiler directly, with any current changes.
scala3/scala Run the main method of a given class name.
repl Start a REPL with the bootstrapped compiler.
testOnly *CompilationTests -- *pos Run test pos from the compilation test suite.
scala3-compiler/Test/runMain dotty.tools.printTypes Print types underlying representation
scala3/scalac -print-tasty Foo.tasty Print the TASTy of top-level class Foo
scala3-bootstrapped/test Run all tests for Scala 3. (Slow, recommended for CI only)
scala3-bootstrapped/publishLocal Build Scala 3 locally. (Use to debug a specific project)

Shell Commands

Command Description
rm -rv *.tasty *.class out || true clean all compiled artifacts, from root dotty directory

Contributors to this page: