Guide to Scala 3 Compiler Contribution



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:

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