Scala 3 Migration Guide

Compiler Options Lookup Table

Language

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. Scala 3 ignores the options it does not know, with a warning.

The Scaladoc options are compared in Scaladoc Settings.

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.18 and 3.9.0.

Scala 3.3 does not have the optimizer options (-opt, -opt-inline, -Wopt), and some options still have their -Y names: -Ykind-projector, -Ysafe-init, -Ydump-classes, -Yno-generic-signatures, -Yresolve-term-conflict and -Yjar-compression-level.

Standard Settings

2.13.x 3.9.x
-Dproperty=value
-J<flag>
-P:<plugin>:<opt>
-V
-W
-X
-Y
-bootclasspath
-classpath
-d
-dependencyfile
-deprecation
-encoding
-explaintypes -explain
-extdirs
-feature
-g
-help
-javabootclasspath
-javaextdirs
-language
-no-specialization
-nobootcp
-nowarn
-opt:local -opt
-opt:inline:<patterns> -opt-inline:<patterns>
-opt-inline-from -opt-inline
-opt-warnings -Wopt
-optimize
-print
-quickfix -rewrite
-release
-rootdir
-sourcepath
-system
-target -Xunchecked-java-output-version
-toolcp
-unchecked
-uniqid
-usejavacp
-usemanifestcp
-verbose
-version

Verbose Settings

2.13.x 3.9.x
-Vbrowse:<phases>
-Vclasspath -Ylog-classpath
-Vcyclic -Ydebug-cyclic
-Vdebug -Ydebug
-Vdebug-tasty
-Vdebug-type-error -Ydebug-error
-Vdoc
-Vfree-terms
-Vfree-types
-Vhot-statistics
-Vide
-Vimplicit-conversions
-Vimplicits
-Vimplicits-max-refined
-Vimplicits-verbose-tree
-Vinline <package/Class.method> -Yopt-log-inline
-Vlog:<phases> -Ylog:<phases>
-Vmacro
-Vmacro-lite
-Vopt <package/Class.method> -Yopt-trace
-Vpatmat
-Vphase-graph
-Vphases
-Vpos
-Vprint:<phases>
-Vprint-args <file>
-Vprint-pos -Yprint-pos
-Vprint-types -Xprint-types
-Vquasiquote
-Vreflective-calls
-Vreify
-Vshow:<phases>
-Vshow-class <class>
-Vshow-member-pos <output style>
-Vshow-object <object>
-Vshow-symkinds
-Vshow-symowners
-Vstatistics <phases>
-Vsymbols
-Vtype-diffs
-Vtyper

Warning Settings

2.13.x 3.9.x
-Wconf
-Wdead-code
-Werror
-Wextra-implicit
-Wmacros:<mode>
-Wmultiarg-infix
-Wnonunit-if
-Wnonunit-statement
-Wnumeric-widen
-Woctal-literal
-Wopt
-Wperformance
-Wself-implicit
-Wtostring-interpolated
-Wunnamed-boolean-literal
-Wunnamed-boolean-literal-strict
-Wunused:<warnings>
-Wvalue-discard

Advanced Settings

2.13.x 3.9.x
-Xasync
-Xcheckinit -Wsafe-init
-Xdev
-Xdisable-assertions
-Xelide-below
-Xexperimental
-Xfuture
-Xjline
-Xlint:deprecation -deprecation
-Xlint:<warnings>
-Xlint:private-shadow -Wshadow:private-shadow
-Xlint:recurse-with-default -Wrecurse-with-default
-Xlint:type-parameter-shadow -Wshadow:type-parameter-shadow
-Xlint:unused -Wunused:linted
-Xmacro-settings
-Xmain-class
-Xmaxerrs
-Xmaxwarns
-Xmigration
-Xmixin-force-forwarders
-Xno-forwarders
-Xno-patmat-analysis
-Xnon-strict-patmat-analysis
-Xnojline
-Xplugin
-Xplugin-disable
-Xplugin-list
-Xplugin-require
-Xpluginsdir
-Xprompt
-Xreporter -Yreporter
-Xresident
-Xscript
-Xsource -source
-Xsource-features
-Xsource-reader
-Xverify -Xverify-signatures
-Xxml

Private settings

2.13.x 3.9.x
-Ybackend-parallelism
-Ybackend-worker-queue
-Ybreak-cycles
-Ycache-macro-class-loader
-Ycache-plugin-class-loader
-Ycheck
-Ycollect-statistics
-Ycompact-trees
-Ydelambdafy
-Ydump-classes -Xdump-classes
-Ygen-asmp
-Yimports
-Yjar-compression-level -Xjar-compression-level
-YjarFactory
-Ymacro-annotations
-Ymacro-classpath
-Ymacro-expand
-Ymacro-global-fresh-names
-Yno-completion
-Yno-flat-classpath-cache -YdisableFlatCpCaching
-Yno-generic-signatures -Xno-generic-signatures
-Yno-imports
-Yno-predef
-Yopt-inline-heuristics
-Ypatmat-exhaust-depth
-Ypresentation-any-thread
-Ypresentation-debug
-Ypresentation-delay
-Ypresentation-locate-source-file
-Ypresentation-log
-Ypresentation-replay
-Ypresentation-strict
-Ypresentation-verbose
-Yprint-trees
-Yprofile-destination
-Yprofile-enabled
-Yprofile-external-tool
-Yprofile-run-gc
-Yprofile-trace
-Yrangepos
-Yrecursion
-Yrelease
-Yreify-copypaste
-Yrepl-class-based
-Yrepl-outdir
-Yrepl-use-magic-imports
-Yresolve-term-conflict -Xresolve-term-conflict
-Yscala3-implicit-resolution
-Yscriptrunner
-Yskip
-Ystop-after
-Ystop-before
-Ytasty-no-annotations
-Ytasty-reader
-Ytrack-dependencies
-Yvalidate-pos

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.

Scala.js

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

SemanticDB

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

Kind-Projector

2.13.x 3.9.x
-Xplugin:kind-projector_<version>.jar -Xkind-projector

Contributors to this page: