From d97609cbc1315a1a7a02a765a4bbe5b4585c7482 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Thu, 9 Mar 2023 01:12:57 -0800 Subject: [PATCH 1/2] Update some compiler options --- _overviews/scala3-migration/options-intro.md | 2 +- _overviews/scala3-migration/options-lookup.md | 32 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/_overviews/scala3-migration/options-intro.md b/_overviews/scala3-migration/options-intro.md index be7223a02e..06b7c245a9 100644 --- a/_overviews/scala3-migration/options-intro.md +++ b/_overviews/scala3-migration/options-intro.md @@ -18,4 +18,4 @@ To do so you can refer to the [Lookup Table](options-lookup.html). You can also discover the new Scala 3 compiler options, that have no equivalent in Scala 2.13, in the [New Compiler Options](options-new.html) page. -For scaladoc settings reference and their compatibility with Scala2 scaladoc, read [Scaladoc settings compatibility between Scala2 and Scala3](scaladoc-settings-compatibility.html) page. +For Scaladoc settings reference and their compatibility with Scala2 Scaladoc, read [Scaladoc settings compatibility between Scala2 and Scala3](scaladoc-settings-compatibility.html) page. diff --git a/_overviews/scala3-migration/options-lookup.md b/_overviews/scala3-migration/options-lookup.md index 062166b176..ab82b28ead 100644 --- a/_overviews/scala3-migration/options-lookup.md +++ b/_overviews/scala3-migration/options-lookup.md @@ -14,19 +14,19 @@ Each Scala 2.13 option is associated with its status in Scala 3. |-|-| | | it is available in Scala 3 | | `` | It has been renamed to `` | -| | It is not available in 3.0.0 but it could be added later | +| | It is not yet available could be added later | -> The current comparison is based on Scala 2.13.4 and 3.0.0-M3. +> The current comparison is based on Scala 2.13.10 and 3.3.0. ## Standard Settings -| 2.13.x | 3.0.x | +| 2.13.x | 3.3.x | |-|-| -| `-Dproperty=value` | | -| `-J` | | +| `-Dproperty=value` | | +| `-J` | | | `-P::` || -| `-V` | | -| `-W` | | +| `-V` | | +| `-W` | | | `-X` || | `-Y` || | `-bootclasspath` || @@ -186,9 +186,10 @@ Each Scala 2.13 option is associated with its status in Scala 3. Verbose settings were introduced in 2.13. Most of them are not yet implemented in Scala 3. -| 2.13.x | 3.0.x | +| 2.13.x | 3.3.x | |-|-| | `-Vbrowse:` | | +| `-Vclasspath` | `-Ylog-classpath` | | `-Vdebug-tasty` | | | `-Vdoc` | | | `-Vfree-terms` | | @@ -203,10 +204,9 @@ Most of them are not yet implemented in Scala 3. | `-Vmacro-lite` | | | `-Vopt ` | | | `-Vpatmat` | | +| `-Vphases` | | | `-Vpos`| | -| `-Vprint:` | `-Xprint:` | -| `-Vphases` | `-Xshow-phases` | -| `-Vclasspath` | `-Ylog-classpath` | +| `-Vprint:` | | | `-Vlog:` | `-Ylog:`| | `-Vdebug` | `-Ydebug` | | `-Vprint-args ` | | @@ -230,17 +230,17 @@ Most of them are not yet implemented in Scala 3. Warning settings were introduced in 2.13. Most of them are not yet implemented in Scala 3. -| 2.13.x | 3.0.x | +| 2.13.x | 3.3.x | |-|-| -| `-Wconf` | | +| `-Wconf` | | | `-Wdead-code` | | -| `-Werror` | `-Xfatal-warnings` | +| `-Werror` | | | `-Wextra-implicit` | | | `-Wmacros:` | | | `-Wnumeric-widen` | | | `-Woctal-literal` | | -| `-Wunused:` | | -| `-Wvalue-discard`| | +| `-Wunused:` | | +| `-Wvalue-discard`| | | `-Wself-implicit` | | ## Compiler Plugins From c7fa31ee575b2fe55b3f7c52da7d56f1034a55da Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Thu, 9 Mar 2023 16:42:07 -0800 Subject: [PATCH 2/2] Additional tweaks and ordering --- _overviews/scala3-migration/options-intro.md | 2 +- _overviews/scala3-migration/options-lookup.md | 207 +++++++++--------- 2 files changed, 102 insertions(+), 107 deletions(-) diff --git a/_overviews/scala3-migration/options-intro.md b/_overviews/scala3-migration/options-intro.md index 06b7c245a9..e5a831917a 100644 --- a/_overviews/scala3-migration/options-intro.md +++ b/_overviews/scala3-migration/options-intro.md @@ -16,6 +16,6 @@ To do so you can refer to the [Lookup Table](options-lookup.html). > Passing an unavailable option to the Scala 3 compiler does not make it fail. > It just prints a warning and ignores the option. -You can also discover the new Scala 3 compiler options, that have no equivalent in Scala 2.13, in the [New Compiler Options](options-new.html) page. +You can also discover the new Scala 3 compiler options, which have no equivalent in Scala 2.13, in the [New Compiler Options](options-new.html) page. For Scaladoc settings reference and their compatibility with Scala2 Scaladoc, read [Scaladoc settings compatibility between Scala2 and Scala3](scaladoc-settings-compatibility.html) page. diff --git a/_overviews/scala3-migration/options-lookup.md b/_overviews/scala3-migration/options-lookup.md index ab82b28ead..3bca1de23a 100644 --- a/_overviews/scala3-migration/options-lookup.md +++ b/_overviews/scala3-migration/options-lookup.md @@ -7,14 +7,27 @@ previous-page: options-intro next-page: options-new --- -The compiler options are classified and ordered according to their Scala 2.13 name. -Each Scala 2.13 option is associated with its status in Scala 3. +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 | -| `` | It has been renamed to `` | -| | It is not yet available could be added later | +| | It is available in Scala 3. | +| `` | It has been renamed to ``. | +| | It is not yet available but could be added later. | > The current comparison is based on Scala 2.13.10 and 3.3.0. @@ -63,11 +76,74 @@ Each Scala 2.13 option is associated with its status in Scala 3. | `-verbose` || | `-version` || +## Verbose Settings + +| 2.13.x | 3.3.x | +|-|-| +| `-Vbrowse:` | | +| `-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 ` | | +| `-Vlog:` | `-Ylog:`| +| `-Vmacro` | | +| `-Vmacro-lite` | | +| `-Vopt ` | | +| `-Vpatmat` | | +| `-Vphases` | | +| `-Vpos`| | +| `-Vprint:` | | +| `-Vprint-args ` | | +| `-Vprint-pos` | `-Yprint-pos` | +| `-Vprint-types` | `-Xprint-types` | +| `-Vquasiquote` | | +| `-Vreflective-calls` | | +| `-Vreify` | | +| `-Vshow:` | | +| `-Vshow-class ` | | +| `-Vshow-member-pos ` | | +| `-Vshow-object ` | | +| `-Vshow-symkinds` | | +| `-Vshow-symowners` | | +| `-Vstatistics ` | | +| `-Vsymbols` | | +| `-Vtype-diffs` | | +| `-Vtyper` | | + +## Warning Settings + +| 2.13.x | 3.3.x | +|-|-| +| `-Wconf` | | +| `-Wdead-code` | | +| `-Werror` | | +| `-Wextra-implicit` | | +| `-Wmacros:` | | +| `-Wnonunit-if` | | +| `-Wnonunit-statement` | | +| `-Wnumeric-widen` | | +| `-Woctal-literal` | | +| `-Wopt` | | +| `-Wperformance` | | +| `-Wself-implicit` | | +| `-Wunused:` | | +| `-Wvalue-discard`| | + ## Advanced Settings -| 2.13.x | 3.0.x | +| 2.13.x | 3.3.x | |-|-| -| `-X` || +| `-Xasync` | | | `-Xcheckinit` | `-Ycheck-init` | | `-Xdev` | | | `-Xdisable-assertions` | | @@ -78,30 +154,25 @@ Each Scala 2.13 option is associated with its status in Scala 3. | `-Xjline` | | | `-Xlint:deprecation` | `-deprecation` | | `-Xlint:` | | -| `-Xlog-implicit-conversion` | | -| `-Xlog-implicits` | | -| `-Xlog-reflective-calls` | | | `-Xmacro-settings` | | | `-Xmain-class` | | | `-Xmaxerrs` | | | `-Xmaxwarns` | | -| `-Xmigration` || -| `-Xmixin-force-forwarders` || +| `-Xmigration` || +| `-Xmixin-force-forwarders` || | `-Xno-forwarders` || | `-Xno-patmat-analysis` | | +| `-Xnon-strict-patmat-analysis` | | | `-Xnojline` | | -| `-Xplugin` || -| `-Xplugin-disable` || -| `-Xplugin-list` || -| `-Xplugin-require` || +| `-Xplugin` || +| `-Xplugin-disable` || +| `-Xplugin-list` || +| `-Xplugin-require` || | `-Xpluginsdir` || -| `-Xprint-args` | | | `-Xprompt` || | `-Xreporter` | | | `-Xresident` | | | `-Xscript` | | -| `-Xshow-class ` | | -| `-Xshow-object ` | | | `-Xsource` | `-source` | | `-Xsource-reader` | | | `-Xverify` | `-Xverify-signatures` | @@ -121,14 +192,10 @@ Each Scala 2.13 option is associated with its status in Scala 3. | `-Ydelambdafy` | | | `-Ydump-classes` || | `-Ygen-asmp` | | -| `-Yhot-statistics` | | -| `-Yide-debug` | | | `-Yimports` | | | `-Yissue-debug` | | | `-Yjar-compression-level` | | | `-YjarFactory` | | -| `-Ymacro-debug-lite` | | -| `-Ymacro-debug-verbose` | | | `-Ymacro-annotations` | | | `-Ymacro-classpath` | | | `-Ymacro-expand` | | @@ -139,109 +206,37 @@ Each Scala 2.13 option is associated with its status in Scala 3. | `-Yno-imports` || | `-Yno-predef` || | `-Yopt-inline-heuristics` | | -| `-Yopt-log-inline ` | | -| `-Yopt-trace ` | | -| `-Ypatmat-debug` | | | `-Ypatmat-exhaust-depth` | | -| `-Ypos-debug` | | | `-Ypresentation-any-thread` | | | `-Ypresentation-debug` | | | `-Ypresentation-delay` | | | `-Ypresentation-locate-source-file` | | | `-Ypresentation-log` | | +| `-Ypresentation-replay` | | | `-Ypresentation-strict` | | | `-Ypresentation-verbose` | | | `-Yprint-trees` | | -| `-Yprofile-destination` || +| `-Yprofile-destination` || | `-Yprofile-enabled` || +| `-Yprofile-external-tool` || +| `-Yprofile-run-gc` || | `-Yprofile-trace` | | -| `-Yquasiquote-debug` | | | `-Yrangepos` | | | `-Yrecursion` | | | `-Yreify-copypaste` | | -| `-Yreify-debug` | | | `-Yrepl-class-based` | | | `-Yrepl-outdir` | | | `-Yrepl-use-magic-imports` | | | `-Yresolve-term-conflict` || +| `-Yscala3-implicit-resolution` | | | `-Yscriptrunner` | | -| `-Yskip` || -| `-Yshow:` | | -| `-Yshow-member-pos ` | | -| `-Yshow-symkinds` | | -| `-Yshow-symowners` | | -| `-Yshow-syms` | | -| `-Ystatistics ` | | -| `-Ystop-after` || -| `-Ystop-before` || -| `-Ytyper-debug` | | +| `-Yskip` || +| `-Ystop-after` || +| `-Ystop-before` || +| `-Ytasty-no-annotations` | | +| `-Ytasty-reader` | | +| `-Ytrack-dependencies` | | | `-Yvalidate-pos` | | -| `-Ywarn-dead-code` | | -| `-Ywarn-numeric-widen` | | -| `-Ywarn-unused:` | | -| `-Ywarn-value-discard` | | - -## Verbose Settings - -Verbose settings were introduced in 2.13. -Most of them are not yet implemented in Scala 3. - -| 2.13.x | 3.3.x | -|-|-| -| `-Vbrowse:` | | -| `-Vclasspath` | `-Ylog-classpath` | -| `-Vdebug-tasty` | | -| `-Vdoc` | | -| `-Vfree-terms` | | -| `-Vfree-types` | | -| `-Vhot-statistics`| | -| `-Vide`| | -| `-Vimplicit-conversions`| | -| `-Vimplicits`| | -| `-Vinline ` | | -| `-Vissue`| | -| `-Vmacro` | | -| `-Vmacro-lite` | | -| `-Vopt ` | | -| `-Vpatmat` | | -| `-Vphases` | | -| `-Vpos`| | -| `-Vprint:` | | -| `-Vlog:` | `-Ylog:`| -| `-Vdebug` | `-Ydebug` | -| `-Vprint-args ` | | -| `-Vprint-pos` | `-Yprint-pos` | -| `-Vprint-types` | `-Xprint-types` | -| `-Vquasiquote` | | -| `-Vreflective-calls` | | -| `-Vreify` | | -| `-Vshow:` | | -| `-Vshow-class ` | | -| `-Vshow-member-pos ` | | -| `-Vshow-object ` | | -| `-Vshow-symkinds` | | -| `-Vshow-symowners` | | -| `-Vstatistics ` | | -| `-Vsymbols` | | -| `-Vtyper` | | - -## Warning Settings - -Warning settings were introduced in 2.13. -Most of them are not yet implemented in Scala 3. - -| 2.13.x | 3.3.x | -|-|-| -| `-Wconf` | | -| `-Wdead-code` | | -| `-Werror` | | -| `-Wextra-implicit` | | -| `-Wmacros:` | | -| `-Wnumeric-widen` | | -| `-Woctal-literal` | | -| `-Wunused:` | | -| `-Wvalue-discard`| | -| `-Wself-implicit` | | ## Compiler Plugins