From 6acb4830cdb388ba8ec76324c9afbd951b2c3b22 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 17 Mar 2025 17:58:22 -0700 Subject: [PATCH] standardize on -Vprint:... (still support -Xprint:... as alias) --- compiler/src/dotty/tools/dotc/Run.scala | 2 +- compiler/src/dotty/tools/dotc/config/CliCommand.scala | 4 ++-- .../src/dotty/tools/dotc/config/ScalaSettings.scala | 2 +- compiler/src/dotty/tools/dotc/core/Phases.scala | 2 +- compiler/src/dotty/tools/dotc/transform/Recheck.scala | 4 ++-- .../test/dotty/tools/dotc/printing/PrintingTest.scala | 2 +- .../dotty/tools/dotc/semanticdb/SemanticdbTests.scala | 2 +- compiler/test/dotty/tools/repl/ReplCompilerTests.scala | 2 +- docs/_docs/contributing/debugging/ide-debugging.md | 2 +- docs/_docs/contributing/debugging/inspection.md | 4 ++-- docs/_docs/contributing/debugging/other-debugging.md | 10 +++++----- docs/_docs/contributing/issues/cause.md | 8 ++++---- docs/_docs/contributing/issues/reproduce.md | 6 +++--- docs/_docs/reference/experimental/cc.md | 2 +- docs/_spec/TODOreference/experimental/cc.md | 2 +- project/scripts/options | 2 +- sbt-test/scala2-compat/i13332/build.sbt | 4 ++-- sbt-test/tasty-compat/add-param-unroll/build.sbt | 2 +- tests/disabled/partest/run/delambdafy_t6028.scala | 2 +- tests/disabled/partest/run/delambdafy_t6555.scala | 2 +- .../partest/run/delambdafy_uncurry_byname_inline.scala | 2 +- .../partest/run/delambdafy_uncurry_byname_method.scala | 2 +- .../partest/run/delambdafy_uncurry_inline.scala | 2 +- .../partest/run/delambdafy_uncurry_method.scala | 2 +- tests/disabled/partest/run/dynamic-applyDynamic.scala | 4 ++-- .../partest/run/dynamic-applyDynamicNamed.scala | 2 +- tests/disabled/partest/run/dynamic-selectDynamic.scala | 2 +- tests/disabled/partest/run/dynamic-updateDynamic.scala | 2 +- tests/disabled/partest/run/existential-rangepos.scala | 2 +- .../partest/run/t4287inferredMethodTypes.scala | 4 ++-- tests/disabled/partest/run/t5603.scala | 2 +- tests/disabled/partest/run/t5699.scala | 2 +- tests/disabled/partest/run/t6028.scala | 2 +- tests/disabled/partest/run/t6288.scala | 2 +- tests/disabled/partest/run/t6555.scala | 2 +- tests/disabled/partest/run/t7271.scala | 2 +- tests/neg/unroll-no-default.scala | 2 +- tests/pending/pos/singleton-infer.scala | 4 ++-- tests/pending/pos/t5777.scala | 2 +- tests/pos/annot-18064.scala | 2 +- tests/pos/i14152.scala | 2 +- tests/pos/i8875.scala | 4 ++-- tests/pos/printbounds.scala | 2 +- tests/pos/test-implicits2.scala | 2 +- tests/pos/typeclass-scaling.scala | 2 +- tests/printing/annot-18064.scala | 2 +- tests/run/inline-numeric/test.scala | 2 +- 47 files changed, 64 insertions(+), 64 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/Run.scala b/compiler/src/dotty/tools/dotc/Run.scala index d0fe07303e41..39b48fc9cf5b 100644 --- a/compiler/src/dotty/tools/dotc/Run.scala +++ b/compiler/src/dotty/tools/dotc/Run.scala @@ -366,7 +366,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint profiler.onPhase(phase): try units = phase.runOn(units) catch case _: InterruptedException => cancelInterrupted() - if (ctx.settings.Xprint.value.containsPhase(phase)) + if (ctx.settings.Vprint.value.containsPhase(phase)) for (unit <- units) def printCtx(unit: CompilationUnit) = phase.printingContext( ctx.fresh.setPhase(phase.next).setCompilationUnit(unit)) diff --git a/compiler/src/dotty/tools/dotc/config/CliCommand.scala b/compiler/src/dotty/tools/dotc/config/CliCommand.scala index a0edb2b8cded..2b5156403157 100644 --- a/compiler/src/dotty/tools/dotc/config/CliCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CliCommand.scala @@ -33,8 +33,8 @@ trait CliCommand: | means one or a comma-separated list of: | - (partial) phase names with an optional "+" suffix to include the next phase | - the string "all" - | example: -Xprint:all prints all phases. - | example: -Xprint:typer,mixin prints the typer and mixin phases. + | example: -Vprint:all prints all phases. + | example: -Vprint:typer,mixin prints the typer and mixin phases. | example: -Ylog:erasure+ logs the erasure phase and the phase after the erasure phase. | This is useful because during the tree transform of phase X, we often | already are in phase X + 1. diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index d2d716769990..cae8698ec081 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -145,7 +145,7 @@ private sealed trait PluginSettings: private sealed trait VerboseSettings: self: SettingGroup => val Vhelp: Setting[Boolean] = BooleanSetting(VerboseSetting, "V", "Print a synopsis of verbose options.") - val Xprint: Setting[List[String]] = PhasesSetting(VerboseSetting, "Vprint", "Print out program after", aliases = List("-Xprint")) + val Vprint: Setting[List[String]] = PhasesSetting(VerboseSetting, "Vprint", "Print out program after", aliases = List("-Xprint")) val XshowPhases: Setting[Boolean] = BooleanSetting(VerboseSetting, "Vphases", "List compiler phases.", aliases = List("-Xshow-phases")) val Vprofile: Setting[Boolean] = BooleanSetting(VerboseSetting, "Vprofile", "Show metrics about sources and internal representations to estimate compile-time complexity.") diff --git a/compiler/src/dotty/tools/dotc/core/Phases.scala b/compiler/src/dotty/tools/dotc/core/Phases.scala index e3351628e43e..2cad765aa9ce 100644 --- a/compiler/src/dotty/tools/dotc/core/Phases.scala +++ b/compiler/src/dotty/tools/dotc/core/Phases.scala @@ -314,7 +314,7 @@ object Phases { * instance, it is possible to print trees after a given phase using: * * ```bash - * $ ./bin/scalac -Xprint: sourceFile.scala + * $ ./bin/scalac -Vprint: sourceFile.scala * ``` */ def phaseName: String diff --git a/compiler/src/dotty/tools/dotc/transform/Recheck.scala b/compiler/src/dotty/tools/dotc/transform/Recheck.scala index 60c36fdbbbb7..34a386b3d821 100644 --- a/compiler/src/dotty/tools/dotc/transform/Recheck.scala +++ b/compiler/src/dotty/tools/dotc/transform/Recheck.scala @@ -184,10 +184,10 @@ abstract class Recheck extends Phase, SymTransformer: /** If true, remember the new types of nodes in this compilation unit * as an attachment in the unit's tpdTree node. By default, this is - * enabled when -Xprint:cc is set. Can be overridden. + * enabled when -Vprint:cc is set. Can be overridden. */ def keepNuTypes(using Context): Boolean = - ctx.settings.Xprint.value.containsPhase(thisPhase) + ctx.settings.Vprint.value.containsPhase(thisPhase) /** A map from NamedTypes to the denotations they had before this phase. * Needed so that we can `reset` them after this phase. diff --git a/compiler/test/dotty/tools/dotc/printing/PrintingTest.scala b/compiler/test/dotty/tools/dotc/printing/PrintingTest.scala index 15522d61e31f..1a8e55b2fdcb 100644 --- a/compiler/test/dotty/tools/dotc/printing/PrintingTest.scala +++ b/compiler/test/dotty/tools/dotc/printing/PrintingTest.scala @@ -27,7 +27,7 @@ class PrintingTest { def options(phase: String, flags: List[String]) = val outDir = ParallelTesting.defaultOutputDir + "printing" + File.pathSeparator File(outDir).mkdirs() - List(s"-Xprint:$phase", "-color:never", "-nowarn", "-d", outDir, "-classpath", TestConfiguration.basicClasspath) ::: flags + List(s"-Vprint:$phase", "-color:never", "-nowarn", "-d", outDir, "-classpath", TestConfiguration.basicClasspath) ::: flags private def compileFile(path: JPath, phase: String): Boolean = { val baseFilePath = path.toString.stripSuffix(".scala") diff --git a/compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala b/compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala index 4db047d0951e..827a997af14b 100644 --- a/compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala +++ b/compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala @@ -138,7 +138,7 @@ class SemanticdbTests: "-feature", "-deprecation", // "-Ydebug-flags", - // "-Xprint:extractSemanticDB", + // "-Vprint:extractSemanticDB", "-sourceroot", expectSrc.toString, "-classpath", target.toString, "-Xignore-scala2-macros", diff --git a/compiler/test/dotty/tools/repl/ReplCompilerTests.scala b/compiler/test/dotty/tools/repl/ReplCompilerTests.scala index d32b28647c32..60ea6f1f139d 100644 --- a/compiler/test/dotty/tools/repl/ReplCompilerTests.scala +++ b/compiler/test/dotty/tools/repl/ReplCompilerTests.scala @@ -523,7 +523,7 @@ object ReplCompilerTests: end ReplCompilerTests -class ReplXPrintTyperTests extends ReplTest(ReplTest.defaultOptions :+ "-Xprint:typer"): +class ReplXPrintTyperTests extends ReplTest(ReplTest.defaultOptions :+ "-Vprint:typer"): @Test def i9111 = initially { run("""|enum E { | case A diff --git a/docs/_docs/contributing/debugging/ide-debugging.md b/docs/_docs/contributing/debugging/ide-debugging.md index 8548235672af..175f7969439c 100644 --- a/docs/_docs/contributing/debugging/ide-debugging.md +++ b/docs/_docs/contributing/debugging/ide-debugging.md @@ -140,7 +140,7 @@ And concatenate the output into the classpath argument, which should already con In the `args` you can add any additional compiler option you want. -For instance you can add `-Xprint:all` to print all the generated trees after each mega phase. +For instance you can add `-Vprint:all` to print all the generated trees after each mega phase. Run `scalac -help` to get an overview of the available compiler options. diff --git a/docs/_docs/contributing/debugging/inspection.md b/docs/_docs/contributing/debugging/inspection.md index 7cb1fa68abff..f1a60da9f905 100644 --- a/docs/_docs/contributing/debugging/inspection.md +++ b/docs/_docs/contributing/debugging/inspection.md @@ -61,9 +61,9 @@ Sometimes you may want to stop the compiler after a certain phase, for example t knock-on errors from occurring from a bug in an earlier phase. Use the flag `-Ystop-after:` to prevent any phases executing afterwards. -> e.g. `-Xprint:` where `phase` is a miniphase, will print after +> e.g. `-Vprint:` where `phase` is a miniphase, will print after > the whole phase group is complete, which may be several miniphases after `phase`. -> Instead you can use `-Ystop-after: -Xprint:` to stop +> Instead you can use `-Ystop-after: -Vprint:` to stop > immediately after the miniphase and see the trees that you intended. ## Printing TASTy of a Class diff --git a/docs/_docs/contributing/debugging/other-debugging.md b/docs/_docs/contributing/debugging/other-debugging.md index db32a25dabd7..d0d0c2431a04 100644 --- a/docs/_docs/contributing/debugging/other-debugging.md +++ b/docs/_docs/contributing/debugging/other-debugging.md @@ -72,19 +72,19 @@ assertPositioned(tree.reporting(s"Tree is: $result")) To print out the trees you are compiling after the FrontEnd (scanner, parser, namer, typer) phases: ```shell -scalac -Xprint:typer ../issues/Playground.scala +scalac -Vprint:typer ../issues/Playground.scala ``` To print out the trees after Frontend and CollectSuperCalls phases: ```shell -scalac -Xprint:typer,collectSuperCalls ../issues/Playground.scala +scalac -Vprint:typer,collectSuperCalls ../issues/Playground.scala ``` To print out the trees after all phases: ```shell -scalac -Xprint:all ../issues/Playground.scala +scalac -Vprint:all ../issues/Playground.scala ``` To find out the list of all the phases and their names, check out [this](https://github.com/scala/scala3/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/Compiler.scala#L34) line in `Compiler.scala`. Each `Phase` object has `phaseName` defined on it, this is the phase name. @@ -154,7 +154,7 @@ And is to be used as: scalac -Yprint-pos ../issues/Playground.scala ``` -If used, all the trees output with `show` or via `-Xprint:typer` will also have positions attached to them, e.g.: +If used, all the trees output with `show` or via `-Vprint:typer` will also have positions attached to them, e.g.: ```scala package @ { @@ -182,7 +182,7 @@ package @ { Every [Positioned](https://github.com/scala/scala3/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/ast/Positioned.scala) (a parent class of `Tree`) object has a `uniqueId` field. It is an integer that is unique for that tree and doesn't change from compile run to compile run. You can output these IDs from any printer (such as the ones used by `.show` and `-Xprint`) via `-Yshow-tree-ids` flag, e.g.: ```shell -scalac -Xprint:typer -Yshow-tree-ids ../issues/Playground.scala +scalac -Vprint:typer -Yshow-tree-ids ../issues/Playground.scala ``` Gives: diff --git a/docs/_docs/contributing/issues/cause.md b/docs/_docs/contributing/issues/cause.md index f96d3b6d2f8a..9f55a174174c 100644 --- a/docs/_docs/contributing/issues/cause.md +++ b/docs/_docs/contributing/issues/cause.md @@ -18,10 +18,10 @@ As described in the [compiler lifecycle](../architecture/lifecycle.md#phases-2), each phase transforms the trees and types that represent your code in a certain way. -To print the code as it is transformed through the compiler, use the compiler flag `-Xprint:all`. +To print the code as it is transformed through the compiler, use the compiler flag `-Vprint:all`. After each phase group is completed, you will see the resulting trees representing the code. -> It is recommended to test `-Xprint:all` on a single, small file, otherwise a lot of unnecessary +> It is recommended to test `-Vprint:all` on a single, small file, otherwise a lot of unnecessary > output will be generated. ### Trace a Tree Creation Site @@ -31,7 +31,7 @@ your search to the code of that phase. For example if you found a problematic tr `posttyper`, the problem most likely appears in the code of [PostTyper]. We can trace the exact point the tree was generated by looking for its unique ID, and then generating a stack trace at its creation: -1. Run the compiler with `-Xprint:posttyper` and `-Yshow-tree-ids` flags. +1. Run the compiler with `-Vprint:posttyper` and `-Yshow-tree-ids` flags. This will only print the trees of the `posttyper` phase. This time you should see the tree in question be printed alongside its ID. You'll see something like `println#223("Hello World"#37)`. 2. Copy the ID of the desired tree. @@ -43,7 +43,7 @@ Do not use a conditional breakpoint, the time overhead is very significant for a ### Enhanced Tree Printing -As seen above `-Xprint:` can be enhanced with further configuration flags, found in +As seen above `-Vprint:` can be enhanced with further configuration flags, found in [ScalaSettings]. For example, you can additionally print the type of a tree with `-Xprint-types`. ## Increasing Logging Output diff --git a/docs/_docs/contributing/issues/reproduce.md b/docs/_docs/contributing/issues/reproduce.md index ae031a44d76f..dd282166bd57 100644 --- a/docs/_docs/contributing/issues/reproduce.md +++ b/docs/_docs/contributing/issues/reproduce.md @@ -39,9 +39,9 @@ $ scalac Here are some useful debugging ``: -* `-Xprint:PHASE1,PHASE2,...` or `-Xprint:all`: prints the `AST` after each +* `-Vprint:PHASE1,PHASE2,...` or `-Vprint:all`: prints the `AST` after each specified phase. Phase names can be found by examining the - `dotty.tools.dotc.transform.*` classes for their `phaseName` field e.g., `-Xprint:erasure`. + `dotty.tools.dotc.transform.*` classes for their `phaseName` field e.g., `-Vprint:erasure`. You can discover all phases in the `dotty.tools.dotc.Compiler` class * `-Ylog:PHASE1,PHASE2,...` or `-Ylog:all`: enables `ctx.log("")` logging for the specified phase. @@ -142,7 +142,7 @@ $ (rm -rv out || true) && mkdir out # clean up compiler output, create `out` dir scalac # Invoke the compiler task defined by the Dotty sbt project -d $here/out # All the artefacts go to the `out` folder created earlier - # -Xprint:typer # Useful debug flags, commented out and ready for quick usage. Should you need one, you can quickly access it by uncommenting it. + # -Vprint:typer # Useful debug flags, commented out and ready for quick usage. Should you need one, you can quickly access it by uncommenting it. # -Ydebug-error # -Yprint-debug # -Yprint-debug-owners diff --git a/docs/_docs/reference/experimental/cc.md b/docs/_docs/reference/experimental/cc.md index ff480ffb638b..131a758c1fc9 100644 --- a/docs/_docs/reference/experimental/cc.md +++ b/docs/_docs/reference/experimental/cc.md @@ -766,7 +766,7 @@ Here, `src` is created as a `Source` on which listeners can be registered that r The following options are relevant for capture checking. - - **-Xprint:cc** Prints the program with capturing types as inferred by capture checking. + - **-Vprint:cc** Prints the program with capturing types as inferred by capture checking. - **-Ycc-debug** Gives more detailed, implementation-oriented information about capture checking, as described in the next section. The implementation supporting capture checking with these options is currently in branch `cc-experiment` on dotty.epfl.ch. diff --git a/docs/_spec/TODOreference/experimental/cc.md b/docs/_spec/TODOreference/experimental/cc.md index 878bc0a64ed6..c2011fbcbc88 100644 --- a/docs/_spec/TODOreference/experimental/cc.md +++ b/docs/_spec/TODOreference/experimental/cc.md @@ -655,7 +655,7 @@ TBD The following options are relevant for capture checking. - **-Ycc** Enables capture checking. - - **-Xprint:cc** Prints the program with capturing types as inferred by capture checking. + - **-Vprint:cc** Prints the program with capturing types as inferred by capture checking. - **-Ycc-debug** Gives more detailed, implementation-oriented information about capture checking, as described in the next section. The implementation supporting capture checking with these options is currently in branch `cc-experiment` on dotty.epfl.ch. diff --git a/project/scripts/options b/project/scripts/options index 86d2c8fd8edb..c4f132d6750a 100644 --- a/project/scripts/options +++ b/project/scripts/options @@ -1,2 +1,2 @@ --Xprint:frontend -Ylog:frontend +-Vprint:frontend -Ylog:frontend -Ycheck:all diff --git a/sbt-test/scala2-compat/i13332/build.sbt b/sbt-test/scala2-compat/i13332/build.sbt index 3d24ba92abe1..1482eca02955 100644 --- a/sbt-test/scala2-compat/i13332/build.sbt +++ b/sbt-test/scala2-compat/i13332/build.sbt @@ -10,5 +10,5 @@ lazy val app = project.in(file("app")) .dependsOn(lib) .settings( scalaVersion := scala3Version, - scalacOptions += "-Xprint:inlining" - ) \ No newline at end of file + scalacOptions += "-Vprint:inlining" + ) diff --git a/sbt-test/tasty-compat/add-param-unroll/build.sbt b/sbt-test/tasty-compat/add-param-unroll/build.sbt index 7ea07075632f..24bf7f140cd1 100644 --- a/sbt-test/tasty-compat/add-param-unroll/build.sbt +++ b/sbt-test/tasty-compat/add-param-unroll/build.sbt @@ -29,7 +29,7 @@ lazy val c = project.in(file("c")) .settings(commonSettings) .settings(printSettings) .settings( - // scalacOptions ++= Seq("-from-tasty", "-Ycheck:readTasty", "-Xfatal-warnings", "-Xprint:readTasty", "-Xprint-types"), + // scalacOptions ++= Seq("-from-tasty", "-Ycheck:readTasty", "-Xfatal-warnings", "-Vprint:readTasty", "-Xprint-types"), // Compile / sources := Seq(new java.io.File("c-input/B.tasty")), Compile / unmanagedClasspath += (ThisBuild / baseDirectory).value / "c-input", Compile / classDirectory := (ThisBuild / baseDirectory).value / "c-output" diff --git a/tests/disabled/partest/run/delambdafy_t6028.scala b/tests/disabled/partest/run/delambdafy_t6028.scala index 0b7ef48c3df8..981b6b759ebc 100644 --- a/tests/disabled/partest/run/delambdafy_t6028.scala +++ b/tests/disabled/partest/run/delambdafy_t6028.scala @@ -3,7 +3,7 @@ import java.io.{Console => _, _} object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Ydelambdafy:method -Xprint:lambdalift -d " + testOutput.path + override def extraSettings: String = "-usejavacp -Ydelambdafy:method -Vprint:lambdalift -d " + testOutput.path override def code = """class T(classParam: Int) { | val field: Int = 0 diff --git a/tests/disabled/partest/run/delambdafy_t6555.scala b/tests/disabled/partest/run/delambdafy_t6555.scala index a1dcfe790c3b..b40e1c0e4faf 100644 --- a/tests/disabled/partest/run/delambdafy_t6555.scala +++ b/tests/disabled/partest/run/delambdafy_t6555.scala @@ -3,7 +3,7 @@ import java.io.{Console => _, _} object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Xprint:specialize -Ydelambdafy:method -d " + testOutput.path + override def extraSettings: String = "-usejavacp -Vprint:specialize -Ydelambdafy:method -d " + testOutput.path override def code = "class Foo { val f = (param: Int) => param } " diff --git a/tests/disabled/partest/run/delambdafy_uncurry_byname_inline.scala b/tests/disabled/partest/run/delambdafy_uncurry_byname_inline.scala index 8f480fa80488..f8729e3c6710 100644 --- a/tests/disabled/partest/run/delambdafy_uncurry_byname_inline.scala +++ b/tests/disabled/partest/run/delambdafy_uncurry_byname_inline.scala @@ -3,7 +3,7 @@ import java.io.{Console => _, _} object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Xprint:uncurry -Ydelambdafy:inline -d " + testOutput.path + override def extraSettings: String = "-usejavacp -Vprint:uncurry -Ydelambdafy:inline -d " + testOutput.path override def code = """class Foo { | def bar(x: => Int) = x diff --git a/tests/disabled/partest/run/delambdafy_uncurry_byname_method.scala b/tests/disabled/partest/run/delambdafy_uncurry_byname_method.scala index 1adeec843390..0c21c232ae2a 100644 --- a/tests/disabled/partest/run/delambdafy_uncurry_byname_method.scala +++ b/tests/disabled/partest/run/delambdafy_uncurry_byname_method.scala @@ -3,7 +3,7 @@ import java.io.{Console => _, _} object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Xprint:uncurry -Ydelambdafy:method -Ystop-after:uncurry -d " + testOutput.path + override def extraSettings: String = "-usejavacp -Vprint:uncurry -Ydelambdafy:method -Ystop-after:uncurry -d " + testOutput.path override def code = """class Foo { | def bar(x: => Int) = x diff --git a/tests/disabled/partest/run/delambdafy_uncurry_inline.scala b/tests/disabled/partest/run/delambdafy_uncurry_inline.scala index b42b65f5bbda..b397189271d9 100644 --- a/tests/disabled/partest/run/delambdafy_uncurry_inline.scala +++ b/tests/disabled/partest/run/delambdafy_uncurry_inline.scala @@ -3,7 +3,7 @@ import java.io.{Console => _, _} object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Xprint:uncurry -Ydelambdafy:inline -d " + testOutput.path + override def extraSettings: String = "-usejavacp -Vprint:uncurry -Ydelambdafy:inline -d " + testOutput.path override def code = """class Foo { | def bar = { diff --git a/tests/disabled/partest/run/delambdafy_uncurry_method.scala b/tests/disabled/partest/run/delambdafy_uncurry_method.scala index a988fb2ee7bf..db2ca7061985 100644 --- a/tests/disabled/partest/run/delambdafy_uncurry_method.scala +++ b/tests/disabled/partest/run/delambdafy_uncurry_method.scala @@ -3,7 +3,7 @@ import java.io.{Console => _, _} object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Xprint:uncurry -Ydelambdafy:method -Ystop-after:uncurry -d " + testOutput.path + override def extraSettings: String = "-usejavacp -Vprint:uncurry -Ydelambdafy:method -Ystop-after:uncurry -d " + testOutput.path override def code = """class Foo { | def bar = { diff --git a/tests/disabled/partest/run/dynamic-applyDynamic.scala b/tests/disabled/partest/run/dynamic-applyDynamic.scala index b06041194c1e..65457a8b7b42 100644 --- a/tests/disabled/partest/run/dynamic-applyDynamic.scala +++ b/tests/disabled/partest/run/dynamic-applyDynamic.scala @@ -3,7 +3,7 @@ import scala.tools.partest.DirectTest object Test extends DirectTest { override def extraSettings: String = - s"-usejavacp -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" + s"-usejavacp -Xprint-pos -Vprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" override def code = """ object X { @@ -23,4 +23,4 @@ object Test extends DirectTest { import language.dynamics class D extends Dynamic { def applyDynamic(name: String)(value: Any) = ??? -} \ No newline at end of file +} diff --git a/tests/disabled/partest/run/dynamic-applyDynamicNamed.scala b/tests/disabled/partest/run/dynamic-applyDynamicNamed.scala index cc59f9058be9..929485982d82 100644 --- a/tests/disabled/partest/run/dynamic-applyDynamicNamed.scala +++ b/tests/disabled/partest/run/dynamic-applyDynamicNamed.scala @@ -3,7 +3,7 @@ import scala.tools.partest.DirectTest object Test extends DirectTest { override def extraSettings: String = - s"-usejavacp -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" + s"-usejavacp -Xprint-pos -Vprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" override def code = """ object X { diff --git a/tests/disabled/partest/run/dynamic-selectDynamic.scala b/tests/disabled/partest/run/dynamic-selectDynamic.scala index bd6c138c5002..2b92bcbb7cdd 100644 --- a/tests/disabled/partest/run/dynamic-selectDynamic.scala +++ b/tests/disabled/partest/run/dynamic-selectDynamic.scala @@ -3,7 +3,7 @@ import scala.tools.partest.DirectTest object Test extends DirectTest { override def extraSettings: String = - s"-usejavacp -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" + s"-usejavacp -Xprint-pos -Vprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" override def code = """ object X { diff --git a/tests/disabled/partest/run/dynamic-updateDynamic.scala b/tests/disabled/partest/run/dynamic-updateDynamic.scala index 80fe0ea35f4c..5d1518550f39 100644 --- a/tests/disabled/partest/run/dynamic-updateDynamic.scala +++ b/tests/disabled/partest/run/dynamic-updateDynamic.scala @@ -3,7 +3,7 @@ import scala.tools.partest.DirectTest object Test extends DirectTest { override def extraSettings: String = - s"-usejavacp -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" + s"-usejavacp -Xprint-pos -Vprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" override def code = """ object X { diff --git a/tests/disabled/partest/run/existential-rangepos.scala b/tests/disabled/partest/run/existential-rangepos.scala index 7d2b0810d342..50335ac62cea 100644 --- a/tests/disabled/partest/run/existential-rangepos.scala +++ b/tests/disabled/partest/run/existential-rangepos.scala @@ -1,7 +1,7 @@ import scala.tools.partest._ object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Yrangepos -Xprint:patmat -Xprint-pos -d " + testOutput.path + override def extraSettings: String = "-usejavacp -Yrangepos -Vprint:patmat -Xprint-pos -d " + testOutput.path override def code = """ abstract class A[T] { diff --git a/tests/disabled/partest/run/t4287inferredMethodTypes.scala b/tests/disabled/partest/run/t4287inferredMethodTypes.scala index f14e672da88a..cc9c057899ad 100644 --- a/tests/disabled/partest/run/t4287inferredMethodTypes.scala +++ b/tests/disabled/partest/run/t4287inferredMethodTypes.scala @@ -3,7 +3,7 @@ import scala.tools.partest.DirectTest object Test extends DirectTest { override def extraSettings: String = - s"-usejavacp -Yinfer-argument-types -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" + s"-usejavacp -Yinfer-argument-types -Xprint-pos -Vprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" override def code = """ class A(a: Int = A.a) @@ -22,4 +22,4 @@ class B extends A { compile() } } -} \ No newline at end of file +} diff --git a/tests/disabled/partest/run/t5603.scala b/tests/disabled/partest/run/t5603.scala index 77c2775cc353..c047fe7896b5 100644 --- a/tests/disabled/partest/run/t5603.scala +++ b/tests/disabled/partest/run/t5603.scala @@ -7,7 +7,7 @@ import scala.tools.nsc.reporters.ConsoleReporter object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Xprint:parser -Ystop-after:parser -d " + testOutput.path + override def extraSettings: String = "-usejavacp -Vprint:parser -Ystop-after:parser -d " + testOutput.path override def code = """ trait Greeting { diff --git a/tests/disabled/partest/run/t5699.scala b/tests/disabled/partest/run/t5699.scala index ec3b1d26b490..bdcdfed93583 100755 --- a/tests/disabled/partest/run/t5699.scala +++ b/tests/disabled/partest/run/t5699.scala @@ -7,7 +7,7 @@ object Test extends DirectTest { |public @interface MyAnnotation { String value(); } """.stripMargin - override def extraSettings: String = "-usejavacp -Ystop-after:typer -Xprint:parser" + override def extraSettings: String = "-usejavacp -Ystop-after:typer -Vprint:parser" override def show(): Unit = { // redirect err to out, for logging diff --git a/tests/disabled/partest/run/t6028.scala b/tests/disabled/partest/run/t6028.scala index a6f920c5bb67..6e4e179f1dfd 100644 --- a/tests/disabled/partest/run/t6028.scala +++ b/tests/disabled/partest/run/t6028.scala @@ -3,7 +3,7 @@ import java.io.{Console => _, _} object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Ydelambdafy:inline -Xprint:lambdalift -d " + testOutput.path + override def extraSettings: String = "-usejavacp -Ydelambdafy:inline -Vprint:lambdalift -d " + testOutput.path override def code = """class T(classParam: Int) { | val field: Int = 0 diff --git a/tests/disabled/partest/run/t6288.scala b/tests/disabled/partest/run/t6288.scala index cf5865e95a0e..242555ac75a5 100644 --- a/tests/disabled/partest/run/t6288.scala +++ b/tests/disabled/partest/run/t6288.scala @@ -3,7 +3,7 @@ import java.io.{Console => _, _} object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Xprint:patmat -Xprint-pos -d " + testOutput.path + override def extraSettings: String = "-usejavacp -Vprint:patmat -Xprint-pos -d " + testOutput.path override def code = """ diff --git a/tests/disabled/partest/run/t6555.scala b/tests/disabled/partest/run/t6555.scala index cc0e4d1bfadb..e1db058da1d7 100644 --- a/tests/disabled/partest/run/t6555.scala +++ b/tests/disabled/partest/run/t6555.scala @@ -3,7 +3,7 @@ import java.io.{Console => _, _} object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Xprint:specialize -Ydelambdafy:inline -d " + testOutput.path + override def extraSettings: String = "-usejavacp -Vprint:specialize -Ydelambdafy:inline -d " + testOutput.path override def code = "class Foo { val f = (param: Int) => param } " diff --git a/tests/disabled/partest/run/t7271.scala b/tests/disabled/partest/run/t7271.scala index 69d5ea377ea4..6eadb7816c0e 100644 --- a/tests/disabled/partest/run/t7271.scala +++ b/tests/disabled/partest/run/t7271.scala @@ -7,7 +7,7 @@ import scala.reflect.internal.Positions object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Xprint:parser -Ystop-after:parser -d " + testOutput.path + override def extraSettings: String = "-usejavacp -Vprint:parser -Ystop-after:parser -d " + testOutput.path override def code = """ class C { diff --git a/tests/neg/unroll-no-default.scala b/tests/neg/unroll-no-default.scala index 1058f34087e3..4529bc79f815 100644 --- a/tests/neg/unroll-no-default.scala +++ b/tests/neg/unroll-no-default.scala @@ -1,4 +1,4 @@ -//> using options -experimental -Xprint:unrollDefs +//> using options -experimental -Vprint:unrollDefs import scala.annotation.unroll diff --git a/tests/pending/pos/singleton-infer.scala b/tests/pending/pos/singleton-infer.scala index 72e00baf3aab..adccba97cb57 100644 --- a/tests/pending/pos/singleton-infer.scala +++ b/tests/pending/pos/singleton-infer.scala @@ -1,8 +1,8 @@ -//> using options -Xprint:typer -language:experimental.modularity -source future +//> using options -Vprint:typer -language:experimental.modularity -source future def f1[S, T <: S : Singleton](x: S) = () def f2[S, T >: S : Singleton](x: S) = () def Test = f1(42) // f1[Int, Singleton & Int] // should infer (42 : Int) or throw an error? - f2(42) // f2[(42 : Int), (42 : Int)] \ No newline at end of file + f2(42) // f2[(42 : Int), (42 : Int)] diff --git a/tests/pending/pos/t5777.scala b/tests/pending/pos/t5777.scala index 24cea3616346..0d703b5fcce0 100644 --- a/tests/pending/pos/t5777.scala +++ b/tests/pending/pos/t5777.scala @@ -23,7 +23,7 @@ object MyApp { val r1 = new Poly[BigInt.type](BigInt) (null.asInstanceOf[BigInt.E] : r1.ring.E) - // Oddly, -Xprint:typer reports that r and r1 have the same inferred type. + // Oddly, -Vprint:typer reports that r and r1 have the same inferred type. // // private[this] val r: Poly[BigInt.type] = new Poly[BigInt.type](BigInt); // def r: Poly[BigInt.type] = MyApp.this.r; diff --git a/tests/pos/annot-18064.scala b/tests/pos/annot-18064.scala index b6a67ea9ebe7..465f627ff861 100644 --- a/tests/pos/annot-18064.scala +++ b/tests/pos/annot-18064.scala @@ -1,4 +1,4 @@ -//> using options "-Xprint:typer" +//> using options "-Vprint:typer" class myAnnot[T]() extends annotation.Annotation diff --git a/tests/pos/i14152.scala b/tests/pos/i14152.scala index 2377d5ffeae3..d72180a7b5d4 100644 --- a/tests/pos/i14152.scala +++ b/tests/pos/i14152.scala @@ -25,6 +25,6 @@ def foo[F[_]](fn: [A] => Inv[A] => F[A]) = object O1 extends AnyRef val res0 = fn(new Inv(fn(new Inv[O1.type](O1)))) val res1: F[F[O1.type]] = res0 - res1 // checked with -Xprint:typer that this widens to Any + res1 // checked with -Vprint:typer that this widens to Any // instead of the original F[F[O1.type]] // or the incorrectly avoided F[? <: F[? <: Object]] diff --git a/tests/pos/i8875.scala b/tests/pos/i8875.scala index c0de263417e0..e4ac9e057f64 100644 --- a/tests/pos/i8875.scala +++ b/tests/pos/i8875.scala @@ -1,7 +1,7 @@ -//> using options -Xprint:getters +//> using options -Vprint:getters class A { extension (a: Int) { def foo: Int = 1 } -} \ No newline at end of file +} diff --git a/tests/pos/printbounds.scala b/tests/pos/printbounds.scala index a3db104f4a33..87e74da90dc9 100644 --- a/tests/pos/printbounds.scala +++ b/tests/pos/printbounds.scala @@ -5,7 +5,7 @@ class Test { val x: Tree[_] = ??? - val y = x // With -Xprint:typer this should print val x: Tree[_] = x + val y = x // With -Vprint:typer this should print val x: Tree[_] = x // used to print Tree[Nothing], which is confusing. } diff --git a/tests/pos/test-implicits2.scala b/tests/pos/test-implicits2.scala index 6d744395902e..7849c06e6dd1 100644 --- a/tests/pos/test-implicits2.scala +++ b/tests/pos/test-implicits2.scala @@ -1,6 +1,6 @@ /* Compile with - dotc implicits2.scala -Xprint:typer -Xprint-types -verbose + dotc implicits2.scala -Vprint:typer -Xprint-types -verbose and verify that the inserted wrapString comes from Predef. You should see diff --git a/tests/pos/typeclass-scaling.scala b/tests/pos/typeclass-scaling.scala index 0db663de4989..8f2e5381c6f6 100644 --- a/tests/pos/typeclass-scaling.scala +++ b/tests/pos/typeclass-scaling.scala @@ -5,7 +5,7 @@ import scala.annotation.tailrec // The following command: // -// sc typeclass-scaling.scala -Xmax-inlines 100 -Xprint:typer -color:never -pagewidth 1000 >& x +// sc typeclass-scaling.scala -Xmax-inlines 100 -Vprint:typer -color:never -pagewidth 1000 >& x // // produces an output file with `wc` measures (lines/words/chars): // diff --git a/tests/printing/annot-18064.scala b/tests/printing/annot-18064.scala index b6a67ea9ebe7..465f627ff861 100644 --- a/tests/printing/annot-18064.scala +++ b/tests/printing/annot-18064.scala @@ -1,4 +1,4 @@ -//> using options "-Xprint:typer" +//> using options "-Vprint:typer" class myAnnot[T]() extends annotation.Annotation diff --git a/tests/run/inline-numeric/test.scala b/tests/run/inline-numeric/test.scala index 9ca88aee0374..b77e8f3a4266 100644 --- a/tests/run/inline-numeric/test.scala +++ b/tests/run/inline-numeric/test.scala @@ -29,7 +29,7 @@ object tests: def a: Int = 0 def b: Int = 1 - val v1 = foo(a, b) // should be a + b * b // can check with -Xprint:inlining + val v1 = foo(a, b) // should be a + b * b // can check with -Vprint:inlining val v2 = foo(a.toShort, b.toShort) // should be a + b * b val v3 = div(BigDecimal(a), BigDecimal(b))(using BigDecimalAsIfIntegral) // should be BigDecimal(a) quot BigDecimal(b) remainder BigDecimal(b)