Scala 3 Migration Guide

Compiler Options Lookup Table


This table lists the Scala 2.13 compiler options with their equivalent in Scala 3. Some options have cross-version support, such as -Vprint. Others have a close equivalent with a different name. A number of Scala 2 options have no equivalent in Scala 3, such as options for debugging Scala 2 macros.

The compiler options are shown as displayed by the help output scalac -help, scalac -X, etc. A few aliases are shown here, but most older aliases, such as -Xprint for -Vprint, or -Ytyper-debug for -Vtyper, are listed by the latest name.

The option groups -V and -W were introduced in Scala 2.13, for “verbose” options that request additional diagnostic output and “warnings” that request additional checks which may or may not indicate errors in code. -Werror elevates warnings to errors, and -Wconf allows precise control over warnings by either ignoring them or taking them as errors. The configuration string for -Wconf will likely require adjustment when migrating to Scala 3, since the configuration syntax and the error messages it matches are different.

Status Meaning
It is available in Scala 3.
<new-name> It has been renamed to <new-name>.
It is not yet available but could be added later.

The current comparison is based on Scala 2.13.10 and 3.3.0.

Standard Settings

2.13.x 3.3.x
-explaintypes -explain-types
-target -Xtarget

Verbose Settings

2.13.x 3.3.x
-Vclasspath -Ylog-classpath
-Vdebug -Ydebug
-Vinline <package/Class.method>
-Vlog:<phases> -Ylog:<phases>
-Vopt <package/Class.method>
-Vprint-args <file>
-Vprint-pos -Yprint-pos
-Vprint-types -Xprint-types
-Vshow-class <class>
-Vshow-member-pos <output style>
-Vshow-object <object>
-Vstatistics <phases>

Warning Settings

2.13.x 3.3.x

Advanced Settings

2.13.x 3.3.x
-Xcheckinit -Ysafe-init
-Xlint:deprecation -deprecation
-Xsource -source
-Xverify -Xverify-signatures

Private settings

2.13.x 3.0.x

Compiler Plugins

Some useful Scala 2.13 compiler plugins are now shipped into the compiler. You can enable and configure them with some new native options.


2.13.x 3.0.x
-Xplugin:scalajs-compiler_<version>.jar -scalajs
-P:scalajs:genStaticForwardersForNonTopLevelObjects -scalajs-genStaticForwardersForNonTopLevelObjects
-P:scalajs:mapSourceURI -scalajs-mapSourceURI


2.13.x 3.0.x
-Xplugin:semanticdb-scalac_<version>.jar -Xsemanticdb
-P:semanticdb:targetroot:<path> -semanticdb-target:<path>


2.13.x 3.0.x
-Xplugin:kind-projector_<version>.jar -Ykind-projector

Contributors to this page: