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.

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
-Dproperty=value
-J<flag>
-P:<plugin>:<opt>
-V
-W
-X
-Y
-bootclasspath
-classpath
-d
-dependencyfile
-deprecation
-encoding
-explaintypes -explain-types
-extdirs
-feature
-g
-help
-javabootclasspath
-javaextdirs
-language
-no-specialization
-nobootcp
-nowarn
-opt
-opt-inline-from
-opt-warnings
-optimize
-print
-release
-rootdir
-sourcepath
-target -Xtarget
-toolcp
-unchecked
-uniqid
-usejavacp
-usemanifestc
-verbose
-version

Verbose Settings

2.13.x 3.3.x
-Vbrowse:<phases>
-Vclasspath -Ylog-classpath
-Vdebug -Ydebug
-Vdebug-tasty
-Vdebug-type-error
-Vdoc
-Vfree-terms
-Vfree-types
-Vhot-statistics
-Vide
-Vimplicit-conversions
-Vimplicits
-Vimplicits-max-refined
-Vimplicits-verbose-tree
-Vinline <package/Class.method>
-Vlog:<phases> -Ylog:<phases>
-Vmacro
-Vmacro-lite
-Vopt <package/Class.method>
-Vpatmat
-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.3.x
-Wconf
-Wdead-code
-Werror
-Wextra-implicit
-Wmacros:<mode>
-Wnonunit-if
-Wnonunit-statement
-Wnumeric-widen
-Woctal-literal
-Wopt
-Wperformance
-Wself-implicit
-Wunused:<warnings>
-Wvalue-discard

Advanced Settings

2.13.x 3.3.x
-Xasync
-Xcheckinit -Ysafe-init
-Xdev
-Xdisable-assertions
-Xelide-below
-Xexperimental
-Xfuture
-Xgenerate-phase-graph
-Xjline
-Xlint:deprecation -deprecation
-Xlint:<warnings>
-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
-Xresident
-Xscript
-Xsource -source
-Xsource-reader
-Xverify -Xverify-signatures
-Xxml

Private settings

2.13.x 3.0.x
-Ybackend-parallelism
-Ybackend-worker-queue
-Ybreak-cycles
-Ycache-macro-class-loader
-Ycache-plugin-class-loader
-Ycheck
-Ycompact-trees
-Ydelambdafy
-Ydump-classes
-Ygen-asmp
-Yimports
-Yissue-debug
-Yjar-compression-level
-YjarFactory
-Ymacro-annotations
-Ymacro-classpath
-Ymacro-expand
-Ymacro-global-fresh-names
-Yno-completion
-Yno-flat-classpath-cache
-Yno-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
-Yreify-copypaste
-Yrepl-class-based
-Yrepl-outdir
-Yrepl-use-magic-imports
-Yresolve-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.0.x
-Xplugin:scalajs-compiler_<version>.jar -scalajs
-P:scalajs:genStaticForwardersForNonTopLevelObjects -scalajs-genStaticForwardersForNonTopLevelObjects
-P:scalajs:mapSourceURI -scalajs-mapSourceURI

SemanticDB

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

Kind-Projector

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

Contributors to this page: