diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a9af880284cf..d008d09319f4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -100,7 +100,7 @@ jobs: - name: Add SBT proxy repositories run: cp -vf .github/workflows/repositories /root/.sbt/ ; true - - name: Test + - name: Cmd Tests run: | ./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-dotty/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test" ./project/scripts/bootstrapCmdTests diff --git a/.github/workflows/scaladoc.yaml b/.github/workflows/scaladoc.yaml index f91c51b85c85..ac080a30a45d 100644 --- a/.github/workflows/scaladoc.yaml +++ b/.github/workflows/scaladoc.yaml @@ -35,6 +35,9 @@ jobs: with: java-version: 11 + - name: Compile and test scala3doc-js + run: ./project/scripts/sbt scaladoc-js/test + - name: Compile and test run: ./project/scripts/sbt scaladoc/test @@ -66,7 +69,7 @@ jobs: DOC_DEST=pr-${PR_NUMBER:-${GITHUB_REF##*/}} echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container - az storage blob sync -s scaladoc/output -c $DOC_DEST --account-name scala3docstorage + az storage blob upload-batch -s scaladoc/output -d $DOC_DEST --account-name scala3docstorage community-docs: env: diff --git a/.gitignore b/.gitignore index ba47c2dd4cb3..3cdfd112b86d 100644 --- a/.gitignore +++ b/.gitignore @@ -89,5 +89,9 @@ community-build/sbt-scalajs-sbt *.check.out !/dist/bin/ +# semanticdb test output files +*.expect.scala.out +*.expect.out + # Bloop .bsp diff --git a/bench-run/src/main/scala/dotty/tools/benchmarks/tuples/TupleOps.scala b/bench-run/src/main/scala/dotty/tools/benchmarks/tuples/TupleOps.scala index fa6fb63e73ad..ac96509d233d 100644 --- a/bench-run/src/main/scala/dotty/tools/benchmarks/tuples/TupleOps.scala +++ b/bench-run/src/main/scala/dotty/tools/benchmarks/tuples/TupleOps.scala @@ -50,7 +50,7 @@ class TupleOps { def tupleMergeSort(tuple: Tuple): Tuple = if (tuple.size <= 1) tuple else { - val (tuple1, tuple2) = tuple.splitAt(tuple.size / 2) + val (tuple1, tuple2) = tuple.splitAt(tuple.size / 2): (Tuple, Tuple)// TODO remove ascriptions (issue with type variable constraints) val (sorted1, sorted2) = (tupleMergeSort(tuple1), tupleMergeSort(tuple2)) tupleMerge(sorted1, sorted2) } diff --git a/bench/tests/Vector.scala b/bench/tests/Vector.scala index eb9ed309f179..fd9f8c10abb3 100644 --- a/bench/tests/Vector.scala +++ b/bench/tests/Vector.scala @@ -12,7 +12,7 @@ package immutable import scala.annotation.unchecked.uncheckedVariance import scala.compat.Platform -import scala.collection.generic._ +import scala.collection.generic.* import scala.collection.mutable.Builder import compiletime.uninitialized diff --git a/bench/tests/power-macro/PowerInlined-1.scala b/bench/tests/power-macro/PowerInlined-1.scala index f0b575d9245a..2993004af9cd 100644 --- a/bench/tests/power-macro/PowerInlined-1.scala +++ b/bench/tests/power-macro/PowerInlined-1.scala @@ -1,5 +1,5 @@ object PowerInlined { - import PowerMacro._ + import PowerMacro.* power(1, 5.0) // 1 quotes to unpickle } \ No newline at end of file diff --git a/bench/tests/power-macro/PowerInlined.scala b/bench/tests/power-macro/PowerInlined.scala index f0b575d9245a..2993004af9cd 100644 --- a/bench/tests/power-macro/PowerInlined.scala +++ b/bench/tests/power-macro/PowerInlined.scala @@ -1,5 +1,5 @@ object PowerInlined { - import PowerMacro._ + import PowerMacro.* power(1, 5.0) // 1 quotes to unpickle } \ No newline at end of file diff --git a/bin/scalad b/bin/scaladoc similarity index 59% rename from bin/scalad rename to bin/scaladoc index 43693684ea70..11a754c6579f 100755 --- a/bin/scalad +++ b/bin/scaladoc @@ -2,4 +2,4 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.." -"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/scalad" "$@" +"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/scaladoc" "$@" diff --git a/build.sbt b/build.sbt index f4701a1034bf..bb38cd7418cb 100644 --- a/build.sbt +++ b/build.sbt @@ -1,8 +1,6 @@ val scala3 = Build.scala3 val `scala3-bootstrapped` = Build.`scala3-bootstrapped` val `scala3-interfaces` = Build.`scala3-interfaces` -val `scala3-doc` = Build.`scala3-doc` -val `scala3-doc-bootstrapped` = Build.`scala3-doc-bootstrapped` val `scala3-compiler` = Build.`scala3-compiler` val `scala3-compiler-bootstrapped` = Build.`scala3-compiler-bootstrapped` val `scala3-library` = Build.`scala3-library` @@ -12,6 +10,7 @@ val `scala3-sbt-bridge` = Build.`scala3-sbt-bridge` val `scala3-sbt-bridge-tests` = Build.`scala3-sbt-bridge-tests` val `scala3-staging` = Build.`scala3-staging` val `scala3-tasty-inspector` = Build.`scala3-tasty-inspector` +val `scala3-tasty-inspector-nonbootstrapped` = Build.`scala3-tasty-inspector-nonbootstrapped` val `scala3-language-server` = Build.`scala3-language-server` val `scala3-bench` = Build.`scala3-bench` val `scala3-bench-bootstrapped` = Build.`scala3-bench-bootstrapped` @@ -21,6 +20,7 @@ val `tasty-core` = Build.`tasty-core` val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped` val `tasty-core-scala2` = Build.`tasty-core-scala2` val scaladoc = Build.scaladoc +val `scaladoc-nonBootstrapped` = Build.`scaladoc-nonBootstrapped` val `scaladoc-testcases` = Build.`scaladoc-testcases` val `scaladoc-js` = Build.`scaladoc-js` val `scala3-bench-run` = Build.`scala3-bench-run` diff --git a/community-build/community-projects/geny b/community-build/community-projects/geny index 03ff552cd384..c511f4ad1ae2 160000 --- a/community-build/community-projects/geny +++ b/community-build/community-projects/geny @@ -1 +1 @@ -Subproject commit 03ff552cd3846939e1686481b3623ea6d06d1d24 +Subproject commit c511f4ad1ae2adf94bd55691bd8b4afed41213fc diff --git a/community-build/community-projects/izumi-reflect b/community-build/community-projects/izumi-reflect index c368dcc9025b..54051d0bca92 160000 --- a/community-build/community-projects/izumi-reflect +++ b/community-build/community-projects/izumi-reflect @@ -1 +1 @@ -Subproject commit c368dcc9025b455944e797dffa1b78d3ecf83752 +Subproject commit 54051d0bca921706ef0a3f9f63264f6f57d50ef0 diff --git a/community-build/community-projects/munit b/community-build/community-projects/munit index 33b73b2d1009..3c9b71d7a087 160000 --- a/community-build/community-projects/munit +++ b/community-build/community-projects/munit @@ -1 +1 @@ -Subproject commit 33b73b2d100984c3510c7d30d91817633c3df5f7 +Subproject commit 3c9b71d7a087015e95411534aaaf6d92cbbbfbc3 diff --git a/community-build/community-projects/scalatest b/community-build/community-projects/scalatest index 69e29ed19e6f..e58ec52f69df 160000 --- a/community-build/community-projects/scalatest +++ b/community-build/community-projects/scalatest @@ -1 +1 @@ -Subproject commit 69e29ed19e6fe12e9acf6f748d0693bdd957cfd0 +Subproject commit e58ec52f69df080972a93386f849f33f18e83596 diff --git a/community-build/community-projects/shapeless b/community-build/community-projects/shapeless index 3058735a54a2..bfa5dba99d64 160000 --- a/community-build/community-projects/shapeless +++ b/community-build/community-projects/shapeless @@ -1 +1 @@ -Subproject commit 3058735a54a23df67246ecce5b09f6a6cd3dfaec +Subproject commit bfa5dba99d6402336a1fbaf687f5cb29b3e78fe2 diff --git a/community-build/community-projects/upickle b/community-build/community-projects/upickle index bee9cc1d4276..52e388109f3a 160000 --- a/community-build/community-projects/upickle +++ b/community-build/community-projects/upickle @@ -1 +1 @@ -Subproject commit bee9cc1d42768f5f578ee8855eb9c1e4d0f70080 +Subproject commit 52e388109f3a03f63795e0aa9b17cf6453eac69d diff --git a/community-build/community-projects/utest b/community-build/community-projects/utest index 654376f41f83..f1ca7b12897f 160000 --- a/community-build/community-projects/utest +++ b/community-build/community-projects/utest @@ -1 +1 @@ -Subproject commit 654376f41f8380a44fdb70f693016f25633ae1be +Subproject commit f1ca7b12897f0fedccc757c17552ebbade72c6a2 diff --git a/community-build/src/scala/dotty/communitybuild/Main.scala b/community-build/src/scala/dotty/communitybuild/Main.scala index a4f56a8ac0c7..9709c22493dd 100644 --- a/community-build/src/scala/dotty/communitybuild/Main.scala +++ b/community-build/src/scala/dotty/communitybuild/Main.scala @@ -19,10 +19,36 @@ object Main: e.printStackTrace() Nil + def withProjects[T](names: Seq[String], opName: String)(op: CommunityProject => T): Seq[T] = + val missing = names.filterNot(projectMap.contains) + if missing.nonEmpty then + val allNames = allProjects.map(_.project).mkString(", ") + println(s"Missing projects: ${missing.mkString(", ")}. All projects: $allNames") + sys.exit(1) + + val (failed, completed) = names.flatMap(projectMap.apply).partitionMap( o => + try + Right(op(o)) + catch case e: Throwable => + e.printStackTrace() + Left(o) + ) + + if failed.nonEmpty then + println(s"$opName failed for ${failed.mkString(", ")}") + sys.exit(1) + + completed + /** Allows running various commands on community build projects. */ def main(args: Array[String]): Unit = args.toList match - case "publish" :: name :: Nil => + case "publish" :: names if names.nonEmpty => + withProjects(names, "Publishing")(_.publish()) + + case "build" :: names if names.nonEmpty => + withProjects(names, "Build")(_.build()) + case "doc" :: "all" :: destStr :: Nil => val dest = Paths.get(destStr) Seq("rm", "-rf", destStr).! @@ -66,26 +92,23 @@ object Main: sys.exit(1) case "doc" :: names if names.nonEmpty => - val missing = names.filterNot(projectMap.contains) - if missing.nonEmpty then - println(s"Missing projects: ${missing.mkString(", ")}. All projects: ${allProjects.mkString(", ")}") - sys.exit(1) - - val failed = names.filter{ p => - val docsRoots = generateDocs(projectMap(p)) + val failed = withProjects(names, "Documenting"){ p => + val docsRoots = generateDocs(p) + println(docsRoots) if docsRoots.nonEmpty then println(s"Docs for $p generated in $docsRoots") - docsRoots.isEmpty - } + if docsRoots.isEmpty then Some(p.project) else None + }.flatten + if failed.nonEmpty then println(s"Documentation not found for ${failed.mkString(", ")}") sys.exit(1) case args => println("USAGE: ") - println("COMMAND is one of: publish doc") + println("COMMAND is one of: publish doc run") println("Available projects are:") allProjects.foreach { k => - println(s"\t$k") + println(s"\t${k.project}") } sys.exit(1) diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index 4e4649caed1a..8c6ba7873a88 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -84,16 +84,24 @@ sealed trait CommunityProject: if exitCode != 0 then throw RuntimeException(s"Doc command exited with code $exitCode for project $project. Project details:\n$this") + final def build(): Int = exec(projectDir, binaryName, buildCommands: _*) + + final def buildCommands = runCommandsArgs :+ testCommand + end CommunityProject final case class MillCommunityProject( project: String, baseCommand: String, - dependencies: List[CommunityProject] = Nil) extends CommunityProject: + dependencies: List[CommunityProject] = Nil, + ignoreDocs: Boolean = false, + ) extends CommunityProject: override val binaryName: String = "./mill" override val testCommand = s"$baseCommand.test" override val publishCommand = s"$baseCommand.publishLocal" override val docCommand = null + // uncomment once mill is released + // if ignoreDocs then null else s"$baseCommand.docJar" override val runCommandsArgs = List("-i", "-D", s"dottyVersion=$compilerVersion") final case class SbtCommunityProject( @@ -160,10 +168,9 @@ final case class SbtCommunityProject( """set testOptions in Global += Tests.Argument(TestFramework("munit.Framework"), "+l"); """ ++ s"$baseCommand$sbtTestCommand" - override val publishCommand = if sbtPublishCommand eq null then null else - val disableDocCommand = - if sbtDocCommand eq null then "" else "set every useScaladoc := false;" - s"$baseCommand$disableDocCommand$sbtPublishCommand" + override val publishCommand = + if sbtPublishCommand eq null then null else s"$baseCommand$sbtPublishCommand" + override val docCommand = if sbtDocCommand eq null then null else val cmd = if sbtDocCommand.startsWith(";") then sbtDocCommand else s";$sbtDocCommand" @@ -175,7 +182,7 @@ final case class SbtCommunityProject( case Some(ivyHome) => List(s"-Dsbt.ivy.home=$ivyHome") case _ => Nil extraSbtArgs ++ sbtProps ++ List( - "-sbt-version", "1.4.4", + "-sbt-version", "1.4.7", "-Dsbt.supershell=false", s"--addPluginSbtFile=$sbtPluginFilePath" ) @@ -195,11 +202,13 @@ object projects: lazy val utest = MillCommunityProject( project = "utest", baseCommand = s"utest.jvm[$compilerVersion]", + ignoreDocs = true ) lazy val sourcecode = MillCommunityProject( project = "sourcecode", baseCommand = s"sourcecode.jvm[$compilerVersion]", + ignoreDocs = true ) lazy val oslib = MillCommunityProject( @@ -211,7 +220,8 @@ object projects: lazy val oslibWatch = MillCommunityProject( project = "os-lib", baseCommand = s"os.watch[$compilerVersion]", - dependencies = List(utest, sourcecode) + dependencies = List(utest, sourcecode), + ignoreDocs = true ) lazy val ujson = MillCommunityProject( @@ -241,13 +251,15 @@ object projects: lazy val fansi = MillCommunityProject( project = "fansi", baseCommand = s"fansi.jvm[$compilerVersion]", - dependencies = List(utest, sourcecode) + dependencies = List(utest, sourcecode), + ignoreDocs = true ) lazy val pprint = MillCommunityProject( project = "PPrint", baseCommand = s"pprint.jvm[$compilerVersion]", - dependencies = List(fansi) + dependencies = List(fansi), + ignoreDocs = true ) lazy val requests = MillCommunityProject( @@ -409,7 +421,7 @@ object projects: sbtTestCommand = "testsJVM/test;testsJS/test;", // Hardcode the version to avoid having to deal with something set by sbt-dynver sbtPublishCommand = s"""set every version := "${Versions.munit}"; munitJVM/publishLocal; munitJS/publishLocal; munitScalacheckJVM/publishLocal; munitScalacheckJS/publishLocal; junit/publishLocal""", - sbtDocCommand = "munitJVM/doc", + sbtDocCommand = "junit/doc; munitJVM/doc", dependencies = List(scalacheck) ) @@ -627,7 +639,7 @@ object projects: sbtPublishCommand = "publishLocal", dependencies = List(scalatest) ) - + lazy val perspective = SbtCommunityProject( project = "perspective", // No library with easy typeclasses to verify data against exist for Dotty, so no tests yet @@ -702,4 +714,4 @@ def allProjects = List( projects.perspective, ) -lazy val projectMap = allProjects.map(p => p.project -> p).toMap +lazy val projectMap = allProjects.groupBy(_.project) diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index d8a0c9f57f8d..3d219c2648a5 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -22,7 +22,7 @@ abstract class CommunityBuildTest: */ extension (self: CommunityProject) def run()(using suite: CommunityBuildTest) = self.dependencies.foreach(_.publish()) - suite.test(self.project, self.binaryName, self.runCommandsArgs :+ self.testCommand) + suite.test(self) /** Build the given project with the published local compiler and sbt plugin. * @@ -34,10 +34,14 @@ abstract class CommunityBuildTest: * a build tool like SBT or Mill * @param arguments Arguments to pass to the testing program */ - def test(project: String, command: String, arguments: Seq[String]): Unit = { + def test(projectDef: CommunityProject): Unit = { + val project = projectDef.project + val command = projectDef.binaryName + val arguments = projectDef.buildCommands + @annotation.tailrec - def execTimes(task: => Int, timesToRerun: Int): Boolean = - val exitCode = task + def execTimes(task: () => Int, timesToRerun: Int): Boolean = + val exitCode = task() if exitCode == 0 then true else if timesToRerun == 0 @@ -60,7 +64,7 @@ abstract class CommunityBuildTest: |""".stripMargin) } - val testsCompletedSuccessfully = execTimes(exec(projectDir, command, arguments: _*), 3) + val testsCompletedSuccessfully = execTimes(projectDef.build, 3) if (!testsCompletedSuccessfully) { fail(s""" diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala b/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala index 8dbf0d24d0d5..614548ff361e 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala @@ -50,6 +50,7 @@ trait BCodeIdiomatic { case "14" => asm.Opcodes.V14 case "15" => asm.Opcodes.V15 case "16" => asm.Opcodes.V16 + case "17" => asm.Opcodes.V17 } lazy val majorVersion: Int = (classfileVersion & 0xFF) diff --git a/compiler/src/dotty/tools/dotc/CompilationUnit.scala b/compiler/src/dotty/tools/dotc/CompilationUnit.scala index 657ef01c3bb3..a4f219c88510 100644 --- a/compiler/src/dotty/tools/dotc/CompilationUnit.scala +++ b/compiler/src/dotty/tools/dotc/CompilationUnit.scala @@ -38,15 +38,26 @@ class CompilationUnit protected (val source: SourceFile) { */ val freshNames: FreshNameCreator = new FreshNameCreator.Default + /** Will be set to `true` if there are inline call that must be inlined after typer. + * The information is used in phase `Inlining` in order to avoid traversing trees that need no transformations. + */ + var needsInlining: Boolean = false + /** Will be set to `true` if contains `Quote`. * The information is used in phase `Staging` in order to avoid traversing trees that need no transformations. */ var needsStaging: Boolean = false + /** Will be set to `true` if contains `Quote` that needs to be pickled + * The information is used in phase `PickleQuotes` in order to avoid traversing trees that need no transformations. + */ + var needsQuotePickling: Boolean = false + /** A structure containing a temporary map for generating inline accessors */ val inlineAccessors: InlineAccessors = new InlineAccessors var suspended: Boolean = false + var suspendedAtInliningPhase: Boolean = false /** Can this compilation unit be suspended */ def isSuspendable: Boolean = true @@ -61,6 +72,8 @@ class CompilationUnit protected (val source: SourceFile) { report.echo(i"suspended: $this") suspended = true ctx.run.suspendedUnits += this + if ctx.phase == Phases.inliningPhase then + suspendedAtInliningPhase = true throw CompilationUnit.SuspendException() private var myAssignmentSpans: Map[Int, List[Span]] = null @@ -90,7 +103,9 @@ object CompilationUnit { if (forceTrees) { val force = new Force force.traverse(unit1.tpdTree) - unit1.needsStaging = force.needsStaging + unit1.needsStaging = force.containsQuote + unit1.needsQuotePickling = force.containsQuote + unit1.needsInlining = force.containsInline } unit1 } @@ -116,10 +131,13 @@ object CompilationUnit { /** Force the tree to be loaded */ private class Force extends TreeTraverser { - var needsStaging = false + var containsQuote = false + var containsInline = false def traverse(tree: Tree)(using Context): Unit = { if (tree.symbol.isQuote) - needsStaging = true + containsQuote = true + if tree.symbol.is(Flags.Inline) then + containsInline = true traverseChildren(tree) } } diff --git a/compiler/src/dotty/tools/dotc/Compiler.scala b/compiler/src/dotty/tools/dotc/Compiler.scala index f24df22d673d..3971cc4468be 100644 --- a/compiler/src/dotty/tools/dotc/Compiler.scala +++ b/compiler/src/dotty/tools/dotc/Compiler.scala @@ -50,6 +50,7 @@ class Compiler { /** Phases dealing with TASTY tree pickling and unpickling */ protected def picklerPhases: List[List[Phase]] = List(new Pickler) :: // Generate TASTY info + List(new Inlining) :: // Inline and execute macros List(new PickleQuotes) :: // Turn quoted trees into explicit run-time data structures Nil @@ -61,6 +62,7 @@ class Compiler { new CookComments, // Cook the comments: expand variables, doc, etc. new CheckStatic, // Check restrictions that apply to @static members new BetaReduce, // Reduce closure applications + new InlineVals, // Check right hand-sides of an `inline val`s new ExpandSAMs, // Expand single abstract method closures to anonymous classes new init.Checker) :: // Check initialization of objects List(new ElimRepeated, // Rewrite vararg parameters and arguments @@ -93,7 +95,7 @@ class Compiler { new FunctionXXLForwarders, // Add forwarders for FunctionXXL apply method new ParamForwarding, // Add forwarders for aliases of superclass parameters new TupleOptimizations, // Optimize generic operations on tuples - new LetOverApply, // Lift blocks from receivers of applications + new LetOverApply, // Lift blocks from receivers of applications new ArrayConstructors) :: // Intercept creation of (non-generic) arrays and intrinsify. List(new Erasure) :: // Rewrite types to JVM model, erasing all type parameters, abstract types and refinements. List(new ElimErasedValueType, // Expand erased value types to their underlying implmementation types diff --git a/compiler/src/dotty/tools/dotc/Run.scala b/compiler/src/dotty/tools/dotc/Run.scala index 4ee8475b41d0..6b51908c37d7 100644 --- a/compiler/src/dotty/tools/dotc/Run.scala +++ b/compiler/src/dotty/tools/dotc/Run.scala @@ -101,11 +101,27 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint */ def units: List[CompilationUnit] = myUnits - var suspendedUnits: mutable.ListBuffer[CompilationUnit] = mutable.ListBuffer() - private def units_=(us: List[CompilationUnit]): Unit = myUnits = us + var suspendedUnits: mutable.ListBuffer[CompilationUnit] = mutable.ListBuffer() + + def checkSuspendedUnits(newUnits: List[CompilationUnit])(using Context): Unit = + if newUnits.isEmpty && suspendedUnits.nonEmpty && !ctx.reporter.errorsReported then + val where = + if suspendedUnits.size == 1 then i"in ${suspendedUnits.head}." + else i"""among + | + | ${suspendedUnits.toList}%, % + |""" + val enableXprintSuspensionHint = + if ctx.settings.XprintSuspension.value then "" + else "\n\nCompiling with -Xprint-suspension gives more information." + report.error(em"""Cyclic macro dependencies $where + |Compilation stopped since no further progress can be made. + | + |To fix this, place macros in one set of files and their callers in another.$enableXprintSuspensionHint""") + /** The files currently being compiled (active or suspended). * This may return different results over time. * These files do not have to be source files since it's possible to compile diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index a6fdd8f01364..c7b462ca6c5f 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -226,7 +226,7 @@ object desugar { def desugarContextBounds(rhs: Tree): Tree = rhs match case ContextBounds(tbounds, cxbounds) => - val iflag = if sourceVersion.isAtLeast(`3.1`) then Given else Implicit + val iflag = if sourceVersion.isAtLeast(`future`) then Given else Implicit evidenceParamBuf ++= makeImplicitParameters( cxbounds, iflag, forPrimaryConstructor = isPrimaryConstructor) tbounds diff --git a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala index 515f379cf8e2..08dc3dbb30dd 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala @@ -179,7 +179,7 @@ trait TreeInfo[T >: Untyped <: Type] { self: Trees.Instance[T] => case _ => false } - /** Is this argument node of the form : _*, or is it a reference to + /** Is this argument node of the form *, or is it a reference to * such an argument ? The latter case can happen when an argument is lifted. */ def isWildcardStarArg(tree: Tree)(using Context): Boolean = unbind(tree) match { diff --git a/compiler/src/dotty/tools/dotc/ast/Trees.scala b/compiler/src/dotty/tools/dotc/ast/Trees.scala index cde5acb2211a..23996ce14dfb 100644 --- a/compiler/src/dotty/tools/dotc/ast/Trees.scala +++ b/compiler/src/dotty/tools/dotc/ast/Trees.scala @@ -4,7 +4,7 @@ package ast import core._ import Types._, Names._, NameOps._, Flags._, util.Spans._, Contexts._, Constants._ -import typer.ProtoTypes +import typer.{ ConstFold, ProtoTypes } import SymDenotations._, Symbols._, Denotations._, StdNames._, Comments._ import language.higherKinds import collection.mutable.ListBuffer @@ -408,6 +408,13 @@ object Trees { case class Select[-T >: Untyped] private[ast] (qualifier: Tree[T], name: Name)(implicit @constructorOnly src: SourceFile) extends RefTree[T] { type ThisTree[-T >: Untyped] = Select[T] + + override def denot(using Context): Denotation = typeOpt match + case ConstantType(_) if ConstFold.foldedUnops.contains(name) => + // Recover the denotation of a constant-folded selection + qualifier.typeOpt.member(name).atSignature(Signature.NotAMethod, name) + case _ => + super.denot } class SelectWithSig[-T >: Untyped] private[ast] (qualifier: Tree[T], name: Name, val sig: Signature)(implicit @constructorOnly src: SourceFile) @@ -1027,6 +1034,7 @@ object Trees { type Template = Trees.Template[T] type Import = Trees.Import[T] type Export = Trees.Export[T] + type ImportOrExport = Trees.ImportOrExport[T] type PackageDef = Trees.PackageDef[T] type Annotated = Trees.Annotated[T] type Thicket = Trees.Thicket[T] diff --git a/compiler/src/dotty/tools/dotc/ast/untpd.scala b/compiler/src/dotty/tools/dotc/ast/untpd.scala index 2a00e8fd9fd1..6db0905c8596 100644 --- a/compiler/src/dotty/tools/dotc/ast/untpd.scala +++ b/compiler/src/dotty/tools/dotc/ast/untpd.scala @@ -169,7 +169,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo { enum GenCheckMode { case Ignore // neither filter nor check since filtering was done before case Check // check that pattern is irrefutable - case FilterNow // filter out non-matching elements since we are not yet in 3.1 + case FilterNow // filter out non-matching elements since we are not yet in 3.x case FilterAlways // filter out non-matching elements since pattern is prefixed by `case` } diff --git a/compiler/src/dotty/tools/dotc/config/Config.scala b/compiler/src/dotty/tools/dotc/config/Config.scala index 26dbbbe145a4..35088cfadbf3 100644 --- a/compiler/src/dotty/tools/dotc/config/Config.scala +++ b/compiler/src/dotty/tools/dotc/config/Config.scala @@ -205,4 +205,13 @@ object Config { /** When in IDE, turn StaleSymbol errors into warnings instead of crashing */ inline val ignoreStaleInIDE = true + + /** If true, `Denotation#asSeenFrom` is allowed to return an existing + * `SymDenotation` instead of allocating a new `SingleDenotation` if + * the two would only differ in their `prefix` (SymDenotation always + * have `NoPrefix` as their prefix). + * This is done for performance reasons: when compiling Dotty itself this + * reduces the number of allocated denotations by ~50%. + */ + inline val reuseSymDenotations = true } diff --git a/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala b/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala index 8ad80e0b6862..36bedd8db3db 100644 --- a/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala +++ b/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala @@ -21,7 +21,7 @@ class JavaPlatform extends Platform { } // The given symbol is a method with the right name and signature to be a runnable java program. - def isMainMethod(sym: SymDenotation)(using Context): Boolean = + def isMainMethod(sym: Symbol)(using Context): Boolean = (sym.name == nme.main) && (sym.info match { case MethodTpe(_, defn.ArrayOf(el) :: Nil, restpe) => el =:= defn.StringType && (restpe isRef defn.UnitClass) case _ => false diff --git a/compiler/src/dotty/tools/dotc/config/Platform.scala b/compiler/src/dotty/tools/dotc/config/Platform.scala index 4c705d958a5a..a39b801ed39b 100644 --- a/compiler/src/dotty/tools/dotc/config/Platform.scala +++ b/compiler/src/dotty/tools/dotc/config/Platform.scala @@ -38,12 +38,10 @@ abstract class Platform { def newClassLoader(bin: AbstractFile)(using Context): SymbolLoader /** The given symbol is a method with the right name and signature to be a runnable program. */ - def isMainMethod(sym: SymDenotation)(using Context): Boolean + def isMainMethod(sym: Symbol)(using Context): Boolean /** The given class has a main method. */ final def hasMainMethod(sym: Symbol)(using Context): Boolean = - sym.info.member(nme.main).hasAltWith { - case x: SymDenotation => isMainMethod(x) && (sym.is(Module) || x.isStatic) - case _ => false - } + sym.info.member(nme.main).hasAltWith(d => + isMainMethod(d.symbol) && (sym.is(Module) || d.symbol.isStatic)) } diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 3c039eb2212a..540eb80b1658 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -74,7 +74,7 @@ trait CommonScalaSettings { self: Settings.SettingGroup => class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings { // Keep synchronized with `classfileVersion` in `BCodeIdiomatic` private val minTargetVersion = 8 - private val maxTargetVersion = 16 + private val maxTargetVersion = 17 private def supportedTargetVersions: List[String] = (minTargetVersion to maxTargetVersion).toList.map(_.toString) @@ -95,7 +95,7 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings { val feature: Setting[Boolean] = BooleanSetting("-feature", "Emit warning and location for usages of features that should be imported explicitly.", aliases = List("--feature")) val help: Setting[Boolean] = BooleanSetting("-help", "Print a synopsis of standard options.", aliases = List("--help")) val release: Setting[String] = ChoiceSetting("-release", "release", "Compile code with classes specific to the given version of the Java platform available on the classpath and emit bytecode for this version.", supportedReleaseVersions, "", aliases = List("--release")) - val source: Setting[String] = ChoiceSetting("-source", "source version", "source version", List("3.0", "3.1", "3.0-migration", "3.1-migration"), "3.0", aliases = List("--source")) + val source: Setting[String] = ChoiceSetting("-source", "source version", "source version", List("3.0", "future", "3.0-migration", "future-migration"), "3.0", aliases = List("--source")) val scalajs: Setting[Boolean] = BooleanSetting("-scalajs", "Compile in Scala.js mode (requires scalajs-library.jar on the classpath).", aliases = List("--scalajs")) val unchecked: Setting[Boolean] = BooleanSetting("-unchecked", "Enable additional warnings where generated code depends on assumptions.", aliases = List("--unchecked")) val uniqid: Setting[Boolean] = BooleanSetting("-uniqid", "Uniquely tag all identifiers in debugging output.", aliases = List("--unique-id")) @@ -227,6 +227,8 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings { val Yinstrument: Setting[Boolean] = BooleanSetting("-Yinstrument", "Add instrumentation code that counts allocations and closure creations.") val YinstrumentDefs: Setting[Boolean] = BooleanSetting("-Yinstrument-defs", "Add instrumentation code that counts method calls; needs -Yinstrument to be set, too.") + val YforceInlineWhileTyping: Setting[Boolean] = BooleanSetting("-Yforce-inline-while-typing", "Make non-transparent inline methods inline when typing. Emulates the old inlining behavior of 3.0.0-M3.") + /** Dottydoc specific settings that are not used in scaladoc */ val docSnapshot: Setting[Boolean] = BooleanSetting("-doc-snapshot", "Generate a documentation snapshot for the current Dotty version") diff --git a/compiler/src/dotty/tools/dotc/config/SourceVersion.scala b/compiler/src/dotty/tools/dotc/config/SourceVersion.scala index b6bbe512d93b..d336305bf5c4 100644 --- a/compiler/src/dotty/tools/dotc/config/SourceVersion.scala +++ b/compiler/src/dotty/tools/dotc/config/SourceVersion.scala @@ -9,7 +9,7 @@ import core.Decorators.{_, given} import util.Property enum SourceVersion: - case `3.0-migration`, `3.0`, `3.1-migration`, `3.1` + case `3.0-migration`, `3.0`, `future-migration`, `future` val isMigrating: Boolean = toString.endsWith("-migration") diff --git a/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala b/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala index 7eb06b447065..460647cdaf7c 100644 --- a/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala +++ b/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala @@ -6,7 +6,7 @@ import Contexts._, Types._, Symbols._, Names._, Flags._ import Denotations.SingleDenotation import Decorators._ import collection.mutable -import config.SourceVersion.`3.1` +import config.SourceVersion.future import config.Feature.sourceVersion /** Realizability status */ @@ -202,8 +202,8 @@ class CheckRealizable(using Context) { realizability(fld.info).mapError(r => new HasProblemField(fld, r)) } } - if sourceVersion.isAtLeast(`3.1`) then - // check fields only from version 3.1. + if sourceVersion.isAtLeast(future) then + // check fields only from version 3.x. // Reason: An embedded field could well be nullable, which means it // should not be part of a path and need not be checked; but we cannot recognize // this situation until we have a typesystem that tracks nullability. diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 0f96fa4df3fb..ef4005f6c1f1 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -551,6 +551,10 @@ class Definitions { @tu lazy val ArrayConstructor: Symbol = ArrayClass.requiredMethod(nme.CONSTRUCTOR) @tu lazy val ArrayModule: Symbol = requiredModule("scala.Array") + def ArrayModuleClass: Symbol = ArrayModule.moduleClass + + @tu lazy val IArrayModule: Symbol = requiredModule("scala.IArray") + def IArrayModuleClass: Symbol = IArrayModule.moduleClass @tu lazy val UnitType: TypeRef = valueTypeRef("scala.Unit", java.lang.Void.TYPE, UnitEnc, nme.specializedTypeNames.Void) def UnitClass(using Context): ClassSymbol = UnitType.symbol.asClass diff --git a/compiler/src/dotty/tools/dotc/core/Denotations.scala b/compiler/src/dotty/tools/dotc/core/Denotations.scala index 55260844357d..1bf13c80fb85 100644 --- a/compiler/src/dotty/tools/dotc/core/Denotations.scala +++ b/compiler/src/dotty/tools/dotc/core/Denotations.scala @@ -573,8 +573,12 @@ object Denotations { final def name(using Context): Name = symbol.name - /** If this is not a SymDenotation: The prefix under which the denotation was constructed. - * NoPrefix for SymDenotations. + /** For SymDenotation, this is NoPrefix. For other denotations this is the prefix + * under which the denotation was constructed. + * + * Note that `asSeenFrom` might return a `SymDenotation` and therefore in + * general one cannot rely on `prefix` being set, see + * `Config.reuseSymDenotations` for details. */ def prefix: Type = NoPrefix @@ -1044,24 +1048,25 @@ object Denotations { } /** The derived denotation with the given `info` transformed with `asSeenFrom`. - * The prefix of the derived denotation is the new prefix `pre` if the type is - * opaque, or if the current prefix is already different from `NoPrefix`. - * That leaves SymDenotations (which have NoPrefix as the prefix), which are left - * as SymDenotations unless the type is opaque. The treatment of opaque types - * is needed, without it i7159.scala fails in from-tasty. Without the treatment, - * opaque type denotations in subclasses are kept as SymDenotations, which means - * that the transform in `ElimOpaque` will return the symbol's opaque alias without - * adding the needed asSeenFrom. * - * Logically, the right thing to do would be to extend the same treatment to all denotations - * Currently this fails the bootstrap. There's also a concern that this generalization - * would create more denotation objects, at a price in performance. + * As a performance hack, we might reuse an existing SymDenotation, + * instead of creating a new denotation with a given `prefix`, + * see `Config.reuseSymDenotations`. */ def derived(info: Type) = - derivedSingleDenotation( - symbol, - info.asSeenFrom(pre, owner), - if (symbol.is(Opaque) || this.prefix != NoPrefix) pre else this.prefix) + /** Do we need to return a denotation with a prefix set? */ + def needsPrefix = + // For opaque types, the prefix is used in `ElimOpaques#transform`, + // without this i7159.scala would fail when compiled from tasty. + symbol.is(Opaque) + + val derivedInfo = info.asSeenFrom(pre, owner) + if Config.reuseSymDenotations && this.isInstanceOf[SymDenotation] + && (derivedInfo eq info) && !needsPrefix then + this + else + derivedSingleDenotation(symbol, derivedInfo, pre) + end derived // Tt could happen that we see the symbol with prefix `this` as a member a different class // through a self type and that it then has a different info. In this case we have to go diff --git a/compiler/src/dotty/tools/dotc/core/Mode.scala b/compiler/src/dotty/tools/dotc/core/Mode.scala index 864fcd79fe69..a42493fad2f1 100644 --- a/compiler/src/dotty/tools/dotc/core/Mode.scala +++ b/compiler/src/dotty/tools/dotc/core/Mode.scala @@ -122,4 +122,9 @@ object Mode { /** Are we enforcing null safety */ val SafeNulls = newMode(28, "SafeNulls") + + /** We are typing the body of the condition of an `inline if` or the scrutinee of an `inline match` + * This mode forces expansion of inline calls in those positions even during typing. + */ + val ForceInline: Mode = newMode(29, "ForceInline") } diff --git a/compiler/src/dotty/tools/dotc/core/Phases.scala b/compiler/src/dotty/tools/dotc/core/Phases.scala index 5c0725e17c4b..4646751192b4 100644 --- a/compiler/src/dotty/tools/dotc/core/Phases.scala +++ b/compiler/src/dotty/tools/dotc/core/Phases.scala @@ -198,6 +198,7 @@ object Phases { private var myPostTyperPhase: Phase = _ private var mySbtExtractDependenciesPhase: Phase = _ private var myPicklerPhase: Phase = _ + private var myInliningPhase: Phase = _ private var myPickleQuotesPhase: Phase = _ private var myFirstTransformPhase: Phase = _ private var myCollectNullableFieldsPhase: Phase = _ @@ -218,6 +219,7 @@ object Phases { final def postTyperPhase: Phase = myPostTyperPhase final def sbtExtractDependenciesPhase: Phase = mySbtExtractDependenciesPhase final def picklerPhase: Phase = myPicklerPhase + final def inliningPhase: Phase = myInliningPhase final def pickleQuotesPhase: Phase = myPickleQuotesPhase final def firstTransformPhase: Phase = myFirstTransformPhase final def collectNullableFieldsPhase: Phase = myCollectNullableFieldsPhase @@ -241,6 +243,7 @@ object Phases { myPostTyperPhase = phaseOfClass(classOf[PostTyper]) mySbtExtractDependenciesPhase = phaseOfClass(classOf[sbt.ExtractDependencies]) myPicklerPhase = phaseOfClass(classOf[Pickler]) + myInliningPhase = phaseOfClass(classOf[Inlining]) myPickleQuotesPhase = phaseOfClass(classOf[PickleQuotes]) myFirstTransformPhase = phaseOfClass(classOf[FirstTransform]) myCollectNullableFieldsPhase = phaseOfClass(classOf[CollectNullableFields]) @@ -406,6 +409,7 @@ object Phases { def postTyperPhase(using Context): Phase = ctx.base.postTyperPhase def sbtExtractDependenciesPhase(using Context): Phase = ctx.base.sbtExtractDependenciesPhase def picklerPhase(using Context): Phase = ctx.base.picklerPhase + def inliningPhase(using Context): Phase = ctx.base.inliningPhase def pickleQuotesPhase(using Context): Phase = ctx.base.pickleQuotesPhase def firstTransformPhase(using Context): Phase = ctx.base.firstTransformPhase def refchecksPhase(using Context): Phase = ctx.base.refchecksPhase diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index 2a6df10a76de..4b04d8b8c108 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -946,7 +946,7 @@ object SymDenotations { is(Macro, butNot = Inline) && is(Erased) // Consider the macros of StringContext as plain Scala 2 macros when // compiling the standard library with Dotty. - // This should be removed on Scala 3.1 + // This should be removed on Scala 3.x && owner.ne(defn.StringContextClass) /** An erased value or an erased inline method or field */ diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index 59c8d2f80336..d2b9b607a391 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -858,10 +858,7 @@ class TreeUnpickler(reader: TastyReader, rhs.tpe.typeParams } sym.info = sym.opaqueToBounds( - rhs.tpe match { - case _: TypeBounds | _: ClassInfo => checkNonCyclic(sym, rhs.tpe, reportErrors = false) - case _ => rhs.tpe.toBounds - }, + checkNonCyclic(sym, rhs.tpe.toBounds, reportErrors = false), rhs, rhs.tpe.typeParams) if sym.isOpaqueAlias then sym.typeRef.recomputeDenot() // make sure we see the new bounds from now on sym.resetFlag(Provisional) diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 21727c7ec2be..ac8e0cd8cc64 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -1563,7 +1563,7 @@ object Parsers { if in.token == LBRACE || in.token == INDENT then t else - if sourceVersion.isAtLeast(`3.1`) then + if sourceVersion.isAtLeast(future) then deprecationWarning(DeprecatedWithOperator(), withOffset) atSpan(startOffset(t)) { makeAndType(t, withType()) } else t @@ -1613,7 +1613,7 @@ object Parsers { if isSimpleLiteral then SingletonTypeTree(simpleLiteral()) else if in.token == USCORE then - if sourceVersion.isAtLeast(`3.1`) then + if sourceVersion.isAtLeast(future) then deprecationWarning(em"`_` is deprecated for wildcard arguments of types: use `?` instead") patch(source, Span(in.offset, in.offset + 1), "?") val start = in.skipToken() @@ -2080,11 +2080,11 @@ object Parsers { val isVarargSplice = location.inArgs && followingIsVararg() in.nextToken() if isVarargSplice then - if sourceVersion.isAtLeast(`3.1`) then + if sourceVersion.isAtLeast(future) then report.errorOrMigrationWarning( - em"The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead${rewriteNotice("3.1")}", + em"The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead${rewriteNotice("future")}", in.sourcePos(uscoreStart)) - if sourceVersion == `3.1-migration` then + if sourceVersion == `future-migration` then patch(source, Span(t.span.end, in.lastOffset), " *") else if opStack.nonEmpty then report.errorOrMigrationWarning( @@ -2158,15 +2158,15 @@ object Parsers { val name = bindingName() val t = if (in.token == COLON && location == Location.InBlock) { - if sourceVersion.isAtLeast(`3.1`) then + if sourceVersion.isAtLeast(future) then // Don't error in non-strict mode, as the alternative syntax "implicit (x: T) => ... " // is not supported by Scala2.x report.errorOrMigrationWarning( - s"This syntax is no longer supported; parameter needs to be enclosed in (...)${rewriteNotice("3.1")}", + s"This syntax is no longer supported; parameter needs to be enclosed in (...)${rewriteNotice("future")}", source.atSpan(Span(start, in.lastOffset))) in.nextToken() val t = infixType() - if (sourceVersion == `3.1-migration`) { + if (sourceVersion == `future-migration`) { patch(source, Span(start), "(") patch(source, Span(in.lastOffset), ")") } @@ -2482,7 +2482,7 @@ object Parsers { atSpan(startOffset(pat), accept(LARROW)) { val checkMode = if (casePat) GenCheckMode.FilterAlways - else if sourceVersion.isAtLeast(`3.1`) then GenCheckMode.Check + else if sourceVersion.isAtLeast(future) then GenCheckMode.Check else GenCheckMode.FilterNow // filter for now, to keep backwards compat GenFrom(pat, subExpr(), checkMode) } @@ -2655,7 +2655,7 @@ object Parsers { p private def warnStarMigration(p: Tree) = - if sourceVersion.isAtLeast(`3.1`) then + if sourceVersion.isAtLeast(future) then report.errorOrMigrationWarning( em"The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead", in.sourcePos(startOffset(p))) @@ -2790,8 +2790,8 @@ object Parsers { syntaxError(DuplicatePrivateProtectedQualifier()) inBrackets { if in.token == THIS then - if sourceVersion.isAtLeast(`3.1`) then - deprecationWarning("The [this] qualifier is deprecated in Scala 3.1; it should be dropped.") + if sourceVersion.isAtLeast(future) then + deprecationWarning("The [this] qualifier will be deprecated in the future; it should be dropped.") in.nextToken() mods | Local else mods.withPrivateWithin(ident().toTypeName) @@ -3066,8 +3066,8 @@ object Parsers { type ImportConstr = (Tree, List[ImportSelector]) => Tree - /** Import ::= `import' [`given'] [ImportExpr {`,' ImportExpr} - * Export ::= `export' [`given'] [ImportExpr {`,' ImportExpr} + /** Import ::= `import' ImportExpr {‘,’ ImportExpr} + * Export ::= `export' ImportExpr {‘,’ ImportExpr} */ def importClause(leading: Token, mkTree: ImportConstr): List[Tree] = { val offset = accept(leading) @@ -3097,48 +3097,62 @@ object Parsers { ctx.compilationUnit.sourceVersion = Some(SourceVersion.valueOf(imported.toString)) Import(tree, selectors) - /** ImportExpr ::= SimpleRef {‘.’ id} ‘.’ ImportSpec - * ImportSpec ::= id - * | ‘_’ - * | ‘given’ - * | ‘{’ ImportSelectors) ‘}’ - */ - def importExpr(mkTree: ImportConstr): () => Tree = { - - /** '_' */ - def wildcardSelectorId() = atSpan(in.skipToken()) { Ident(nme.WILDCARD) } - def givenSelectorId(start: Offset) = atSpan(start) { Ident(nme.EMPTY) } + /** ImportExpr ::= SimpleRef {‘.’ id} ‘.’ ImportSpec + * | SimpleRef ‘as’ id + * ImportSpec ::= NamedSelector + * | WildcardSelector + * | ‘{’ ImportSelectors ‘}’ + * ImportSelectors ::= NamedSelector [‘,’ ImportSelectors] + * | WildCardSelector {‘,’ WildCardSelector} + * NamedSelector ::= id [‘as’ (id | ‘_’)] + * WildCardSelector ::= ‘*' | ‘given’ [InfixType] + */ + def importExpr(mkTree: ImportConstr): () => Tree = + + /** ‘*' | ‘_' */ + def wildcardSelector() = + if in.token == USCORE && sourceVersion.isAtLeast(future) then + report.errorOrMigrationWarning( + em"`_` is no longer supported for a wildcard import; use `*` instead${rewriteNotice("3.1")}", + in.sourcePos()) + patch(source, Span(in.offset, in.offset + 1), "*") + ImportSelector(atSpan(in.skipToken()) { Ident(nme.WILDCARD) }) + + /** 'given [InfixType]' */ + def givenSelector() = + ImportSelector( + atSpan(in.skipToken()) { Ident(nme.EMPTY) }, + bound = + if canStartTypeTokens.contains(in.token) then rejectWildcardType(infixType()) + else EmptyTree) + + /** id [‘as’ (id | ‘_’) */ + def namedSelector(from: Ident) = + if in.token == ARROW || isIdent(nme.as) then + if in.token == ARROW && sourceVersion.isAtLeast(future) then + report.errorOrMigrationWarning( + em"The import renaming `a => b` is no longer supported ; use `a as b` instead${rewriteNotice("3.1")}", + in.sourcePos()) + patch(source, Span(in.offset, in.offset + 2), + if testChar(in.offset - 1, ' ') && testChar(in.offset + 2, ' ') then "as" + else " as ") + atSpan(startOffset(from), in.skipToken()) { + val to = if in.token == USCORE then wildcardIdent() else termIdent() + ImportSelector(from, if to.name == nme.ERROR then EmptyTree else to) + } + else ImportSelector(from) - /** ImportSelectors ::= id [‘=>’ id | ‘=>’ ‘_’] [‘,’ ImportSelectors] - * | WildCardSelector {‘,’ WildCardSelector} - * WildCardSelector ::= ‘given’ [InfixType] - * | ‘_' - */ def importSelectors(idOK: Boolean): List[ImportSelector] = - val isWildcard = in.token == USCORE || in.token == GIVEN + val isWildcard = in.token == USCORE || in.token == GIVEN || isIdent(nme.raw.STAR) val selector = atSpan(in.offset) { in.token match - case USCORE => - ImportSelector(wildcardSelectorId()) - case GIVEN => - val start = in.skipToken() - if in.token == USCORE then - deprecationWarning(em"`given _` is deprecated in imports; replace with just `given`", start) - in.nextToken() - ImportSelector(givenSelectorId(start)) // Let the selector span all of `given`; needed for -Ytest-pickler - else if canStartTypeTokens.contains(in.token) then - ImportSelector(givenSelectorId(start), bound = rejectWildcardType(infixType())) - else - ImportSelector(givenSelectorId(start)) + case USCORE => wildcardSelector() + case GIVEN => givenSelector() case _ => - val from = termIdent() - if !idOK then syntaxError(i"named imports cannot follow wildcard imports") - if in.token == ARROW then - atSpan(startOffset(from), in.skipToken()) { - val to = if in.token == USCORE then wildcardIdent() else termIdent() - ImportSelector(from, if to.name == nme.ERROR then EmptyTree else to) - } - else ImportSelector(from) + if isIdent(nme.raw.STAR) then wildcardSelector() + else + if !idOK then syntaxError(i"named imports cannot follow wildcard imports") + namedSelector(termIdent()) } val rest = if in.token == COMMA then @@ -3149,26 +3163,36 @@ object Parsers { selector :: rest def importSelection(qual: Tree): Tree = - accept(DOT) - in.token match - case USCORE => - mkTree(qual, ImportSelector(wildcardSelectorId()) :: Nil) - case GIVEN => - mkTree(qual, ImportSelector(givenSelectorId(in.skipToken())) :: Nil) - case LBRACE => - mkTree(qual, inBraces(importSelectors(idOK = true))) - case _ => - val start = in.offset - val name = ident() - if in.token == DOT then - importSelection(atSpan(startOffset(qual), start) { Select(qual, name) }) - else - atSpan(startOffset(qual)) { - mkTree(qual, ImportSelector(atSpan(start) { Ident(name) }) :: Nil) - } + if in.isIdent(nme.as) && qual.isInstanceOf[RefTree] then + qual match + case Select(qual1, name) => + val from = Ident(name).withSpan(Span(qual.span.point, qual.span.end, 0)) + mkTree(qual1, namedSelector(from) :: Nil) + case qual: Ident => + mkTree(EmptyTree, namedSelector(qual) :: Nil) + else + accept(DOT) + in.token match + case USCORE => + mkTree(qual, wildcardSelector() :: Nil) + case GIVEN => + mkTree(qual, givenSelector() :: Nil) + case LBRACE => + mkTree(qual, inBraces(importSelectors(idOK = true))) + case _ => + if isIdent(nme.raw.STAR) then + mkTree(qual, wildcardSelector() :: Nil) + else + val start = in.offset + val name = ident() + if in.token == DOT then + importSelection(atSpan(startOffset(qual), start) { Select(qual, name) }) + else + mkTree(qual, namedSelector(atSpan(start) { Ident(name) }) :: Nil) + end importSelection - () => importSelection(simpleRef()) - } + () => atSpan(in.offset) { importSelection(simpleRef()) } + end importExpr /** Def ::= val PatDef * | var VarDef @@ -3202,7 +3226,7 @@ object Parsers { /** PatDef ::= ids [‘:’ Type] ‘=’ Expr * | Pattern2 [‘:’ Type] ‘=’ Expr * VarDef ::= PatDef - * | id {`,' id} `:' Type `=' `_' (deprecated in 3.1) + * | id {`,' id} `:' Type `=' `_' (deprecated in 3.x) * ValDcl ::= id {`,' id} `:' Type * VarDcl ::= id {`,' id} `:' Type */ @@ -3229,7 +3253,7 @@ object Parsers { subExpr() match case rhs0 @ Ident(name) if placeholderParams.nonEmpty && name == placeholderParams.head.name && !tpt.isEmpty && mods.is(Mutable) && lhs.forall(_.isInstanceOf[Ident]) => - if sourceVersion.isAtLeast(`3.1`) then + if sourceVersion.isAtLeast(future) then deprecationWarning( em"""`= _` has been deprecated; use `= uninitialized` instead. |`uninitialized` can be imported with `scala.compiletime.uninitialized`.""", rhsOffset) diff --git a/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala index c87418568e56..8d1f5e4a8051 100644 --- a/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -340,9 +340,13 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { def selectorText(sel: untpd.ImportSelector): Text = val id: Text = - if sel.isGiven then keywordText("given") else toText(sel.imported) + if sel.isGiven then keywordText("given") + else sel.imported.name match + case nme.WILDCARD => "*" + case nme.raw.STAR => "`*`" + case name => toText(name) val rename: Text = - if sel.renamed.isEmpty then "" else Str(" => ") ~ toText(sel.renamed) + if sel.renamed.isEmpty then "" else Str(" as ") ~ toText(sel.renamed) val bound: Text = if sel.bound.isEmpty then "" else if sel.isGiven then Str(" ") ~ toText(sel.bound) diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala index 863909066161..cf8b3e01822a 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala @@ -77,10 +77,11 @@ class ExtractAPI extends Phase { } finally pw.close() } - if (ctx.sbtCallback != null) { + if ctx.sbtCallback != null && + !ctx.compilationUnit.suspendedAtInliningPhase // already registered before this unit was suspended + then classes.foreach(ctx.sbtCallback.api(sourceFile.file, _)) mainClasses.foreach(ctx.sbtCallback.mainClass(sourceFile.file, _)) - } } } diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala index 52e7cb2a6633..860e9e3e6c4c 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala @@ -150,10 +150,19 @@ class ExtractDependencies extends Phase { builder.append(".") } val flatName = dep.to.flatName - // We create fake companion object symbols to hold the static members - // of Java classes, make sure to use the name of the actual Java class - // here. - val clsFlatName = if (dep.to.is(JavaDefined)) flatName.stripModuleClassSuffix else flatName + // Some companion objects are fake (that is, they're a compiler fiction + // that doesn't correspond to a class that exists at runtime), this + // can happen in two cases: + // - If a Java class has static members. + // - If we create constructor proxies for a class (see NamerOps#addConstructorProxies). + // + // In both cases it's vital that we don't send the object name to + // zinc: when sbt is restarted, zinc will inspect the binary + // dependencies to see if they're still on the classpath, if it + // doesn't find them it will invalidate whatever referenced them, so + // any reference to a fake companion will lead to extra recompilations. + // Instead, use the class name since it's guaranteed to exist at runtime. + val clsFlatName = if (dep.to.isOneOf(JavaDefined | ConstructorProxy)) flatName.stripModuleClassSuffix else flatName builder.append(clsFlatName.mangledString) builder.toString } diff --git a/compiler/src/dotty/tools/dotc/transform/ArrayApply.scala b/compiler/src/dotty/tools/dotc/transform/ArrayApply.scala index 314236400084..348bc735bd9c 100644 --- a/compiler/src/dotty/tools/dotc/transform/ArrayApply.scala +++ b/compiler/src/dotty/tools/dotc/transform/ArrayApply.scala @@ -6,6 +6,7 @@ import MegaPhase._ import Contexts._ import Symbols._ import Types._ +import Flags._ import StdNames._ import ast.Trees._ import dotty.tools.dotc.ast.tpd @@ -23,7 +24,7 @@ class ArrayApply extends MiniPhase { override def phaseName: String = "arrayApply" override def transformApply(tree: tpd.Apply)(using Context): tpd.Tree = - if (tree.symbol.name == nme.apply && tree.symbol.owner == defn.ArrayModule.moduleClass) // Is `Array.apply` + if isArrayModuleApply(tree.symbol) then tree.args match { case StripAscription(Apply(wrapRefArrayMeth, (seqLit: tpd.JavaSeqLiteral) :: Nil)) :: ct :: Nil if defn.WrapArrayMethods().contains(wrapRefArrayMeth.symbol) && elideClassTag(ct) => @@ -39,6 +40,10 @@ class ArrayApply extends MiniPhase { else tree + private def isArrayModuleApply(sym: Symbol)(using Context): Boolean = + sym.name == nme.apply + && (sym.owner == defn.ArrayModuleClass || (sym.owner == defn.IArrayModuleClass && !sym.is(Extension))) + /** Only optimize when classtag if it is one of * - `ClassTag.apply(classOf[XYZ])` * - `ClassTag.apply(java.lang.XYZ.Type)` for boxed primitives `XYZ`` diff --git a/compiler/src/dotty/tools/dotc/transform/ArrayConstructors.scala b/compiler/src/dotty/tools/dotc/transform/ArrayConstructors.scala index 437ff0490822..301026548444 100644 --- a/compiler/src/dotty/tools/dotc/transform/ArrayConstructors.scala +++ b/compiler/src/dotty/tools/dotc/transform/ArrayConstructors.scala @@ -32,7 +32,7 @@ class ArrayConstructors extends MiniPhase { val TypeApply(tycon, targ :: Nil) = tree.fun expand(targ.tpe, tree.args) } - else if ((tree.fun.symbol.maybeOwner eq defn.ArrayModule.moduleClass) && (tree.fun.symbol.name eq nme.ofDim) && !tree.tpe.isInstanceOf[MethodicType]) { + else if ((tree.fun.symbol.maybeOwner eq defn.ArrayModuleClass) && (tree.fun.symbol.name eq nme.ofDim) && !tree.tpe.isInstanceOf[MethodicType]) { val Apply(Apply(TypeApply(_, List(tp)), _), _) = tree val cs = tp.tpe.classSymbol tree.fun match { diff --git a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala index 12e85793205b..8f43f63a0304 100644 --- a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala +++ b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala @@ -150,7 +150,7 @@ class FirstTransform extends MiniPhase with InfoTransformer { thisPhase => } override def transformOther(tree: Tree)(using Context): Tree = tree match { - case tree: ImportOrExport[_] => EmptyTree + case tree: ImportOrExport => EmptyTree case tree: NamedArg => transformAllDeep(tree.arg) case tree => if (tree.isType) toTypeTree(tree) else tree } diff --git a/compiler/src/dotty/tools/dotc/transform/InlineVals.scala b/compiler/src/dotty/tools/dotc/transform/InlineVals.scala new file mode 100644 index 000000000000..0a7d6a9e7a07 --- /dev/null +++ b/compiler/src/dotty/tools/dotc/transform/InlineVals.scala @@ -0,0 +1,43 @@ +package dotty.tools +package dotc +package transform + +import dotty.tools.dotc.core.Contexts._ +import dotty.tools.dotc.core.Decorators._ +import dotty.tools.dotc.core.Flags._ +import dotty.tools.dotc.core.Types._ +import dotty.tools.dotc.transform.MegaPhase.MiniPhase +import dotty.tools.dotc.typer.Inliner + +/** Check that `tree.rhs` can be right hand-side of an `inline` value definition. */ +class InlineVals extends MiniPhase: + import ast.tpd._ + + def phaseName: String = "inlineVals" + + override def checkPostCondition(tree: Tree)(using Context): Unit = + if !ctx.erasedTypes then + tree match + case tree: ValDef => checkInlineConformant(tree) + case _ => + + override def transformValDef(tree: ValDef)(using Context): Tree = + checkInlineConformant(tree) + tree + + /** Check that `tree.rhs` can be right hand-side of an `inline` value definition. */ + private def checkInlineConformant(tree: ValDef)(using Context): Unit = { + if tree.symbol.is(Inline, butNot = DeferredOrTermParamOrAccessor) + && !Inliner.inInlineMethod + then + val rhs = tree.rhs + val tpt = tree.tpt + tpt.tpe.widenTermRefExpr.dealias.normalized match + case tp: ConstantType => + if !isPureExpr(rhs) then + val details = if enclosingInlineds.isEmpty then "" else em"but was: $rhs" + report.error(s"inline value must be pure$details", rhs.srcPos) + case _ => + val pos = if tpt.span.isZeroExtent then rhs.srcPos else tpt.srcPos + report.error(em"inline value must have a literal constant type", pos) + } \ No newline at end of file diff --git a/compiler/src/dotty/tools/dotc/transform/Inlining.scala b/compiler/src/dotty/tools/dotc/transform/Inlining.scala index 70895a647e39..5db2afdacd8d 100644 --- a/compiler/src/dotty/tools/dotc/transform/Inlining.scala +++ b/compiler/src/dotty/tools/dotc/transform/Inlining.scala @@ -33,11 +33,22 @@ import scala.annotation.constructorOnly /** Inlines all calls to inline methods that are not in an inline method or a quote */ class Inlining extends MacroTransform { import tpd._ + import Inlining._ override def phaseName: String = Inlining.name override def allowsImplicitSearch: Boolean = true + override def run(using Context): Unit = + if ctx.compilationUnit.needsInlining then + try super.run + catch case _: CompilationUnit.SuspendException => () + + override def runOn(units: List[CompilationUnit])(using Context): List[CompilationUnit] = + val newUnits = super.runOn(units).filterNot(_.suspended) + ctx.run.checkSuspendedUnits(newUnits) + newUnits + override def checkPostCondition(tree: Tree)(using Context): Unit = tree match { case PackageDef(pid, _) if tree.symbol.owner == defn.RootClass => @@ -69,13 +80,13 @@ class Inlining extends MacroTransform { else super.transform(tree) case _: Typed | _: Block => super.transform(tree) - case _ if Inliner.isInlineable(tree) && !tree.tpe.widen.isInstanceOf[MethodOrPoly] && StagingContext.level == 0 => + case _ if Inliner.needsInlining(tree) => val tree1 = super.transform(tree) - val inlined = Inliner.inlineCall(tree1) - if tree1 eq inlined then inlined - else transform(inlined) + if tree1.tpe.isError then tree1 + else Inliner.inlineCall(tree1) case _: GenericApply if tree.symbol.isQuote => - ctx.compilationUnit.needsStaging = true + if level == 0 then + ctx.compilationUnit.needsQuotePickling = true super.transform(tree)(using StagingContext.quoteContext) case _: GenericApply if tree.symbol.isExprSplice => super.transform(tree)(using StagingContext.spliceContext) @@ -85,6 +96,5 @@ class Inlining extends MacroTransform { } } -object Inlining { +object Inlining: val name: String = "inlining" -} diff --git a/compiler/src/dotty/tools/dotc/transform/LambdaLift.scala b/compiler/src/dotty/tools/dotc/transform/LambdaLift.scala index a7f7808da5d1..58d4d7083d32 100644 --- a/compiler/src/dotty/tools/dotc/transform/LambdaLift.scala +++ b/compiler/src/dotty/tools/dotc/transform/LambdaLift.scala @@ -556,6 +556,8 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisPhase => // The Lifter updates the type of symbols using `installAfter` to give them a // new `SymDenotation`, but that doesn't affect non-sym denotations, so we // reload them manually here. + // Note: If you tweak this code, make sure to test your changes with + // `Config.reuseSymDenotations` set to false to exercise this path more. if denot.isInstanceOf[NonSymSingleDenotation] && lifter.free.contains(sym) then tree.qualifier.select(sym).withSpan(tree.span) else tree diff --git a/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala b/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala index 34a26867037e..f43f54c73ec7 100644 --- a/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala +++ b/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala @@ -89,7 +89,7 @@ class NonLocalReturns extends MiniPhase { override def transformReturn(tree: Return)(using Context): Tree = if isNonLocalReturn(tree) then - if sourceVersion.isAtLeast(`3.1`) then + if sourceVersion.isAtLeast(future) then report.errorOrMigrationWarning("Non local returns are no longer supported; use scala.util.control.NonLocalReturns instead", tree.srcPos) nonLocalReturnThrow(tree.expr, tree.from.symbol).withSpan(tree.span) else tree diff --git a/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala b/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala index 0f00add41809..e0f0858652cf 100644 --- a/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala +++ b/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala @@ -88,7 +88,7 @@ class PickleQuotes extends MacroTransform { } override def run(using Context): Unit = - if (ctx.compilationUnit.needsStaging) super.run(using freshStagingContext) + if (ctx.compilationUnit.needsQuotePickling) super.run(using freshStagingContext) protected def newTransformer(using Context): Transformer = new Transformer { override def transform(tree: tpd.Tree)(using Context): tpd.Tree = diff --git a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala index 09806b2b1679..ca442d379ec5 100644 --- a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala +++ b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala @@ -159,7 +159,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase if sym.isScala2Macro && !ctx.settings.XignoreScala2Macros.value then if !sym.owner.unforcedDecls.exists(p => !p.isScala2Macro && p.name == sym.name && p.signature == sym.signature) // Allow scala.reflect.materializeClassTag to be able to compile scala/reflect/package.scala - // This should be removed on Scala 3.1 + // This should be removed on Scala 3.x && sym.owner != defn.ReflectPackageClass then report.error("No Scala 3 implementation found for this Scala 2 macro.", tree.srcPos) @@ -258,12 +258,16 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase override def transform(tree: Tree)(using Context): Tree = try tree match { case tree: Ident if !tree.isType => + if tree.symbol.is(Inline) && !Inliner.inInlineMethod then + ctx.compilationUnit.needsInlining = true checkNoConstructorProxy(tree) tree.tpe match { case tpe: ThisType => This(tpe.cls).withSpan(tree.span) case _ => tree } case tree @ Select(qual, name) => + if tree.symbol.is(Inline) then + ctx.compilationUnit.needsInlining = true if (name.isTypeName) { Checking.checkRealizable(qual.tpe, qual.srcPos) withMode(Mode.Type)(super.transform(tree)) @@ -302,6 +306,9 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase case tree: TypeApply => if tree.symbol.isQuote then ctx.compilationUnit.needsStaging = true + ctx.compilationUnit.needsQuotePickling = true + if tree.symbol.is(Inline) then + ctx.compilationUnit.needsInlining = true val tree1 @ TypeApply(fn, args) = normalizeTypeArgs(tree) args.foreach(checkInferredWellFormed) if (fn.symbol != defn.ChildAnnot.primaryConstructor) diff --git a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala index 7eaad36b18a2..4ebe2cf41fad 100644 --- a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala +++ b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala @@ -380,6 +380,17 @@ class TreeChecker extends Phase with SymTransformer { override def typedSelect(tree: untpd.Select, pt: Type)(using Context): Tree = { assert(tree.isTerm || !ctx.isAfterTyper, tree.show + " at " + ctx.phase) val tpe = tree.typeOpt + + // Polymorphic apply methods stay structural until Erasure + val isPolyFunctionApply = (tree.name eq nme.apply) && (tree.qualifier.typeOpt <:< defn.PolyFunctionType) + // Outer selects are pickled specially so don't require a symbol + val isOuterSelect = tree.name.is(OuterSelectName) + val isPrimitiveArrayOp = ctx.erasedTypes && nme.isPrimitiveName(tree.name) + if !(tree.isType || isPolyFunctionApply || isOuterSelect || isPrimitiveArrayOp) then + val denot = tree.denot + assert(denot.exists, i"Selection $tree with type $tpe does not have a denotation") + assert(denot.symbol.exists, i"Denotation $denot of selection $tree with type $tpe does not have a symbol") + val sym = tree.symbol val symIsFixed = tpe match { case tpe: TermRef => ctx.erasedTypes || !tpe.isMemberRef @@ -387,7 +398,7 @@ class TreeChecker extends Phase with SymTransformer { } if (sym.exists && !sym.is(Private) && !symIsFixed && - !tree.name.is(OuterSelectName)) { // outer selects have effectively fixed symbols + !isOuterSelect) { // outer selects have effectively fixed symbols val qualTpe = tree.qualifier.typeOpt val member = if (sym.is(Private)) qualTpe.member(tree.name) @@ -403,6 +414,7 @@ class TreeChecker extends Phase with SymTransformer { |qualifier type : ${tree.qualifier.typeOpt} |tree type : ${tree.typeOpt} of class ${tree.typeOpt.getClass}""") } + checkNotRepeated(super.typedSelect(tree, pt)) } diff --git a/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala b/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala index d208c19c5c52..73e75597c2b3 100644 --- a/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala +++ b/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala @@ -173,7 +173,7 @@ class TupleOptimizations extends MiniPhase with IdentityDenotTransformer { val size = tpes.size if (size == 0) // Array.emptyObjectArray - ref(defn.ArrayModule).select("emptyObjectArray".toTermName).ensureApplied + ref(defn.ArrayModule).select("emptyObjectArray".toTermName).ensureApplied.withSpan(tree.span) else if (size <= MaxTupleArity) // scala.runtime.Tuples.productToArray(tup.asInstanceOf[Product]) ref(defn.RuntimeTuples_productToArray).appliedTo(tup.asInstance(defn.ProductClass.typeRef)) diff --git a/compiler/src/dotty/tools/dotc/transform/YCheckPositions.scala b/compiler/src/dotty/tools/dotc/transform/YCheckPositions.scala index 3f5da6bab7e7..44655e3bead3 100644 --- a/compiler/src/dotty/tools/dotc/transform/YCheckPositions.scala +++ b/compiler/src/dotty/tools/dotc/transform/YCheckPositions.scala @@ -27,11 +27,12 @@ class YCheckPositions extends Phase { // Check current context is correct assert(ctx.source == sources.head) - if (!tree.isEmpty && !tree.isInstanceOf[untpd.TypedSplice] && ctx.typerState.isGlobalCommittable) - if (!tree.isType) { // TODO also check types, currently we do not add Inlined(EmptyTree, _, _) for types. We should. + if (!tree.isEmpty && !tree.isInstanceOf[untpd.TypedSplice] && !tree.isInstanceOf[Inlined] && ctx.typerState.isGlobalCommittable) + if !tree.isType // TODO also check types, currently we do not add Inlined(EmptyTree, _, _) for types. We should. + && !tree.symbol.is(InlineProxy) // TODO check inline proxies (see tests/tun/lst) + then val currentSource = sources.head - assert(tree.source == currentSource, i"wrong source set for $tree # ${tree.uniqueId} of ${tree.getClass}, set to ${tree.source} but context had $currentSource") - } + assert(tree.source == currentSource, i"wrong source set for $tree # ${tree.uniqueId} of ${tree.getClass}, set to ${tree.source} but context had $currentSource\n ${tree.symbol.flagsString}") // Recursivlely check children while keeping track of current source tree match { @@ -42,7 +43,7 @@ class YCheckPositions extends Phase { traverse(expansion)(using inlineContext(EmptyTree).withSource(sources.head)) sources = old case Inlined(call, bindings, expansion) => - bindings.foreach(traverse(_)) + // bindings.foreach(traverse(_)) // TODO check inline proxies (see tests/tun/lst) sources = call.symbol.topLevelClass.source :: sources if (!isMacro(call)) // FIXME macro implementations can drop Inlined nodes. We should reinsert them after macro expansion based on the positions of the trees traverse(expansion)(using inlineContext(call).withSource(sources.head)) @@ -55,8 +56,10 @@ class YCheckPositions extends Phase { } private def isMacro(call: Tree)(using Context) = - if (ctx.phase <= postTyperPhase) call.symbol.is(Macro) - else call.isInstanceOf[Select] // The call of a macro after typer is encoded as a Select while other inlines are Ident - // TODO remove this distinction once Inline nodes of expanded macros can be trusted (also in Inliner.inlineCallTrace) + call.symbol.is(Macro) || + // The call of a macro after typer is encoded as a Select while other inlines are Ident + // TODO remove this distinction once Inline nodes of expanded macros can be trusted (also in Inliner.inlineCallTrace) + (!(ctx.phase <= postTyperPhase) && call.isInstanceOf[Select]) + } diff --git a/compiler/src/dotty/tools/dotc/transform/init/Checker.scala b/compiler/src/dotty/tools/dotc/transform/init/Checker.scala index 7172db190ce0..61d4dcfaa952 100644 --- a/compiler/src/dotty/tools/dotc/transform/init/Checker.scala +++ b/compiler/src/dotty/tools/dotc/transform/init/Checker.scala @@ -52,6 +52,7 @@ class Checker extends MiniPhase { thisClass = cls, fieldsInited = mutable.Set.empty, parentsInited = mutable.Set.empty, + safePromoted = mutable.Set.empty, env = baseEnv.withCtx(ctx.withOwner(cls)) ) diff --git a/compiler/src/dotty/tools/dotc/transform/init/Checking.scala b/compiler/src/dotty/tools/dotc/transform/init/Checking.scala index 6a8007e06516..b08b95581c24 100644 --- a/compiler/src/dotty/tools/dotc/transform/init/Checking.scala +++ b/compiler/src/dotty/tools/dotc/transform/init/Checking.scala @@ -35,6 +35,7 @@ object Checking { thisClass: ClassSymbol, // the concrete class of `this` fieldsInited: mutable.Set[Symbol], parentsInited: mutable.Set[ClassSymbol], + safePromoted: mutable.Set[Potential], // Potentials that can be safely promoted env: Env ) { @@ -161,32 +162,7 @@ object Checking { implicit val state2: State = state.withVisited(eff) eff match { - case Promote(pot) => - pot match { - case pot: ThisRef => - PromoteThis(pot, eff.source, state2.path).toErrors - - case _: Cold => - PromoteCold(eff.source, state2.path).toErrors - - case pot @ Warm(cls, outer) => - val errors = state.test { check(Promote(outer)(eff.source)) } - if (errors.isEmpty) Errors.empty - else PromoteWarm(pot, eff.source, state2.path).toErrors - - case Fun(pots, effs) => - val errs1 = state.test { effs.flatMap { check(_) } } - val errs2 = state.test { pots.flatMap { pot => check(Promote(pot)(eff.source))(state.copy(path = Vector.empty)) } } - if (errs1.nonEmpty || errs2.nonEmpty) - UnsafePromotion(pot, eff.source, state2.path, errs1 ++ errs2).toErrors - else - Errors.empty - - case pot => - val (pots, effs) = expand(pot) - val effs2 = pots.map(Promote(_)(eff.source)) - (effs2 ++ effs).flatMap(check(_)) - } + case Promote(pot) => checkPromote(pot, eff.source) case FieldAccess(pot, field) => @@ -271,6 +247,47 @@ object Checking { } } + private def checkPromote(pot: Potential, source: Tree)(implicit state: State): Errors = + if (state.safePromoted.contains(pot)) Errors.empty + else + val errs = pot match { + case pot: ThisRef => + // If we have all fields initialized, then we can promote This to hot. + val classRef = state.thisClass.info.asInstanceOf[ClassInfo].appliedRef + val allFieldsInited = classRef.fields.forall { denot => + val sym = denot.symbol + sym.isOneOf(Flags.Lazy | Flags.Deferred) || state.fieldsInited.contains(sym) + } + if (allFieldsInited) + Errors.empty + else + PromoteThis(pot, source, state.path).toErrors + case _: Cold => + PromoteCold(source, state.path).toErrors + + case pot @ Warm(cls, outer) => + val errors = state.test { checkPromote(outer, source) } + if (errors.isEmpty) Errors.empty + else PromoteWarm(pot, source, state.path).toErrors + + case Fun(pots, effs) => + val errs1 = state.test { effs.flatMap { check(_) } } + val errs2 = state.test { pots.flatMap { pot => checkPromote(pot, source)(state.copy(path = Vector.empty)) } } + if (errs1.nonEmpty || errs2.nonEmpty) + UnsafePromotion(pot, source, state.path, errs1 ++ errs2).toErrors + else + Errors.empty + + case pot => + val (pots, effs) = expand(pot) + val effs2 = pots.map(Promote(_)(source)) + (effs2 ++ effs).flatMap(check(_)) + } + // If we can safely promote, then we don't need to check again + if (errs.isEmpty) + state.safePromoted += pot + errs + private def expand(pot: Potential)(implicit state: State): Summary = trace("expand " + pot.show, init, sum => Summary.show(sum.asInstanceOf[Summary])) { pot match { case MethodReturn(pot1, sym) => diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index ec23b8fe77dc..f17889b9bbfd 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -1897,13 +1897,19 @@ trait Applications extends Compatibility { } /** The type of alternative `alt` after instantiating its first parameter - * clause with `argTypes`. + * clause with `argTypes`. In addition, if the resulting type is a PolyType + * and `typeArgs` matches its parameter list, instantiate the result with `typeArgs`. */ - def skipParamClause(argTypes: List[Type])(alt: TermRef): Type = + def skipParamClause(argTypes: List[Type], typeArgs: List[Type])(alt: TermRef): Type = def skip(tp: Type): Type = tp match { case tp: PolyType => - val rt = skip(tp.resultType) - if (rt.exists) tp.derivedLambdaType(resType = rt) else rt + skip(tp.resultType) match + case NoType => + NoType + case rt: PolyType if typeArgs.length == rt.paramInfos.length => + tp.derivedLambdaType(resType = rt.instantiate(typeArgs)) + case rt => + tp.derivedLambdaType(resType = rt).asInstanceOf[PolyType].flatten case tp: MethodType => tp.instantiate(argTypes) case _ => @@ -1926,9 +1932,14 @@ trait Applications extends Compatibility { else val deepPt = pt.deepenProto deepPt match + case pt @ FunProto(_, PolyProto(targs, resType)) => + // try to narrow further with snd argument list and following type params + resolveMapped(candidates, + skipParamClause(pt.typedArgs().tpes, targs.tpes), resType) case pt @ FunProto(_, resType: FunOrPolyProto) => // try to narrow further with snd argument list - resolveMapped(candidates, skipParamClause(pt.typedArgs().tpes), resType) + resolveMapped(candidates, + skipParamClause(pt.typedArgs().tpes, Nil), resType) case _ => // prefer alternatives that need no eta expansion val noCurried = alts.filter(!resultIsMethod(_)) @@ -1974,7 +1985,7 @@ trait Applications extends Compatibility { None } val mapped = reverseMapping.map(_._1) - overload.println(i"resolve mapped: $mapped") + overload.println(i"resolve mapped: ${mapped.map(_.widen)}%, % with $pt") resolveOverloaded(mapped, pt).map(reverseMapping.toMap) /** Try to typecheck any arguments in `pt` that are function values missing a diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index 32bcbc0aab4b..bce4f6cbb242 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -700,7 +700,7 @@ trait Checking { def check(pat: Tree, pt: Type): Boolean = (pt <:< pat.tpe) || fail(pat, pt) def recur(pat: Tree, pt: Type): Boolean = - !sourceVersion.isAtLeast(`3.1`) || // only for 3.1 for now since mitigations work only after this PR + !sourceVersion.isAtLeast(future) || // only for 3.x for now since mitigations work only after this PR pt.hasAnnotation(defn.UncheckedAnnot) || { patmatch.println(i"check irrefutable $pat: ${pat.tpe} against $pt") pat match { @@ -844,7 +844,7 @@ trait Checking { !meth.isDeclaredInfix && !meth.maybeOwner.is(Scala2x) && !infixOKSinceFollowedBy(tree.right) && - sourceVersion.isAtLeast(`3.1`) => + sourceVersion.isAtLeast(future) => val (kind, alternative) = if (ctx.mode.is(Mode.Type)) ("type", (n: Name) => s"prefix syntax $n[...]") @@ -899,18 +899,6 @@ trait Checking { } } - /** Check that `tree` can be right hand-side or argument to `inline` value or parameter. */ - def checkInlineConformant(tpt: Tree, tree: Tree, sym: Symbol)(using Context): Unit = { - if sym.is(Inline, butNot = DeferredOrTermParamOrAccessor) && !ctx.erasedTypes && !Inliner.inInlineMethod then - tpt.tpe.widenTermRefExpr.dealias.normalized match - case tp: ConstantType => - if !(exprPurity(tree) >= Pure) then - report.error(em"inline value must be pure", tree.srcPos) - case _ => - val pos = if tpt.span.isZeroExtent then tree.srcPos else tpt.srcPos - report.error(em"inline value must have a literal constant type", pos) - } - /** A hook to exclude selected symbols from double declaration check */ def excludeFromDoubleDeclCheck(sym: Symbol)(using Context): Boolean = false @@ -1277,7 +1265,7 @@ trait Checking { if stat.isDef then seen += tname def checkMatchable(tp: Type, pos: SrcPos, pattern: Boolean)(using Context): Unit = - if !tp.derivesFrom(defn.MatchableClass) && sourceVersion.isAtLeast(`3.1-migration`) then + if !tp.derivesFrom(defn.MatchableClass) && sourceVersion.isAtLeast(`future-migration`) then val kind = if pattern then "pattern selector" else "value" report.warning( em"""${kind} should be an instance of Matchable, @@ -1306,7 +1294,6 @@ trait NoChecking extends ReChecking { override def checkImplicitConversionUseOK(tree: Tree)(using Context): Unit = () override def checkFeasibleParent(tp: Type, pos: SrcPos, where: => String = "")(using Context): Type = tp override def checkAnnotArgs(tree: Tree)(using Context): tree.type = tree - override def checkInlineConformant(tpt: Tree, tree: Tree, sym: Symbol)(using Context): Unit = () override def checkNoTargetNameConflict(stats: List[Tree])(using Context): Unit = () override def checkParentCall(call: Tree, caller: ClassSymbol)(using Context): Unit = () override def checkSimpleKinded(tpt: Tree)(using Context): Tree = tpt diff --git a/compiler/src/dotty/tools/dotc/typer/ConstFold.scala b/compiler/src/dotty/tools/dotc/typer/ConstFold.scala index 0bf1e4a076ea..4633c187912f 100644 --- a/compiler/src/dotty/tools/dotc/typer/ConstFold.scala +++ b/compiler/src/dotty/tools/dotc/typer/ConstFold.scala @@ -23,7 +23,7 @@ object ConstFold: nme.LT, nme.GT, nme.LE, nme.GE, nme.LSL, nme.LSR, nme.ASR, nme.ADD, nme.SUB, nme.MUL, nme.DIV, nme.MOD) - private val foldedUnops = Set[Name]( + val foldedUnops = Set[Name]( nme.UNARY_!, nme.UNARY_~, nme.UNARY_+, nme.UNARY_-) def Apply[T <: Apply](tree: T)(using Context): T = diff --git a/compiler/src/dotty/tools/dotc/typer/FrontEnd.scala b/compiler/src/dotty/tools/dotc/typer/FrontEnd.scala index 87307115bcda..0f51b19ddf91 100644 --- a/compiler/src/dotty/tools/dotc/typer/FrontEnd.scala +++ b/compiler/src/dotty/tools/dotc/typer/FrontEnd.scala @@ -122,21 +122,7 @@ class FrontEnd extends Phase { unitContexts.foreach(javaCheck(using _)) // after typechecking to avoid cycles val newUnits = unitContexts.map(_.compilationUnit).filterNot(discardAfterTyper) - val suspendedUnits = ctx.run.suspendedUnits - if newUnits.isEmpty && suspendedUnits.nonEmpty && !ctx.reporter.errorsReported then - val where = - if suspendedUnits.size == 1 then i"in ${suspendedUnits.head}." - else i"""among - | - | ${suspendedUnits.toList}%, % - |""" - val enableXprintSuspensionHint = - if ctx.settings.XprintSuspension.value then "" - else "\n\nCompiling with -Xprint-suspension gives more information." - report.error(em"""Cyclic macro dependencies $where - |Compilation stopped since no further progress can be made. - | - |To fix this, place macros in one set of files and their callers in another.$enableXprintSuspensionHint""") + ctx.run.checkSuspendedUnits(newUnits) newUnits def run(using Context): Unit = unsupported("run") diff --git a/compiler/src/dotty/tools/dotc/typer/Inliner.scala b/compiler/src/dotty/tools/dotc/typer/Inliner.scala index 1bd2da4fed7c..837cf95bab01 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inliner.scala @@ -43,7 +43,7 @@ object Inliner { * @pre hasBodyToInline(sym) */ def bodyToInline(sym: SymDenotation)(using Context): Tree = - if (sym.isInlineMethod && sym.hasAnnotation(defn.BodyAnnot)) + if hasBodyToInline(sym) then sym.getAnnotation(defn.BodyAnnot).get.tree else EmptyTree @@ -52,16 +52,29 @@ object Inliner { def inInlineMethod(using Context): Boolean = ctx.owner.ownersIterator.exists(_.isInlineMethod) - /** Should call to method `meth` be inlined in this context? */ + /** Can a call to method `meth` be inlined? */ def isInlineable(meth: Symbol)(using Context): Boolean = meth.is(Inline) && meth.hasAnnotation(defn.BodyAnnot) && !inInlineMethod /** Should call be inlined in this context? */ - def isInlineable(tree: Tree)(using Context): Boolean = tree match { - case Block(_, expr) => isInlineable(expr) - case _ => isInlineable(tree.symbol) && !tree.tpe.isInstanceOf[MethodOrPoly] + def needsInlining(tree: Tree)(using Context): Boolean = tree match { + case Block(_, expr) => needsInlining(expr) + case _ => + isInlineable(tree.symbol) + && !tree.tpe.widenTermRefExpr.isInstanceOf[MethodOrPoly] + && StagingContext.level == 0 + && ( + ctx.phase == Phases.inliningPhase + || (ctx.phase == Phases.typerPhase && needsTransparentInlining(tree)) + ) + && !ctx.typer.hasInliningErrors } + private def needsTransparentInlining(tree: Tree)(using Context): Boolean = + tree.symbol.is(Transparent) + || ctx.mode.is(Mode.ForceInline) + || ctx.settings.YforceInlineWhileTyping.value + /** Try to inline a call to an inline method. Fail with error if the maximal * inline depth is exceeded. * @@ -283,11 +296,17 @@ object Inliner { assert(tree.symbol == defn.CompiletimeTesting_typeChecks || tree.symbol == defn.CompiletimeTesting_typeCheckErrors) def stripTyped(t: Tree): Tree = t match { case Typed(t2, _) => stripTyped(t2) + case Block(Nil, t2) => stripTyped(t2) + case Inlined(_, Nil, t2) => stripTyped(t2) case _ => t } val Apply(_, codeArg :: Nil) = tree - val underlyingCodeArg = stripTyped(codeArg.underlying) + val codeArg1 = stripTyped(codeArg.underlying) + val underlyingCodeArg = + if Inliner.isInlineable(codeArg1.symbol) then stripTyped(Inliner.inlineCall(codeArg1)) + else codeArg1 + ConstFold(underlyingCodeArg).tpe.widenTermRefExpr match { case ConstantType(Constant(code: String)) => val source2 = SourceFile.virtual("tasty-reflect", code) @@ -303,7 +322,7 @@ object Inliner { res ++= typerErrors.map(e => ErrorKind.Typer -> e) res.toList case t => - report.error("argument to compileError must be a statically known String", underlyingCodeArg.srcPos) + report.error(em"argument to compileError must be a statically known String but was: $codeArg", codeArg1.srcPos) Nil } @@ -327,7 +346,7 @@ object Inliner { /** Expand call to scala.compiletime.testing.typeChecks */ def typeChecks(tree: Tree)(using Context): Tree = val errors = compileForErrors(tree, true) - Literal(Constant(errors.isEmpty)) + Literal(Constant(errors.isEmpty)).withSpan(tree.span) /** Expand call to scala.compiletime.testing.typeCheckErrors */ def typeCheckErrors(tree: Tree)(using Context): Tree = @@ -941,7 +960,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) { } } - def tryInline(tree: Tree)(using Context): Tree = tree match { + def tryInlineArg(tree: Tree)(using Context): Tree = tree match { case InlineableArg(rhs) => inlining.println(i"inline arg $tree -> $rhs") rhs @@ -1236,7 +1255,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) { } override def typedIdent(tree: untpd.Ident, pt: Type)(using Context): Tree = - tryInline(tree.asInstanceOf[tpd.Tree]) `orElse` super.typedIdent(tree, pt) + inlineIfNeeded(tryInlineArg(tree.asInstanceOf[tpd.Tree]) `orElse` super.typedIdent(tree, pt)) override def typedSelect(tree: untpd.Select, pt: Type)(using Context): Tree = { assert(tree.hasType, tree) @@ -1248,11 +1267,12 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) { else val res = resMaybeReduced ensureAccessible(res.tpe, tree.qualifier.isInstanceOf[untpd.Super], tree.srcPos) - res + inlineIfNeeded(res) } override def typedIf(tree: untpd.If, pt: Type)(using Context): Tree = - typed(tree.cond, defn.BooleanType) match { + val condCtx = if tree.isInline then ctx.addMode(Mode.ForceInline) else ctx + typed(tree.cond, defn.BooleanType)(using condCtx) match { case cond1 @ ConstantValue(b: Boolean) => val selected0 = if (b) tree.thenp else tree.elsep val selected = if (selected0.isEmpty) tpd.Literal(Constant(())) else typed(selected0, pt) @@ -1278,14 +1298,30 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) { super.typedValDef(vdef1, sym) override def typedApply(tree: untpd.Apply, pt: Type)(using Context): Tree = - constToLiteral(betaReduce(super.typedApply(tree, pt))) match { + val res = constToLiteral(betaReduce(super.typedApply(tree, pt))) match { case res: Apply if res.symbol == defn.QuotedRuntime_exprSplice && level == 0 - && !suppressInline => + && !hasInliningErrors => val expanded = expandMacro(res.args.head, tree.span) typedExpr(expanded) // Inline calls and constant fold code generated by the macro - case res => res + case res => + inlineIfNeeded(res) } + if res.symbol == defn.QuotedRuntime_exprQuote then + ctx.compilationUnit.needsQuotePickling = true + res + + override def typedTypeApply(tree: untpd.TypeApply, pt: Type)(using Context): Tree = + inlineIfNeeded(constToLiteral(betaReduce(super.typedTypeApply(tree, pt)))) + + override def typedMatch(tree: untpd.Match, pt: Type)(using Context): Tree = + val tree1 = + if tree.isInline then + // TODO this might not be useful if we do not support #11291 + val sel1 = typedExpr(tree.selector)(using ctx.addMode(Mode.ForceInline)) + untpd.cpy.Match(tree)(sel1, tree.cases) + else tree + super.typedMatch(tree1, pt) override def typedMatchFinish(tree: untpd.Match, sel: Tree, wideSelType: Type, cases: List[untpd.CaseDef], pt: Type)(using Context) = if (!tree.isInline || ctx.owner.isInlineMethod) // don't reduce match of nested inline method yet @@ -1338,9 +1374,13 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) { override def newLikeThis: Typer = new InlineTyper(initialErrorCount) - /** Suppress further inlining if this inline typer has already issued errors */ - override def suppressInline(using Context) = - ctx.reporter.errorCount > initialErrorCount || super.suppressInline + /** True if this inline typer has already issued errors */ + override def hasInliningErrors(using Context) = ctx.reporter.errorCount > initialErrorCount + + private def inlineIfNeeded(tree: Tree)(using Context): Tree = + if Inliner.needsInlining(tree) then Inliner.inlineCall(tree) + else tree + } /** Drop any side-effect-free bindings that are unused in expansion or other reachable bindings. diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index b602656f61b2..674c4ea065f5 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -693,7 +693,7 @@ class Namer { typer: Typer => // make sure testing contexts are not captured by completers assert(!ictx.reporter.isInstanceOf[ExploringReporter]) - protected def typeSig(sym: Symbol): Type = original match { + protected def typeSig(sym: Symbol): Type = original match case original: ValDef => if (sym.is(Module)) moduleValSig(sym) else valOrDefDefSig(original, sym, Nil, identity)(using localContext(sym).setNewScope) @@ -702,16 +702,12 @@ class Namer { typer: Typer => nestedTyper(sym) = typer1 typer1.defDefSig(original, sym)(using localContext(sym).setTyper(typer1)) case imp: Import => - try { - val expr1 = typedAheadExpr(imp.expr, AnySelectionProto) + try + val expr1 = typedImportQualifier(imp, typedAheadExpr) ImportType(expr1) - } - catch { - case ex: CyclicReference => - typr.println(s"error while completing ${imp.expr}") - throw ex - } - } + catch case ex: CyclicReference => + typr.println(s"error while completing ${imp.expr}") + throw ex final override def complete(denot: SymDenotation)(using Context): Unit = { if (Config.showCompletions && ctx.typerState != creationContext.typerState) { @@ -987,6 +983,10 @@ class Namer { typer: Typer => def exportForwarders(exp: Export): List[tpd.MemberDef] = { val buf = new mutable.ListBuffer[tpd.MemberDef] val Export(expr, selectors) = exp + if expr.isEmpty then + report.error(em"Export selector must have prefix and `.`", exp.srcPos) + return Nil + val path = typedAheadExpr(expr, AnySelectionProto) checkLegalExportPath(path, selectors) lazy val wildcardBound = importBound(selectors, isGiven = false) @@ -1227,7 +1227,7 @@ class Namer { typer: Typer => else if pclazz.isEffectivelySealed && pclazz.associatedFile != cls.associatedFile then if pclazz.is(Sealed) then report.error(UnableToExtendSealedClass(pclazz), cls.srcPos) - else if sourceVersion.isAtLeast(`3.1`) then + else if sourceVersion.isAtLeast(future) then checkFeature(nme.adhocExtensions, i"Unless $pclazz is declared 'open', its extension in a separate file", cls.topLevelClass, diff --git a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala index 3478b493caeb..0240dad48e82 100644 --- a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala +++ b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala @@ -61,7 +61,7 @@ trait QuotesAndSplices { typedQuotePattern(tree, pt, qctx) else if tree.quoted.isType then val msg = em"Consider using canonical type constructor scala.quoted.Type.of[${tree.quoted}] instead" - if sourceVersion.isAtLeast(`3.1-migration`) then report.error(msg, tree.srcPos) + if sourceVersion.isAtLeast(`future-migration`) then report.error(msg, tree.srcPos) else report.warning(msg, tree.srcPos) typedTypeApply(untpd.TypeApply(untpd.ref(defn.QuotedTypeModule_of.termRef), tree.quoted :: Nil), pt)(using quoteContext).select(nme.apply).appliedTo(qctx) else @@ -166,7 +166,7 @@ trait QuotesAndSplices { else val tree1 = typedSelect(untpd.Select(tree.expr, tpnme.Underlying), pt)(using spliceContext).withSpan(tree.span) val msg = em"Consider using canonical type reference ${tree1.tpe} instead" - if sourceVersion.isAtLeast(`3.1-migration`) then report.error(msg, tree.srcPos) + if sourceVersion.isAtLeast(`future-migration`) then report.error(msg, tree.srcPos) else report.warning(msg, tree.srcPos) tree1 } diff --git a/compiler/src/dotty/tools/dotc/typer/ReTyper.scala b/compiler/src/dotty/tools/dotc/typer/ReTyper.scala index 0d34ffe1320e..8ff0dfc8c61b 100644 --- a/compiler/src/dotty/tools/dotc/typer/ReTyper.scala +++ b/compiler/src/dotty/tools/dotc/typer/ReTyper.scala @@ -118,7 +118,7 @@ class ReTyper extends Typer with ReChecking { try super.typedUnadapted(tree, pt, locked) catch { case NonFatal(ex) => - if (ctx.isAfterTyper) + if ctx.phase != Phases.typerPhase && ctx.phase != Phases.inliningPhase then println(i"exception while typing $tree of class ${tree.getClass} # ${tree.uniqueId}") throw ex } diff --git a/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala b/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala index 445c130e50fb..db6f5f9f60c0 100644 --- a/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala @@ -39,7 +39,10 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context): if defn.SpecialClassTagClasses.contains(sym) then classTag.select(sym.name.toTermName) else - classTag.select(nme.apply).appliedToType(tp).appliedTo(clsOf(erasure(tp))) + val clsOfType = erasure(tp) match + case JavaArrayType(elemType) => defn.ArrayOf(elemType) + case etp => etp + classTag.select(nme.apply).appliedToType(tp).appliedTo(clsOf(clsOfType)) tag.withSpan(span) case tp => EmptyTree case _ => EmptyTree diff --git a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala index a50c50b19186..36adc62487c4 100644 --- a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala +++ b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala @@ -463,7 +463,9 @@ trait TypeAssigner { def assignType(tree: untpd.TypeBoundsTree, lo: Tree, hi: Tree, alias: Tree)(using Context): TypeBoundsTree = tree.withType( if !alias.isEmpty then alias.tpe - else if lo eq hi then TypeAlias(lo.tpe) + else if lo eq hi then + if lo.tpe.isMatch then MatchAlias(lo.tpe) + else TypeAlias(lo.tpe) else TypeBounds(lo.tpe, hi.tpe)) def assignType(tree: untpd.Bind, sym: Symbol)(using Context): Bind = diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 7bd34bf8a414..cff9407e9328 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -848,7 +848,7 @@ class Typer extends Namer val tag = withTag(defn.TypeTestClass.typeRef.appliedTo(pt, tref)) .orElse(withTag(defn.ClassTagClass.typeRef.appliedTo(tref))) .getOrElse(tree) - if tag.symbol.owner == defn.ClassTagClass && config.Feature.sourceVersion.isAtLeast(config.SourceVersion.`3.1`) then + if tag.symbol.owner == defn.ClassTagClass && config.Feature.sourceVersion.isAtLeast(config.SourceVersion.future) then report.warning("Use of `scala.reflect.ClassTag` for type testing may be unsound. Consider using `scala.reflect.TypeTest` instead.", tree.srcPos) tag case _ => tree @@ -865,9 +865,9 @@ class Typer extends Namer */ val arg1 = pt match { case AppliedType(a, typ :: Nil) if ctx.isJava && a.isRef(defn.ArrayClass) => - tryAlternatively { typed(tree.arg, pt) } { + tryAlternatively { typed(tree.arg, pt) } { val elemTp = untpd.TypedSplice(TypeTree(typ)) - typed(untpd.JavaSeqLiteral(tree.arg :: Nil, elemTp), pt) + typed(untpd.JavaSeqLiteral(tree.arg :: Nil, elemTp), pt) } case _ => typed(tree.arg, pt) } @@ -1442,7 +1442,7 @@ class Typer extends Namer tree.selector.removeAttachment(desugar.CheckIrrefutable) match { case Some(checkMode) => val isPatDef = checkMode == desugar.MatchCheck.IrrefutablePatDef - if (!checkIrrefutable(sel, pat, isPatDef) && sourceVersion == `3.1-migration`) + if (!checkIrrefutable(sel, pat, isPatDef) && sourceVersion == `future-migration`) if (isPatDef) patch(Span(tree.selector.span.end), ": @unchecked") else patch(Span(pat.span.start), "case ") @@ -2024,7 +2024,6 @@ class Typer extends Namer } val vdef1 = assignType(cpy.ValDef(vdef)(name, tpt1, rhs1), sym) checkSignatureRepeatedParam(sym) - checkInlineConformant(tpt1, rhs1, sym) vdef1.setDefTree } @@ -2339,19 +2338,36 @@ class Typer extends Namer .asInstanceOf[untpd.ImportSelector] } - def typedImport(imp: untpd.Import, sym: Symbol)(using Context): Import = { - val expr1 = typedExpr(imp.expr, AnySelectionProto) + def typedImportQualifier(imp: untpd.Import, typd: (untpd.Tree, Type) => Tree)(using Context): Tree = + if imp.expr == untpd.EmptyTree then + assert(imp.selectors.length == 1, imp) + val from = imp.selectors.head.imported + val sel = tryAlternatively + (typedIdent(from, WildcardType)) + (typedIdent(cpy.Ident(from)(from.name.toTypeName), WildcardType)) + + sel.tpe match + case TermRef(prefix: SingletonType, _) => + singleton(prefix).withSpan(from.span) + case TypeRef(prefix: SingletonType, _) => + singleton(prefix).withSpan(from.span) + case _ => + errorTree(from, + em"""Illegal import selector: $from + |The selector is not a member of an object or package.""") + else typd(imp.expr, AnySelectionProto) + + def typedImport(imp: untpd.Import, sym: Symbol)(using Context): Import = + val expr1 = typedImportQualifier(imp, typedExpr) checkLegalImportPath(expr1) val selectors1 = typedSelectors(imp.selectors) assignType(cpy.Import(imp)(expr1, selectors1), sym) - } - def typedExport(exp: untpd.Export)(using Context): Export = { + def typedExport(exp: untpd.Export)(using Context): Export = val expr1 = typedExpr(exp.expr, AnySelectionProto) // already called `checkLegalExportPath` in Namer val selectors1 = typedSelectors(exp.selectors) assignType(cpy.Export(exp)(expr1, selectors1)) - } def typedPackageDef(tree: untpd.PackageDef)(using Context): Tree = val pid1 = withMode(Mode.InPackageClauseName)(typedExpr(tree.pid, AnySelectionProto)) @@ -2428,7 +2444,7 @@ class Typer extends Namer } } nestedCtx.typerState.commit() - if sourceVersion.isAtLeast(`3.1`) then + if sourceVersion.isAtLeast(future) then lazy val (prefix, suffix) = res match { case Block(mdef @ DefDef(_, vparams :: Nil, _, _) :: Nil, _: Closure) => val arity = vparams.length @@ -2440,7 +2456,7 @@ class Typer extends Namer if ((prefix ++ suffix).isEmpty) "simply leave out the trailing ` _`" else s"use `$prefix$suffix` instead" report.errorOrMigrationWarning(i"""The syntax ` _` is no longer supported; - |you can $remedy""", tree.srcPos, `3.1`) + |you can $remedy""", tree.srcPos, future) if sourceVersion.isMigrating then patch(Span(tree.span.start), prefix) patch(Span(qual.span.end, tree.span.end), suffix) @@ -2451,7 +2467,7 @@ class Typer extends Namer /** Translate infix operation expression `l op r` to * * l.op(r) if `op` is left-associative - * { val x = l; r.op(l) } if `op` is right-associative call-by-value and `l` is impure + * { val x = l; r.op(x) } if `op` is right-associative call-by-value and `l` is impure * r.op(l) if `op` is right-associative call-by-name or `l` is pure * * Translate infix type `l op r` to `op[l, r]` @@ -3148,8 +3164,8 @@ class Typer extends Namer def isContextBoundParams = wtp.stripPoly match case MethodType(EvidenceParamName(_) :: _) => true case _ => false - if sourceVersion == `3.1-migration` && isContextBoundParams - then // Under 3.1-migration, don't infer implicit arguments yet for parameters + if sourceVersion == `future-migration` && isContextBoundParams + then // Under future-migration, don't infer implicit arguments yet for parameters // coming from context bounds. Issue a warning instead and offer a patch. report.migrationWarning( em"""Context bounds will map to context parameters. @@ -3407,13 +3423,12 @@ class Typer extends Namer val meth = methPart(tree).symbol if meth.isAllOf(DeferredInline) && !Inliner.inInlineMethod then errorTree(tree, i"Deferred inline ${meth.showLocated} cannot be invoked") - else if (Inliner.isInlineable(tree) && !suppressInline && StagingContext.level == 0) { + else if Inliner.needsInlining(tree) then tree.tpe <:< wildApprox(pt) val errorCount = ctx.reporter.errorCount val inlined = Inliner.inlineCall(tree) if ((inlined ne tree) && errorCount == ctx.reporter.errorCount) readaptSimplified(inlined) else inlined - } else if (tree.symbol.isScala2Macro && // `raw`, `f` and `s` are eliminated by the StringInterpolatorOpt phase tree.symbol != defn.StringContext_raw && @@ -3731,8 +3746,8 @@ class Typer extends Namer } } - // Overridden in InlineTyper - def suppressInline(using Context): Boolean = ctx.isAfterTyper + /** True if this inline typer has already issued errors */ + def hasInliningErrors(using Context): Boolean = false /** Does the "contextuality" of the method type `methType` match the one of the prototype `pt`? * This is the case if diff --git a/compiler/src/dotty/tools/dotc/util/Signatures.scala b/compiler/src/dotty/tools/dotc/util/Signatures.scala index 58dde0c590d3..414d4ce7bd8e 100644 --- a/compiler/src/dotty/tools/dotc/util/Signatures.scala +++ b/compiler/src/dotty/tools/dotc/util/Signatures.scala @@ -66,7 +66,7 @@ object Signatures { case _ => val funSymbol = fun.symbol val alternatives = funSymbol.owner.info.member(funSymbol.name).alternatives - val alternativeIndex = alternatives.indexOf(funSymbol.denot) max 0 + val alternativeIndex = alternatives.map(_.symbol).indexOf(funSymbol) max 0 (alternativeIndex, alternatives) } diff --git a/compiler/src/dotty/tools/repl/ParseResult.scala b/compiler/src/dotty/tools/repl/ParseResult.scala index f7b20843a28d..352c568533c4 100644 --- a/compiler/src/dotty/tools/repl/ParseResult.scala +++ b/compiler/src/dotty/tools/repl/ParseResult.scala @@ -90,6 +90,7 @@ case object Reset extends Command { /** `:quit` exits the repl */ case object Quit extends Command { val command: String = ":quit" + val alias: String = ":exit" } /** `:help` shows the different commands implemented by the Dotty repl */ @@ -121,6 +122,7 @@ object ParseResult { private val commands: List[(String, String => ParseResult)] = List( Quit.command -> (_ => Quit), + Quit.alias -> (_ => Quit), Help.command -> (_ => Help), Reset.command -> (_ => Reset), Imports.command -> (_ => Imports), diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index 263fc51f8ba7..134f7e8507b8 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -76,6 +76,10 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler object reflect extends reflectModule: + object CompilationInfo extends CompilationInfoModule: + def isWhileTyping: Boolean = !ctx.isAfterTyper + end CompilationInfo + extension (expr: Expr[Any]) def asTerm: Term = val exprImpl = expr.asInstanceOf[ExprImpl] diff --git a/compiler/test-resources/repl/i5218 b/compiler/test-resources/repl/i5218 index abe63009ef74..e99590d0315d 100644 --- a/compiler/test-resources/repl/i5218 +++ b/compiler/test-resources/repl/i5218 @@ -3,4 +3,4 @@ val tuple: (Int, String, Long) = (1,2,3) scala> 0.0 *: tuple val res0: (Double, Int, String, Long) = (0.0,1,2,3) scala> tuple ++ tuple -val res1: Int *: String *: Long *: tuple.type = (1,2,3,1,2,3) +val res1: Int *: scala.Tuple.Concat[(String, Long), tuple.type] = (1,2,3,1,2,3) diff --git a/compiler/test/dotc/pos-test-pickling.blacklist b/compiler/test/dotc/pos-test-pickling.blacklist index 547a48d99b79..c83e51e921d6 100644 --- a/compiler/test/dotc/pos-test-pickling.blacklist +++ b/compiler/test/dotc/pos-test-pickling.blacklist @@ -34,6 +34,7 @@ i7872.scala 6687.scala i11236.scala i11247.scala +i11250 # Opaque type i5720.scala diff --git a/compiler/test/dotc/run-from-tasty.blacklist b/compiler/test/dotc/run-from-tasty.blacklist index e69de29bb2d1..2c483e9e34b6 100644 --- a/compiler/test/dotc/run-from-tasty.blacklist +++ b/compiler/test/dotc/run-from-tasty.blacklist @@ -0,0 +1,2 @@ +# CI only: cannot reduce summonFrom with +sip23-valueof.scala diff --git a/compiler/test/dotc/run-test-pickling.blacklist b/compiler/test/dotc/run-test-pickling.blacklist index aefe3b14b017..d36314e896d8 100644 --- a/compiler/test/dotc/run-test-pickling.blacklist +++ b/compiler/test/dotc/run-test-pickling.blacklist @@ -1,30 +1,35 @@ +derive-generic.scala eff-dependent.scala +enum-java +i5257.scala +i7212 +i7868.scala +i9011.scala +i9473.scala +macros-in-same-project1 +mixin-forwarder-overload +t10889 t3452d t3452e t3452g t7374 -tuples1.scala -tuples1a.scala -tuples1b.scala +t8905 +tuple-drop.scala +tuple-ops.scala tuple-ops.scala tuple-take.scala -tuple-drop.scala tuple-zip.scala +tuples1.scala +tuples1a.scala +tuples1b.scala +typeCheckErrors.scala +typeclass-derivation-doc-example.scala typeclass-derivation1.scala typeclass-derivation2.scala typeclass-derivation2a.scala +typeclass-derivation2b.scala typeclass-derivation2c.scala typeclass-derivation2d.scala typeclass-derivation3.scala -derive-generic.scala -mixin-forwarder-overload -t8905 -t10889 -macros-in-same-project1 -i5257.scala -i7868.scala -enum-java -zero-arity-case-class.scala -tuple-ops.scala -i7212 varargs-abstract +zero-arity-case-class.scala diff --git a/compiler/test/dotty/tools/backend/jvm/ArrayApplyOptTest.scala b/compiler/test/dotty/tools/backend/jvm/ArrayApplyOptTest.scala index 7c7c9f36ecca..e7cd20ba98b2 100644 --- a/compiler/test/dotty/tools/backend/jvm/ArrayApplyOptTest.scala +++ b/compiler/test/dotty/tools/backend/jvm/ArrayApplyOptTest.scala @@ -22,18 +22,18 @@ class ArrayApplyOptTest extends DottyBytecodeTest { test("Array[Char]()", newArray0Opcodes(T_CHAR)) test("Array[T]()", newArray0Opcodes(T_INT)) - test("IArray[String]()", List(Op(ICONST_0), TypeOp(ANEWARRAY, "java/lang/String"), TypeOp(CHECKCAST, "[Ljava/lang/String;"), Op(POP), Op(RETURN))) - test("IArray[Unit]()", List(Op(ICONST_0), TypeOp(ANEWARRAY, "scala/runtime/BoxedUnit"), TypeOp(CHECKCAST, "[Lscala/runtime/BoxedUnit;"), Op(POP), Op(RETURN))) - test("IArray[Object]()", List(Op(ICONST_0), TypeOp(ANEWARRAY, "java/lang/Object"), TypeOp(CHECKCAST, "[Ljava/lang/Object;"), Op(POP), Op(RETURN))) - test("IArray[Boolean]()", newArray0Opcodes(T_BOOLEAN, TypeOp(CHECKCAST, "[Z") :: Nil)) - test("IArray[Byte]()", newArray0Opcodes(T_BYTE, TypeOp(CHECKCAST, "[B") :: Nil)) - test("IArray[Short]()", newArray0Opcodes(T_SHORT, TypeOp(CHECKCAST, "[S") :: Nil)) - test("IArray[Int]()", newArray0Opcodes(T_INT, TypeOp(CHECKCAST, "[I") :: Nil)) - test("IArray[Long]()", newArray0Opcodes(T_LONG, TypeOp(CHECKCAST, "[J") :: Nil)) - test("IArray[Float]()", newArray0Opcodes(T_FLOAT, TypeOp(CHECKCAST, "[F") :: Nil)) - test("IArray[Double]()", newArray0Opcodes(T_DOUBLE, TypeOp(CHECKCAST, "[D") :: Nil)) - test("IArray[Char]()", newArray0Opcodes(T_CHAR, TypeOp(CHECKCAST, "[C") :: Nil)) - test("IArray[T]()", newArray0Opcodes(T_INT, TypeOp(CHECKCAST, "[I") :: Nil)) + test("IArray[String]()", List(Op(ICONST_0), TypeOp(ANEWARRAY, "java/lang/String"), Op(POP), Op(RETURN))) + test("IArray[Unit]()", List(Op(ICONST_0), TypeOp(ANEWARRAY, "scala/runtime/BoxedUnit"), Op(POP), Op(RETURN))) + test("IArray[Object]()", List(Op(ICONST_0), TypeOp(ANEWARRAY, "java/lang/Object"), Op(POP), Op(RETURN))) + test("IArray[Boolean]()", newArray0Opcodes(T_BOOLEAN)) + test("IArray[Byte]()", newArray0Opcodes(T_BYTE)) + test("IArray[Short]()", newArray0Opcodes(T_SHORT)) + test("IArray[Int]()", newArray0Opcodes(T_INT)) + test("IArray[Long]()", newArray0Opcodes(T_LONG)) + test("IArray[Float]()", newArray0Opcodes(T_FLOAT)) + test("IArray[Double]()", newArray0Opcodes(T_DOUBLE)) + test("IArray[Char]()", newArray0Opcodes(T_CHAR)) + test("IArray[T]()", newArray0Opcodes(T_INT)) } @Test def testArrayGenericApply = { @@ -42,10 +42,8 @@ class ArrayApplyOptTest extends DottyBytecodeTest { test("""Array("a", "b")""", opCodes("java/lang/String")) test("""Array[Object]("a", "b")""", opCodes("java/lang/Object")) - def opCodes2(tpe: String) = - List(Op(ICONST_2), TypeOp(ANEWARRAY, tpe), Op(DUP), Op(ICONST_0), Ldc(LDC, "a"), Op(AASTORE), Op(DUP), Op(ICONST_1), Ldc(LDC, "b"), Op(AASTORE), TypeOp(CHECKCAST, s"[L$tpe;"), Op(POP), Op(RETURN)) - test("""IArray("a", "b")""", opCodes2("java/lang/String")) - test("""IArray[Object]("a", "b")""", opCodes2("java/lang/Object")) + test("""IArray("a", "b")""", opCodes("java/lang/String")) + test("""IArray[Object]("a", "b")""", opCodes("java/lang/Object")) } @Test def testArrayApplyBoolean = { @@ -106,7 +104,7 @@ class ArrayApplyOptTest extends DottyBytecodeTest { Op(ICONST_1), Field(GETSTATIC, "scala/runtime/BoxedUnit", "UNIT", "Lscala/runtime/BoxedUnit;"), Op(AASTORE), Op(POP), Op(RETURN))) test("IArray[Unit]((), ())", List(Op(ICONST_2), TypeOp(ANEWARRAY, "scala/runtime/BoxedUnit"), Op(DUP), Op(ICONST_0), Field(GETSTATIC, "scala/runtime/BoxedUnit", "UNIT", "Lscala/runtime/BoxedUnit;"), Op(AASTORE), Op(DUP), - Op(ICONST_1), Field(GETSTATIC, "scala/runtime/BoxedUnit", "UNIT", "Lscala/runtime/BoxedUnit;"), Op(AASTORE), TypeOp(CHECKCAST, "[Lscala/runtime/BoxedUnit;"), Op(POP), Op(RETURN))) + Op(ICONST_1), Field(GETSTATIC, "scala/runtime/BoxedUnit", "UNIT", "Lscala/runtime/BoxedUnit;"), Op(AASTORE), Op(POP), Op(RETURN))) } @Test def testArrayInlined = test( diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala index 0506eefa89a3..d8b9f5178854 100644 --- a/compiler/test/dotty/tools/dotc/CompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala @@ -49,9 +49,9 @@ class CompilationTests { ), compileFile("tests/pos-special/typeclass-scaling.scala", defaultOptions.and("-Xmax-inlines", "40")), compileFile("tests/pos-special/indent-colons.scala", defaultOptions.and("-Yindent-colons")), - compileFile("tests/pos-special/i7296.scala", defaultOptions.and("-source", "3.1", "-deprecation", "-Xfatal-warnings")), + compileFile("tests/pos-special/i7296.scala", defaultOptions.and("-source", "future", "-deprecation", "-Xfatal-warnings")), compileFile("tests/pos-special/notNull.scala", defaultOptions.and("-Yexplicit-nulls")), - compileDir("tests/pos-special/adhoc-extension", defaultOptions.and("-source", "3.1", "-feature", "-Xfatal-warnings")), + compileDir("tests/pos-special/adhoc-extension", defaultOptions.and("-source", "future", "-feature", "-Xfatal-warnings")), compileFile("tests/pos-special/i7575.scala", defaultOptions.andLanguageFeature("dynamics")), compileFile("tests/pos-special/kind-projector.scala", defaultOptions.and("-Ykind-projector")), compileFile("tests/run/i5606.scala", defaultOptions.and("-Yretain-trees")), @@ -67,6 +67,7 @@ class CompilationTests { aggregateTests( compileFile("tests/rewrites/rewrites.scala", scala2CompatMode.and("-rewrite", "-indent")), + compileFile("tests/rewrites/rewrites3x.scala", defaultOptions.and("-rewrite", "-source", "3.1-migration")), compileFile("tests/rewrites/i8982.scala", defaultOptions.and("-indent", "-rewrite")), compileFile("tests/rewrites/i9632.scala", defaultOptions.and("-indent", "-rewrite")) ).checkRewrites() @@ -119,7 +120,7 @@ class CompilationTests { aggregateTests( compileFilesInDir("tests/neg", defaultOptions), compileFilesInDir("tests/neg-tailcall", defaultOptions), - compileFilesInDir("tests/neg-strict", defaultOptions.and("-source", "3.1", "-deprecation", "-Xfatal-warnings")), + compileFilesInDir("tests/neg-strict", defaultOptions.and("-source", "future", "-deprecation", "-Xfatal-warnings")), compileFilesInDir("tests/neg-no-kind-polymorphism", defaultOptions and "-Yno-kind-polymorphism"), compileFilesInDir("tests/neg-custom-args/deprecation", defaultOptions.and("-Xfatal-warnings", "-deprecation")), compileFilesInDir("tests/neg-custom-args/fatal-warnings", defaultOptions.and("-Xfatal-warnings")), @@ -154,18 +155,18 @@ class CompilationTests { "tests/neg-custom-args/toplevel-samesource/nested/S.scala"), defaultOptions), compileFile("tests/neg-custom-args/i6300.scala", allowDeepSubtypes), - compileFile("tests/neg-custom-args/infix.scala", defaultOptions.and("-source", "3.1", "-deprecation", "-Xfatal-warnings")), + compileFile("tests/neg-custom-args/infix.scala", defaultOptions.and("-source", "future", "-deprecation", "-Xfatal-warnings")), compileFile("tests/neg-custom-args/missing-alpha.scala", defaultOptions.and("-Yrequire-targetName", "-Xfatal-warnings")), - compileFile("tests/neg-custom-args/wildcards.scala", defaultOptions.and("-source", "3.1", "-deprecation", "-Xfatal-warnings")), + compileFile("tests/neg-custom-args/wildcards.scala", defaultOptions.and("-source", "future", "-deprecation", "-Xfatal-warnings")), compileFile("tests/neg-custom-args/indentRight.scala", defaultOptions.and("-no-indent", "-Xfatal-warnings")), - compileDir("tests/neg-custom-args/adhoc-extension", defaultOptions.and("-source", "3.1", "-feature", "-Xfatal-warnings")), + compileDir("tests/neg-custom-args/adhoc-extension", defaultOptions.and("-source", "future", "-feature", "-Xfatal-warnings")), compileFile("tests/neg/i7575.scala", defaultOptions.withoutLanguageFeatures.and("-language:_")), compileFile("tests/neg-custom-args/kind-projector.scala", defaultOptions.and("-Ykind-projector")), compileFile("tests/neg-custom-args/typeclass-derivation2.scala", defaultOptions.and("-Yerased-terms")), compileFile("tests/neg-custom-args/i5498-postfixOps.scala", defaultOptions withoutLanguageFeature "postfixOps"), compileFile("tests/neg-custom-args/deptypes.scala", defaultOptions.and("-language:experimental.dependent")), - compileFile("tests/neg-custom-args/matchable.scala", defaultOptions.and("-Xfatal-warnings", "-source", "3.1")), - compileFile("tests/neg-custom-args/i7314.scala", defaultOptions.and("-Xfatal-warnings", "-source", "3.1")) + compileFile("tests/neg-custom-args/matchable.scala", defaultOptions.and("-Xfatal-warnings", "-source", "future")), + compileFile("tests/neg-custom-args/i7314.scala", defaultOptions.and("-Xfatal-warnings", "-source", "future")) ).checkExpectedErrors() } @@ -181,7 +182,7 @@ class CompilationTests { aggregateTests( compileFile("tests/run-custom-args/tuple-cons.scala", allowDeepSubtypes), compileFile("tests/run-custom-args/i5256.scala", allowDeepSubtypes), - compileFile("tests/run-custom-args/fors.scala", defaultOptions.and("-source", "3.1")), + compileFile("tests/run-custom-args/fors.scala", defaultOptions.and("-source", "future")), compileFile("tests/run-custom-args/no-useless-forwarders.scala", defaultOptions and "-Xmixin-force-forwarders:false"), compileFile("tests/run-custom-args/defaults-serizaliable-no-forwarders.scala", defaultOptions and "-Xmixin-force-forwarders:false"), compileFilesInDir("tests/run-custom-args/erased", defaultOptions.and("-Yerased-terms")), @@ -244,7 +245,7 @@ class CompilationTests { compileList("lib", librarySources, defaultOptions.and("-Ycheck-reentrant", "-Yerased-terms", // support declaration of scala.compiletime.erasedValue - // "-source", "3.1", // TODO: re-enable once we allow : @unchecked in pattern definitions. Right now, lots of narrowing pattern definitions fail. + // "-source", "future", // TODO: re-enable once we allow : @unchecked in pattern definitions. Right now, lots of narrowing pattern definitions fail. ))(libGroup) val tastyCoreSources = sources(Paths.get("tasty/src")) ++ sources(Paths.get("tasty/src-bootstrapped")) diff --git a/compiler/test/dotty/tools/dotc/reporting/TestMessageLaziness.scala b/compiler/test/dotty/tools/dotc/reporting/TestMessageLaziness.scala index 8c792aa692a5..ea5c1b3af5f5 100644 --- a/compiler/test/dotty/tools/dotc/reporting/TestMessageLaziness.scala +++ b/compiler/test/dotty/tools/dotc/reporting/TestMessageLaziness.scala @@ -26,5 +26,5 @@ class TestMessageLaziness extends DottyTest { report.error(LazyError()) @Test def assureLazyExtendMessage = - report.errorOrMigrationWarning(LazyError(), from = config.SourceVersion.`3.1`) + report.errorOrMigrationWarning(LazyError(), from = config.SourceVersion.future) } diff --git a/compiler/test/dotty/tools/vulpix/TestFlags.scala b/compiler/test/dotty/tools/vulpix/TestFlags.scala index d7ffc9ac7982..0037d5f551fe 100644 --- a/compiler/test/dotty/tools/vulpix/TestFlags.scala +++ b/compiler/test/dotty/tools/vulpix/TestFlags.scala @@ -26,23 +26,17 @@ final case class TestFlags( private val languageFeatureFlag = "-language:" private def withoutLanguageFeaturesOptions = options.filterNot(_.startsWith(languageFeatureFlag)) - // TODO simplify to add `-language:feature` to `options` once - // https://github.com/lampepfl/dotty-feature-requests/issues/107 is implemented - def andLanguageFeature(feature: String) = { - val (languageFeatures, rest) = options.partition(_.startsWith(languageFeatureFlag)) - val existingFeatures = if (languageFeatures.isEmpty) languageFeatures.mkString(",") + "," else "" - copy(options = rest ++ Array(languageFeatureFlag + existingFeatures + feature)) - } + def andLanguageFeature(feature: String) = + copy(options = options ++ Array(s"$languageFeatureFlag$feature")) - def withoutLanguageFeature(feature: String) = { + def withoutLanguageFeature(feature: String) = val (languageFeatures, rest) = options.partition(_.startsWith(languageFeatureFlag)) - val filteredFeatures = languageFeatures.filter(_ == feature) + val existingFeatures = languageFeatures.flatMap(_.stripPrefix(languageFeatureFlag).split(",")) + val filteredFeatures = existingFeatures.filterNot(_ == feature) val newOptions = - if (filteredFeatures.isEmpty) rest + if filteredFeatures.isEmpty then rest else rest ++ Array(languageFeatureFlag + filteredFeatures.mkString(",")) - copy(options = newOptions) - } /** Subset of the flags that should be passed to javac. */ def javacFlags: Array[String] = { diff --git a/dist/bin/scalad b/dist/bin/scalad deleted file mode 100755 index bc0378af956e..000000000000 --- a/dist/bin/scalad +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env bash - -# Try to autodetect real location of the script - -if [ -z "$PROG_HOME" ] ; then - ## resolve links - $0 may be a link to PROG_HOME - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - PROG_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - PROG_HOME=`cd "$PROG_HOME" && pwd` - - cd "$saveddir" -fi - -source "$PROG_HOME/bin/common" - -# Set scala3-doc dep: -DOTTY_DOC_LIB=$(find_lib "*scala3-doc*") - -# Set flexmark deps: -FLEXMARK_LIBS="" -FLEXMARK_LIBS+=$(find_lib "*flexmark-0*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-formatter*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-ext-anchorlink*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-ext-autolink*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-ext-emoji*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-ext-gfm-strikethrough*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-ext-gfm-tables*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-ext-gfm-tasklist*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-ext-ins*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-ext-superscript*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-ext-tables*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-ext-wikilink*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-ext-yaml-front-matter*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-jira-converter*")$PSEP -FLEXMARK_LIBS+=$(find_lib "*flexmark-util*") - -# Set jackson deps: -JACKSON_LIBS="" -JACKSON_LIBS+=$(find_lib "*jackson-annotations*")$PSEP -JACKSON_LIBS+=$(find_lib "*jackson-core*")$PSEP -JACKSON_LIBS+=$(find_lib "*jackson-databind*")$PSEP -JACKSON_LIBS+=$(find_lib "*jackson-dataformat-yaml*") - -# Set liqp dep: -LIQP_LIB=$(find_lib "*liqp*") - -# Set ANTLR dep: -ANTLR_LIB=$(find_lib "*antlr-3*") -ANTLR_RUNTIME_LIB=$(find_lib "*antlr-runtime-3*") - -# Set autolink dep: -AUTOLINK_LIB=$(find_lib "*autolink-0.6*") # conflict with flexmark-ext-autolink-0.11 - -# Set snakeyaml dep: -SNAKEYAML_LIB=$(find_lib "*snakeyaml*") - -# Set ST4 dep: -ST4_LIB=$(find_lib "*ST4*") - -# Set jsoup dep: -JSOUP_LIB=$(find_lib "*jsoup*") - -CLASS_PATH="$DOTTY_LIB$PSEP$DOTTY_COMP$PSEP$TASTY_CORE$PSEP$DOTTY_DOC_LIB$PSEP$DOTTY_INTF$PSEP$SBT_INTF$PSEP$DOTTY_STAGING$PSEP$DOTTY_TASTY_INSPECTOR" -CLASS_PATH="$CLASS_PATH$PSEP$SCALA_LIB" -CLASS_PATH="$CLASS_PATH$PSEP$FLEXMARK_LIBS" -CLASS_PATH="$CLASS_PATH$PSEP$JACKSON_LIBS" -CLASS_PATH="$CLASS_PATH$PSEP$LIQP_LIB" -CLASS_PATH="$CLASS_PATH$PSEP$ANTLR_LIB$PSEP$ANTLR_RUNTIME_LIB" -CLASS_PATH="$CLASS_PATH$PSEP$AUTOLINK_LIB" -CLASS_PATH="$CLASS_PATH$PSEP$SNAKEYAML_LIB" -CLASS_PATH="$CLASS_PATH$PSEP$ST4_LIB" -CLASS_PATH="$CLASS_PATH$PSEP$JSOUP_LIB" - -eval exec "\"$JAVACMD\"" \ - -Dscala.usejavacp=true \ - "-classpath \"$CLASS_PATH\"" \ - dotty.tools.dottydoc.Main \ - $@ - -exit $? diff --git a/dist/bin/scaladoc b/dist/bin/scaladoc new file mode 100755 index 000000000000..792de1fe2201 --- /dev/null +++ b/dist/bin/scaladoc @@ -0,0 +1,138 @@ +#!/usr/bin/env bash + +if [ -z "$PROG_HOME" ] ; then + ## resolve links - $0 may be a link to PROG_HOME + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + PROG_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + PROG_HOME=`cd "$PROG_HOME" && pwd` + + cd "$saveddir" +fi + +source "$PROG_HOME/bin/common" + +default_java_opts="-Xmx768m -Xms768m" +withCompiler=true + +CompilerMain=dotty.tools.dotc.Main +DecompilerMain=dotty.tools.dotc.decompiler.Main +ReplMain=dotty.tools.repl.Main +ScriptingMain=dotty.tools.scripting.Main + +PROG_NAME=$CompilerMain + +addJava () { + java_args+=("'$1'") +} +addScala () { + scala_args+=("'$1'") +} +addResidual () { + residual_args+=("'$1'") +} +addScripting () { + scripting_args+=("'$1'") +} + +classpathArgs () { + CLASS_PATH="" + CLASS_PATH+="$(find_lib "*scaladoc*")$PSEP" + CLASS_PATH+="$(find_lib "*scala3-compiler*")$PSEP" + CLASS_PATH+="$(find_lib "*scala3-interfaces*")$PSEP" + CLASS_PATH+="$(find_lib "*scala3-library*")$PSEP" + CLASS_PATH+="$(find_lib "*tasty-core*")$PSEP" + CLASS_PATH+="$(find_lib "*scala3-tasty-inspector*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-0*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-html-parser*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-ext-anchorlink*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-ext-autolink*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-ext-emoji*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-ext-gfm-strikethrough*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-ext-gfm-tables*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-ext-gfm-tasklist*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-ext-wikilink*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-ext-yaml-front-matter*")$PSEP" + CLASS_PATH+="$(find_lib "*liqp*")$PSEP" + CLASS_PATH+="$(find_lib "*jsoup*")$PSEP" + CLASS_PATH+="$(find_lib "*jackson-dataformat-yaml*")$PSEP" + CLASS_PATH+="$(find_lib "*scala-asm*")$PSEP" + CLASS_PATH+="$(find_lib "*compiler-interface*")$PSEP" + CLASS_PATH+="$(find_lib "*jline-reader*")$PSEP" + CLASS_PATH+="$(find_lib "*jline-terminal-3*")$PSEP" + CLASS_PATH+="$(find_lib "*jline-terminal-jna*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-util*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-formatter*")$PSEP" + CLASS_PATH+="$(find_lib "*autolink-0.6*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-jira-converter*")$PSEP" + CLASS_PATH+="$(find_lib "*antlr-3*")$PSEP" + CLASS_PATH+="$(find_lib "*jackson-annotations*")$PSEP" + CLASS_PATH+="$(find_lib "*jackson-core*")$PSEP" + CLASS_PATH+="$(find_lib "*jackson-databind*")$PSEP" + CLASS_PATH+="$(find_lib "*snakeyaml*")$PSEP" + CLASS_PATH+="$(find_lib "*scala-library*")$PSEP" + CLASS_PATH+="$(find_lib "*protobuf-java*")$PSEP" + CLASS_PATH+="$(find_lib "*util-interface*")$PSEP" + CLASS_PATH+="$(find_lib "*jna-5*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-ext-tables*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-ext-ins*")$PSEP" + CLASS_PATH+="$(find_lib "*flexmark-ext-superscript*")$PSEP" + CLASS_PATH+="$(find_lib "*antlr-runtime*")$PSEP" + CLASS_PATH+="$(find_lib "*ST4*")" + + jvm_cp_args="-classpath \"$CLASS_PATH\"" +} + +in_scripting_args=false +while [[ $# -gt 0 ]]; do +case "$1" in + --) shift; for arg; do addResidual "$arg"; done; set -- ;; + -h|-help) help=true && shift ;; + -v|-verbose) verbose=true && addScala "-verbose" && shift ;; + -debug) DEBUG="$DEBUG_STR" && shift ;; + -q|-quiet) quiet=true && shift ;; + + -colors) colors=true && shift ;; + -no-colors) unset colors && shift ;; + # break out -D and -J options and add them to java_args so + # they reach the JVM in time to do some good. The -D options + # will be available as system properties. + -D*) addJava "$1" && shift ;; + -J*) addJava "${1:2}" && shift ;; + *) if [ $in_scripting_args == false ]; then + addResidual "$1" + else + addScripting "$1" + fi + shift + ;; + esac +done + +classpathArgs + +eval exec "\"$JAVACMD\"" \ + ${JAVA_OPTS:-$default_java_opts} \ + "$DEBUG" \ + "${java_args[@]}" \ + "$jvm_cp_args" \ + "dotty.tools.scaladoc.Main" \ + "${scala_args[@]}" \ + "${residual_args[@]}" \ + "$scripting_string" +exit $? diff --git a/doc-tool/bootstrap-theme/build.sh b/doc-tool/bootstrap-theme/build.sh deleted file mode 100755 index caff40b679b3..000000000000 --- a/doc-tool/bootstrap-theme/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -cd "$(dirname "$0")" -if [ ! -d "node_modules" ]; then - npm install -fi -npm run build -echo "Copying CSS result..." -cp target/bootstrap.min.css ../resources/css/bootstrap.min.css - -# Update the generated website without running sbt -gen_dir=../../docs/_site/css -if [ -d "$gen_dir" ]; then - cp ../resources/css/* $gen_dir/ -fi - -echo "Bootstrap CSS updated." diff --git a/doc-tool/bootstrap-theme/package-lock.json b/doc-tool/bootstrap-theme/package-lock.json deleted file mode 100644 index 0b6fe4fe703c..000000000000 --- a/doc-tool/bootstrap-theme/package-lock.json +++ /dev/null @@ -1,4544 +0,0 @@ -{ - "name": "dottydoc-bootstrap-theme", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@mrmlnc/readdir-enhanced": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", - "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", - "requires": { - "call-me-maybe": "^1.0.1", - "glob-to-regexp": "^0.3.0" - } - }, - "@nodelib/fs.stat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", - "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" - }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" - }, - "@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "requires": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" - }, - "@types/node": { - "version": "12.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.1.tgz", - "integrity": "sha512-aK9jxMypeSrhiYofWWBf/T7O+KwaiAHzM4sveCdWPn71lzUSMimRnKzhXDKfKwV1kWoBo2P1aGgaIYGLf9/ljw==" - }, - "@types/q": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", - "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==" - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "alphanum-sort": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", - "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=" - }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==" - }, - "async-foreach": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", - "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" - }, - "autoprefixer": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.6.1.tgz", - "integrity": "sha512-aVo5WxR3VyvyJxcJC3h4FKfwCQvQWb1tSI5VHNibddCVWrcD1NvlxEweg3TSgiPztMnWfjpy2FURKA2kvDE+Tw==", - "requires": { - "browserslist": "^4.6.3", - "caniuse-lite": "^1.0.30000980", - "chalk": "^2.4.2", - "normalize-range": "^0.1.2", - "num2fraction": "^1.2.2", - "postcss": "^7.0.17", - "postcss-value-parser": "^4.0.0" - } - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" - }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "requires": { - "inherits": "~2.0.0" - } - }, - "boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" - }, - "bootstrap": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.3.1.tgz", - "integrity": "sha512-rXqOmH1VilAt2DyPzluTi2blhk17bO7ef+zLLPlWvG494pDxcM234pJ8wTc/6R40UWizAIIMgxjvxZg5kmsbag==" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "browserslist": { - "version": "4.6.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.6.6.tgz", - "integrity": "sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA==", - "requires": { - "caniuse-lite": "^1.0.30000984", - "electron-to-chromium": "^1.3.191", - "node-releases": "^1.1.25" - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" - }, - "caller-callsite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", - "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", - "requires": { - "callsites": "^2.0.0" - } - }, - "caller-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", - "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", - "requires": { - "caller-callsite": "^2.0.0" - } - }, - "callsites": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", - "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=" - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - } - }, - "caniuse-api": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", - "integrity": "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==", - "requires": { - "browserslist": "^4.0.0", - "caniuse-lite": "^1.0.0", - "lodash.memoize": "^4.1.2", - "lodash.uniq": "^4.5.0" - } - }, - "caniuse-lite": { - "version": "1.0.30000989", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000989.tgz", - "integrity": "sha512-vrMcvSuMz16YY6GSVZ0dWDTJP8jqk3iFQ/Aq5iqblPwxSVVZI+zxDyTX0VPqtQsDnfdrBDcsmhgTEOh5R8Lbpw==" - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chokidar": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", - "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "coa": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", - "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", - "requires": { - "@types/q": "^1.5.1", - "chalk": "^2.4.1", - "q": "^1.1.2" - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/color/-/color-3.1.2.tgz", - "integrity": "sha512-vXTJhHebByxZn3lDvDJYw4lR5+uB3vuoHsuYA5AKuxRVn5wzzIfQKGLBmgdVRHKTJYeK5rvJcHnrd0Li49CFpg==", - "requires": { - "color-convert": "^1.9.1", - "color-string": "^1.5.2" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "color-string": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz", - "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", - "requires": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "cosmiconfig": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", - "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", - "requires": { - "import-fresh": "^2.0.0", - "is-directory": "^0.3.1", - "js-yaml": "^3.13.1", - "parse-json": "^4.0.0" - }, - "dependencies": { - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - } - } - }, - "cross-spawn": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", - "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", - "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" - } - }, - "css-color-names": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", - "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=" - }, - "css-declaration-sorter": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-4.0.1.tgz", - "integrity": "sha512-BcxQSKTSEEQUftYpBVnsH4SF05NTuBokb19/sBt6asXGKZ/6VP7PLG1CBCkFDYOnhXhPh0jMhO6xZ71oYHXHBA==", - "requires": { - "postcss": "^7.0.1", - "timsort": "^0.3.0" - } - }, - "css-select": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.0.2.tgz", - "integrity": "sha512-dSpYaDVoWaELjvZ3mS6IKZM/y2PMPa/XYoEfYNZePL4U/XgyxZNroHEHReDx/d+VgXh9VbCTtFqLkFbmeqeaRQ==", - "requires": { - "boolbase": "^1.0.0", - "css-what": "^2.1.2", - "domutils": "^1.7.0", - "nth-check": "^1.0.2" - } - }, - "css-select-base-adapter": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", - "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==" - }, - "css-tree": { - "version": "1.0.0-alpha.33", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.33.tgz", - "integrity": "sha512-SPt57bh5nQnpsTBsx/IXbO14sRc9xXu5MtMAVuo0BaQQmyf0NupNPPSoMaqiAF5tDFafYsTkfeH4Q/HCKXkg4w==", - "requires": { - "mdn-data": "2.0.4", - "source-map": "^0.5.3" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - } - } - }, - "css-unit-converter": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.1.tgz", - "integrity": "sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY=" - }, - "css-what": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", - "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==" - }, - "cssesc": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", - "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" - }, - "cssnano": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz", - "integrity": "sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==", - "requires": { - "cosmiconfig": "^5.0.0", - "cssnano-preset-default": "^4.0.7", - "is-resolvable": "^1.0.0", - "postcss": "^7.0.0" - } - }, - "cssnano-preset-default": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz", - "integrity": "sha512-x0YHHx2h6p0fCl1zY9L9roD7rnlltugGu7zXSKQx6k2rYw0Hi3IqxcoAGF7u9Q5w1nt7vK0ulxV8Lo+EvllGsA==", - "requires": { - "css-declaration-sorter": "^4.0.1", - "cssnano-util-raw-cache": "^4.0.1", - "postcss": "^7.0.0", - "postcss-calc": "^7.0.1", - "postcss-colormin": "^4.0.3", - "postcss-convert-values": "^4.0.1", - "postcss-discard-comments": "^4.0.2", - "postcss-discard-duplicates": "^4.0.2", - "postcss-discard-empty": "^4.0.1", - "postcss-discard-overridden": "^4.0.1", - "postcss-merge-longhand": "^4.0.11", - "postcss-merge-rules": "^4.0.3", - "postcss-minify-font-values": "^4.0.2", - "postcss-minify-gradients": "^4.0.2", - "postcss-minify-params": "^4.0.2", - "postcss-minify-selectors": "^4.0.2", - "postcss-normalize-charset": "^4.0.1", - "postcss-normalize-display-values": "^4.0.2", - "postcss-normalize-positions": "^4.0.2", - "postcss-normalize-repeat-style": "^4.0.2", - "postcss-normalize-string": "^4.0.2", - "postcss-normalize-timing-functions": "^4.0.2", - "postcss-normalize-unicode": "^4.0.1", - "postcss-normalize-url": "^4.0.1", - "postcss-normalize-whitespace": "^4.0.2", - "postcss-ordered-values": "^4.1.2", - "postcss-reduce-initial": "^4.0.3", - "postcss-reduce-transforms": "^4.0.2", - "postcss-svgo": "^4.0.2", - "postcss-unique-selectors": "^4.0.1" - } - }, - "cssnano-util-get-arguments": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz", - "integrity": "sha1-7ToIKZ8h11dBsg87gfGU7UnMFQ8=" - }, - "cssnano-util-get-match": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz", - "integrity": "sha1-wOTKB/U4a7F+xeUiULT1lhNlFW0=" - }, - "cssnano-util-raw-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.1.tgz", - "integrity": "sha512-qLuYtWK2b2Dy55I8ZX3ky1Z16WYsx544Q0UWViebptpwn/xDBmog2TLg4f+DBMg1rJ6JDWtn96WHbOKDWt1WQA==", - "requires": { - "postcss": "^7.0.0" - } - }, - "cssnano-util-same-parent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz", - "integrity": "sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q==" - }, - "csso": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/csso/-/csso-3.5.1.tgz", - "integrity": "sha512-vrqULLffYU1Q2tLdJvaCYbONStnfkfimRxXNaGjxMldI0C7JPBC4rB1RyjhfdZ4m1frm8pM9uRPKH3d2knZ8gg==", - "requires": { - "css-tree": "1.0.0-alpha.29" - }, - "dependencies": { - "css-tree": { - "version": "1.0.0-alpha.29", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.29.tgz", - "integrity": "sha512-sRNb1XydwkW9IOci6iB2xmy8IGCj6r/fr+JWitvJ2JxQRPzN3T4AGGVWCMlVmVwM1gtgALJRmGIlWv5ppnGGkg==", - "requires": { - "mdn-data": "~1.1.0", - "source-map": "^0.5.3" - } - }, - "mdn-data": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-1.1.4.tgz", - "integrity": "sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA==" - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - } - } - }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "requires": { - "array-find-index": "^1.0.1" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, - "dependency-graph": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.8.0.tgz", - "integrity": "sha512-DCvzSq2UiMsuLnj/9AL484ummEgLtZIcRS7YvtO38QnpX3vqh9nJ8P+zhu8Ja+SmLrBHO2iDbva20jq38qvBkQ==" - }, - "dir-glob": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", - "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", - "requires": { - "path-type": "^3.0.0" - }, - "dependencies": { - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "requires": { - "pify": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - } - } - }, - "dom-serializer": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.1.tgz", - "integrity": "sha512-sK3ujri04WyjwQXVoK4PU3y8ula1stq10GJZpqHIUgoGZdsGzAGu65BnU3d08aTVSvO7mGPZUc0wTEDL+qGE0Q==", - "requires": { - "domelementtype": "^2.0.1", - "entities": "^2.0.0" - }, - "dependencies": { - "domelementtype": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", - "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==" - } - } - }, - "domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" - }, - "domutils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", - "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", - "requires": { - "is-obj": "^1.0.0" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "electron-to-chromium": { - "version": "1.3.221", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.221.tgz", - "integrity": "sha512-YbNA7KgCvLq9ZaEa7wpYP7IP4LrJ4+b36oeF1lYBSJ0zVGVN7uo3Ct9qDUm/M3VDOWj03RVgsMFF8PdL8UjhzA==" - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "requires": { - "once": "^1.4.0" - } - }, - "entities": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", - "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==" - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", - "requires": { - "es-to-primitive": "^1.2.0", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-keys": "^1.0.12" - } - }, - "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" - }, - "fast-glob": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", - "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", - "requires": { - "@mrmlnc/readdir-enhanced": "^2.2.1", - "@nodelib/fs.stat": "^1.1.2", - "glob-parent": "^3.1.0", - "is-glob": "^4.0.0", - "merge2": "^1.2.3", - "micromatch": "^3.1.10" - } - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", - "optional": true, - "requires": { - "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "optional": true, - "requires": { - "debug": "^4.1.0", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true - } - } - }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "gaze": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", - "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", - "requires": { - "globule": "^1.0.0" - } - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "requires": { - "pump": "^3.0.0" - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "glob-to-regexp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", - "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=" - }, - "globby": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", - "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", - "requires": { - "@types/glob": "^7.1.1", - "array-union": "^1.0.2", - "dir-glob": "^2.2.2", - "fast-glob": "^2.2.6", - "glob": "^7.1.3", - "ignore": "^4.0.3", - "pify": "^4.0.1", - "slash": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" - } - } - }, - "globule": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz", - "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", - "requires": { - "glob": "~7.1.1", - "lodash": "~4.17.10", - "minimatch": "~3.0.2" - } - }, - "graceful-fs": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.1.tgz", - "integrity": "sha512-b9usnbDGnD928gJB3LrCmxoibr3VE4U2SMo5PBuBnokWyDADTqDPXg4YpwKF1trpH+UbGp7QLicO3+aWEy0+mw==" - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hex-color-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", - "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==" - }, - "hosted-git-info": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", - "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==" - }, - "hsl-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hsl-regex/-/hsl-regex-1.0.0.tgz", - "integrity": "sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4=" - }, - "hsla-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hsla-regex/-/hsla-regex-1.0.0.tgz", - "integrity": "sha1-wc56MWjIxmFAM6S194d/OyJfnDg=" - }, - "html-comment-regex": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz", - "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==" - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" - }, - "import-cwd": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz", - "integrity": "sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk=", - "requires": { - "import-from": "^2.1.0" - } - }, - "import-fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", - "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", - "requires": { - "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" - } - }, - "import-from": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz", - "integrity": "sha1-M1238qev/VOqpHHUuAId7ja387E=", - "requires": { - "resolve-from": "^3.0.0" - } - }, - "in-publish": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz", - "integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=" - }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "requires": { - "repeating": "^2.0.0" - } - }, - "indexes-of": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", - "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, - "is-absolute-url": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", - "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=" - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" - }, - "is-color-stop": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-color-stop/-/is-color-stop-1.1.0.tgz", - "integrity": "sha1-z/9HGu5N1cnhWFmPvhKWe1za00U=", - "requires": { - "css-color-names": "^0.0.4", - "hex-color-regex": "^1.1.0", - "hsl-regex": "^1.0.0", - "hsla-regex": "^1.0.0", - "rgb-regex": "^1.0.1", - "rgba-regex": "^1.0.0" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" - } - } - }, - "is-directory": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", - "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=" - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "requires": { - "isobject": "^3.0.1" - } - }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "requires": { - "has": "^1.0.1" - } - }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==" - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, - "is-svg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-3.0.0.tgz", - "integrity": "sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ==", - "requires": { - "html-comment-regex": "^1.1.0" - } - }, - "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", - "requires": { - "has-symbols": "^1.0.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "js-base64": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz", - "integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==" - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "^1.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "dependencies": { - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" - } - } - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" - }, - "lodash.memoize": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", - "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=" - }, - "lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" - }, - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", - "requires": { - "chalk": "^2.0.1" - } - }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "requires": { - "p-defer": "^1.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" - }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "requires": { - "object-visit": "^1.0.0" - } - }, - "mdn-data": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", - "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==" - }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - } - }, - "merge2": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.4.tgz", - "integrity": "sha512-FYE8xI+6pjFOhokZu0We3S5NKCirLbCzSh2Usf3qEyr4X8U+0jNg9P8RZ4qz+V2UoECLVwSyzU3LxXBaLGtD3A==" - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "mime-db": { - "version": "1.42.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", - "integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==" - }, - "mime-types": { - "version": "2.1.25", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.25.tgz", - "integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==", - "requires": { - "mime-db": "1.42.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" - }, - "node-gyp": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", - "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", - "requires": { - "fstream": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "osenv": "0", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", - "tar": "^2.0.0", - "which": "1" - }, - "dependencies": { - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" - } - } - }, - "node-releases": { - "version": "1.1.26", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.26.tgz", - "integrity": "sha512-fZPsuhhUHMTlfkhDLGtfY80DSJTjOcx+qD1j5pqPkuhUHVS7xHZIg9EE4DHK8O3f0zTxXHX5VIkDG8pu98/wfQ==", - "requires": { - "semver": "^5.3.0" - } - }, - "node-sass": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.0.tgz", - "integrity": "sha512-W1XBrvoJ1dy7VsvTAS5q1V45lREbTlZQqFbiHb3R3OTTCma0XBtuG6xZ6Z4506nR4lmHPTqVRwxT6KgtWC97CA==", - "requires": { - "async-foreach": "^0.1.3", - "chalk": "^1.1.1", - "cross-spawn": "^3.0.0", - "gaze": "^1.0.0", - "get-stdin": "^4.0.1", - "glob": "^7.0.3", - "in-publish": "^2.0.0", - "lodash": "^4.17.15", - "meow": "^3.7.0", - "mkdirp": "^0.5.1", - "nan": "^2.13.2", - "node-gyp": "^3.8.0", - "npmlog": "^4.0.0", - "request": "^2.88.0", - "sass-graph": "^2.2.4", - "stdout-stream": "^1.4.0", - "true-case-path": "^1.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" - } - } - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "requires": { - "abbrev": "1" - } - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" - }, - "normalize-range": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", - "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=" - }, - "normalize-url": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", - "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==" - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "requires": { - "path-key": "^2.0.0" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "nth-check": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", - "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", - "requires": { - "boolbase": "~1.0.0" - } - }, - "num2fraction": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", - "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=" - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "requires": { - "isobject": "^3.0.0" - } - }, - "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "requires": { - "isobject": "^3.0.1" - } - }, - "object.values": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz", - "integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.12.0", - "function-bind": "^1.1.1", - "has": "^1.0.3" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "requires": { - "lcid": "^1.0.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" - }, - "p-is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==" - }, - "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "requires": { - "error-ex": "^1.2.0" - } - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "requires": { - "pinkie": "^2.0.0" - } - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" - }, - "postcss": { - "version": "7.0.17", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.17.tgz", - "integrity": "sha512-546ZowA+KZ3OasvQZHsbuEpysvwTZNGJv9EfyCQdsIDltPSWHAeTQ5fQy/Npi2ZDtLI3zs7Ps/p6wThErhm9fQ==", - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - }, - "dependencies": { - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "postcss-calc": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.1.tgz", - "integrity": "sha512-oXqx0m6tb4N3JGdmeMSc/i91KppbYsFZKdH0xMOqK8V1rJlzrKlTdokz8ozUXLVejydRN6u2IddxpcijRj2FqQ==", - "requires": { - "css-unit-converter": "^1.1.1", - "postcss": "^7.0.5", - "postcss-selector-parser": "^5.0.0-rc.4", - "postcss-value-parser": "^3.3.1" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-cli": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/postcss-cli/-/postcss-cli-6.1.3.tgz", - "integrity": "sha512-eieqJU+OR1OFc/lQqMsDmROTJpoMZFvoAQ+82utBQ8/8qGMTfH9bBSPsTdsagYA8uvNzxHw2I2cNSSJkLAGhvw==", - "requires": { - "chalk": "^2.1.0", - "chokidar": "^2.0.0", - "dependency-graph": "^0.8.0", - "fs-extra": "^7.0.0", - "get-stdin": "^6.0.0", - "globby": "^9.0.0", - "postcss": "^7.0.0", - "postcss-load-config": "^2.0.0", - "postcss-reporter": "^6.0.0", - "pretty-hrtime": "^1.0.3", - "read-cache": "^1.0.0", - "yargs": "^12.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "requires": { - "locate-path": "^3.0.0" - } - }, - "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==" - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "requires": { - "invert-kv": "^2.0.0" - } - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" - }, - "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - } - }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "postcss-colormin": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-4.0.3.tgz", - "integrity": "sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw==", - "requires": { - "browserslist": "^4.0.0", - "color": "^3.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-convert-values": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz", - "integrity": "sha512-Kisdo1y77KUC0Jmn0OXU/COOJbzM8cImvw1ZFsBgBgMgb1iL23Zs/LXRe3r+EZqM3vGYKdQ2YJVQ5VkJI+zEJQ==", - "requires": { - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-discard-comments": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz", - "integrity": "sha512-RJutN259iuRf3IW7GZyLM5Sw4GLTOH8FmsXBnv8Ab/Tc2k4SR4qbV4DNbyyY4+Sjo362SyDmW2DQ7lBSChrpkg==", - "requires": { - "postcss": "^7.0.0" - } - }, - "postcss-discard-duplicates": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz", - "integrity": "sha512-ZNQfR1gPNAiXZhgENFfEglF93pciw0WxMkJeVmw8eF+JZBbMD7jp6C67GqJAXVZP2BWbOztKfbsdmMp/k8c6oQ==", - "requires": { - "postcss": "^7.0.0" - } - }, - "postcss-discard-empty": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz", - "integrity": "sha512-B9miTzbznhDjTfjvipfHoqbWKwd0Mj+/fL5s1QOz06wufguil+Xheo4XpOnc4NqKYBCNqqEzgPv2aPBIJLox0w==", - "requires": { - "postcss": "^7.0.0" - } - }, - "postcss-discard-overridden": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz", - "integrity": "sha512-IYY2bEDD7g1XM1IDEsUT4//iEYCxAmP5oDSFMVU/JVvT7gh+l4fmjciLqGgwjdWpQIdb0Che2VX00QObS5+cTg==", - "requires": { - "postcss": "^7.0.0" - } - }, - "postcss-load-config": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-2.1.0.tgz", - "integrity": "sha512-4pV3JJVPLd5+RueiVVB+gFOAa7GWc25XQcMp86Zexzke69mKf6Nx9LRcQywdz7yZI9n1udOxmLuAwTBypypF8Q==", - "requires": { - "cosmiconfig": "^5.0.0", - "import-cwd": "^2.0.0" - } - }, - "postcss-merge-longhand": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz", - "integrity": "sha512-alx/zmoeXvJjp7L4mxEMjh8lxVlDFX1gqWHzaaQewwMZiVhLo42TEClKaeHbRf6J7j82ZOdTJ808RtN0ZOZwvw==", - "requires": { - "css-color-names": "0.0.4", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0", - "stylehacks": "^4.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-merge-rules": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz", - "integrity": "sha512-U7e3r1SbvYzO0Jr3UT/zKBVgYYyhAz0aitvGIYOYK5CPmkNih+WDSsS5tvPrJ8YMQYlEMvsZIiqmn7HdFUaeEQ==", - "requires": { - "browserslist": "^4.0.0", - "caniuse-api": "^3.0.0", - "cssnano-util-same-parent": "^4.0.0", - "postcss": "^7.0.0", - "postcss-selector-parser": "^3.0.0", - "vendors": "^1.0.0" - }, - "dependencies": { - "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", - "requires": { - "dot-prop": "^4.1.1", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } - } - } - }, - "postcss-minify-font-values": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz", - "integrity": "sha512-j85oO6OnRU9zPf04+PZv1LYIYOprWm6IA6zkXkrJXyRveDEuQggG6tvoy8ir8ZwjLxLuGfNkCZEQG7zan+Hbtg==", - "requires": { - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-minify-gradients": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz", - "integrity": "sha512-qKPfwlONdcf/AndP1U8SJ/uzIJtowHlMaSioKzebAXSG4iJthlWC9iSWznQcX4f66gIWX44RSA841HTHj3wK+Q==", - "requires": { - "cssnano-util-get-arguments": "^4.0.0", - "is-color-stop": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-minify-params": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz", - "integrity": "sha512-G7eWyzEx0xL4/wiBBJxJOz48zAKV2WG3iZOqVhPet/9geefm/Px5uo1fzlHu+DOjT+m0Mmiz3jkQzVHe6wxAWg==", - "requires": { - "alphanum-sort": "^1.0.0", - "browserslist": "^4.0.0", - "cssnano-util-get-arguments": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0", - "uniqs": "^2.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-minify-selectors": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz", - "integrity": "sha512-D5S1iViljXBj9kflQo4YutWnJmwm8VvIsU1GeXJGiG9j8CIg9zs4voPMdQDUmIxetUOh60VilsNzCiAFTOqu3g==", - "requires": { - "alphanum-sort": "^1.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-selector-parser": "^3.0.0" - }, - "dependencies": { - "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", - "requires": { - "dot-prop": "^4.1.1", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } - } - } - }, - "postcss-normalize-charset": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz", - "integrity": "sha512-gMXCrrlWh6G27U0hF3vNvR3w8I1s2wOBILvA87iNXaPvSNo5uZAMYsZG7XjCUf1eVxuPfyL4TJ7++SGZLc9A3g==", - "requires": { - "postcss": "^7.0.0" - } - }, - "postcss-normalize-display-values": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz", - "integrity": "sha512-3F2jcsaMW7+VtRMAqf/3m4cPFhPD3EFRgNs18u+k3lTJJlVe7d0YPO+bnwqo2xg8YiRpDXJI2u8A0wqJxMsQuQ==", - "requires": { - "cssnano-util-get-match": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-normalize-positions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz", - "integrity": "sha512-Dlf3/9AxpxE+NF1fJxYDeggi5WwV35MXGFnnoccP/9qDtFrTArZ0D0R+iKcg5WsUd8nUYMIl8yXDCtcrT8JrdA==", - "requires": { - "cssnano-util-get-arguments": "^4.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-normalize-repeat-style": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz", - "integrity": "sha512-qvigdYYMpSuoFs3Is/f5nHdRLJN/ITA7huIoCyqqENJe9PvPmLhNLMu7QTjPdtnVf6OcYYO5SHonx4+fbJE1+Q==", - "requires": { - "cssnano-util-get-arguments": "^4.0.0", - "cssnano-util-get-match": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-normalize-string": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz", - "integrity": "sha512-RrERod97Dnwqq49WNz8qo66ps0swYZDSb6rM57kN2J+aoyEAJfZ6bMx0sx/F9TIEX0xthPGCmeyiam/jXif0eA==", - "requires": { - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-normalize-timing-functions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz", - "integrity": "sha512-acwJY95edP762e++00Ehq9L4sZCEcOPyaHwoaFOhIwWCDfik6YvqsYNxckee65JHLKzuNSSmAdxwD2Cud1Z54A==", - "requires": { - "cssnano-util-get-match": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-normalize-unicode": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.1.tgz", - "integrity": "sha512-od18Uq2wCYn+vZ/qCOeutvHjB5jm57ToxRaMeNuf0nWVHaP9Hua56QyMF6fs/4FSUnVIw0CBPsU0K4LnBPwYwg==", - "requires": { - "browserslist": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-normalize-url": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz", - "integrity": "sha512-p5oVaF4+IHwu7VpMan/SSpmpYxcJMtkGppYf0VbdH5B6hN8YNmVyJLuY9FmLQTzY3fag5ESUUHDqM+heid0UVA==", - "requires": { - "is-absolute-url": "^2.0.0", - "normalize-url": "^3.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-normalize-whitespace": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz", - "integrity": "sha512-tO8QIgrsI3p95r8fyqKV+ufKlSHh9hMJqACqbv2XknufqEDhDvbguXGBBqxw9nsQoXWf0qOqppziKJKHMD4GtA==", - "requires": { - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-ordered-values": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz", - "integrity": "sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw==", - "requires": { - "cssnano-util-get-arguments": "^4.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-reduce-initial": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz", - "integrity": "sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA==", - "requires": { - "browserslist": "^4.0.0", - "caniuse-api": "^3.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0" - } - }, - "postcss-reduce-transforms": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz", - "integrity": "sha512-EEVig1Q2QJ4ELpJXMZR8Vt5DQx8/mo+dGWSR7vWXqcob2gQLyQGsionYcGKATXvQzMPn6DSN1vTN7yFximdIAg==", - "requires": { - "cssnano-util-get-match": "^4.0.0", - "has": "^1.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-reporter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-6.0.1.tgz", - "integrity": "sha512-LpmQjfRWyabc+fRygxZjpRxfhRf9u/fdlKf4VHG4TSPbV2XNsuISzYW1KL+1aQzx53CAppa1bKG4APIB/DOXXw==", - "requires": { - "chalk": "^2.4.1", - "lodash": "^4.17.11", - "log-symbols": "^2.2.0", - "postcss": "^7.0.7" - } - }, - "postcss-selector-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", - "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", - "requires": { - "cssesc": "^2.0.0", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } - }, - "postcss-svgo": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.2.tgz", - "integrity": "sha512-C6wyjo3VwFm0QgBy+Fu7gCYOkCmgmClghO+pjcxvrcBKtiKt0uCF+hvbMO1fyv5BMImRK90SMb+dwUnfbGd+jw==", - "requires": { - "is-svg": "^3.0.0", - "postcss": "^7.0.0", - "postcss-value-parser": "^3.0.0", - "svgo": "^1.0.0" - }, - "dependencies": { - "postcss-value-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", - "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" - } - } - }, - "postcss-unique-selectors": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz", - "integrity": "sha512-+JanVaryLo9QwZjKrmJgkI4Fn8SBgRO6WXQBJi7KiAVPlmxikB5Jzc4EvXMT2H0/m0RjrVVm9rGNhZddm/8Spg==", - "requires": { - "alphanum-sort": "^1.0.0", - "postcss": "^7.0.0", - "uniqs": "^2.0.0" - } - }, - "postcss-value-parser": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.2.tgz", - "integrity": "sha512-LmeoohTpp/K4UiyQCwuGWlONxXamGzCMtFxLq4W1nZVGIQLYvMCJx3yAF9qyyuFpflABI9yVdtJAqbihOsCsJQ==" - }, - "pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "psl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", - "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "read-cache": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", - "integrity": "sha1-5mTvMRYRZsl1HNvo28+GtftY93Q=", - "requires": { - "pify": "^2.3.0" - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" - }, - "resolve": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.2.tgz", - "integrity": "sha512-cAVTI2VLHWYsGOirfeYVVQ7ZDejtQ9fp4YhYckWDEkFfqbVjaT11iM8k6xSAfGFMM+gDpZjMnFssPu8we+mqFw==", - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=" - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" - }, - "rgb-regex": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz", - "integrity": "sha1-wODWiC3w4jviVKR16O3UGRX+rrE=" - }, - "rgba-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/rgba-regex/-/rgba-regex-1.0.0.tgz", - "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=" - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "sass-graph": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", - "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", - "requires": { - "glob": "^7.0.0", - "lodash": "^4.0.0", - "scss-tokenizer": "^0.2.3", - "yargs": "^7.0.0" - } - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" - }, - "scss-tokenizer": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz", - "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=", - "requires": { - "js-base64": "^2.1.8", - "source-map": "^0.4.2" - }, - "dependencies": { - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, - "simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", - "requires": { - "is-arrayish": "^0.3.1" - }, - "dependencies": { - "is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" - } - } - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==" - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stable": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", - "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==" - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "stdout-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", - "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", - "requires": { - "readable-stream": "^2.0.1" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "requires": { - "get-stdin": "^4.0.1" - } - }, - "stylehacks": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz", - "integrity": "sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==", - "requires": { - "browserslist": "^4.0.0", - "postcss": "^7.0.0", - "postcss-selector-parser": "^3.0.0" - }, - "dependencies": { - "postcss-selector-parser": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", - "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", - "requires": { - "dot-prop": "^4.1.1", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } - } - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - }, - "svgo": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.0.tgz", - "integrity": "sha512-MLfUA6O+qauLDbym+mMZgtXCGRfIxyQoeH6IKVcFslyODEe/ElJNwr0FohQ3xG4C6HK6bk3KYPPXwHVJk3V5NQ==", - "requires": { - "chalk": "^2.4.1", - "coa": "^2.0.2", - "css-select": "^2.0.0", - "css-select-base-adapter": "^0.1.1", - "css-tree": "1.0.0-alpha.33", - "csso": "^3.5.1", - "js-yaml": "^3.13.1", - "mkdirp": "~0.5.1", - "object.values": "^1.1.0", - "sax": "~1.2.4", - "stable": "^0.1.8", - "unquote": "~1.1.1", - "util.promisify": "~1.0.0" - } - }, - "tar": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", - "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", - "requires": { - "block-stream": "*", - "fstream": "^1.0.12", - "inherits": "2" - } - }, - "timsort": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", - "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=" - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } - } - }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=" - }, - "true-case-path": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz", - "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", - "requires": { - "glob": "^7.1.2" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, - "uniq": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", - "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=" - }, - "uniqs": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz", - "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=" - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" - }, - "unquote": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", - "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=" - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" - } - } - }, - "upath": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", - "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==" - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "util.promisify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", - "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", - "requires": { - "define-properties": "^1.1.2", - "object.getownpropertydescriptors": "^2.0.3" - } - }, - "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "vendors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.3.tgz", - "integrity": "sha512-fOi47nsJP5Wqefa43kyWSg80qF+Q3XA6MUkgi7Hp1HQaKDQW4cQrK2D0P7mmbFtsV1N89am55Yru/nyEwRubcw==" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, - "yargs": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", - "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" - }, - "dependencies": { - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" - } - } - }, - "yargs-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", - "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", - "requires": { - "camelcase": "^3.0.0" - }, - "dependencies": { - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" - } - } - } - } -} diff --git a/doc-tool/bootstrap-theme/package.json b/doc-tool/bootstrap-theme/package.json deleted file mode 100644 index d5a6090734c9..000000000000 --- a/doc-tool/bootstrap-theme/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "dottydoc-bootstrap-theme", - "version": "1.0.0", - "description": "Customized Bootstrap for Dottydoc", - "main": "", - "scripts": { - "process-sass": "node-sass theme.scss --output-style expanded --precision 6 target/bootstrap.css", - "enhance-css": "postcss target/bootstrap.css --use autoprefixer cssnano --output target/bootstrap.min.css --no-map", - "build": "npm run process-sass && npm run enhance-css" - }, - "author": "", - "license": "BSD 3-Clause", - "dependencies": { - "autoprefixer": "^9.6.1", - "bootstrap": "^4.3.1", - "cssnano": "^4.1.10", - "node-sass": "^4.13.0", - "postcss-cli": "^6.1.3" - } -} diff --git a/doc-tool/bootstrap-theme/theme.scss b/doc-tool/bootstrap-theme/theme.scss deleted file mode 100644 index 2459be2eded0..000000000000 --- a/doc-tool/bootstrap-theme/theme.scss +++ /dev/null @@ -1,99 +0,0 @@ -// Required imports -@import "node_modules/bootstrap/scss/functions"; -@import "node_modules/bootstrap/scss/variables"; -@import "node_modules/bootstrap/scss/mixins"; - -// Web fonts -@import url('https://fonts.googleapis.com/css?family=Lato:400,700|Fira+Code:400,700&display=fallback'); - -// Custom colors -$pro-grey: #414551; -$soft-red: #ca445e; -$light: #fafafa; -$code-color: $soft-red; // overrides bootstrap - -$theme-colors: ( - "primary": $pro-grey, - "secondary": $soft-red -); - -$colors: ( - "light": $light, - - "toolbar": $pro-grey, - "toolbar-entry": $light, - "toolbar-active": lighten($pro-grey, 25), - - "sidebar": $light, - "sidebar-category": #000, - "sidebar-page": $pro-grey, - "sidebar-active": $soft-red, - - "pre-bg": $light, //
 blocks of code background
-  "doc-bg": rgba($soft-red, 0.135) //#ca44c822
-);
-
-// Responsive control
-$container-max-widths: (
-  md: 720px,
-  lg: 960px,
-  xl: 960px
-);
-
-// Body Fonts
-$font-family-monospace: "Fira Code", "Andale Mono", monospace;
-$font-family-sans-serif: "Lato", sans-serif;
-//$font-family-serif: (use the default value)
-$font-family-base: $font-family-sans-serif;
-$headings-font-family: $font-family-sans-serif;
-
-$font-weight-light: 300;
-$font-weight-normal: 400;
-$font-weight-bold: 700;
-$headings-font-weight: 400;
-
-// Nav Fonts
-$toolbar-main-font: $headings-font-family;
-$toolbar-main-weight: $font-weight-normal;
-$toolbar-details-font: $headings-font-family;
-$toolbar-details-weight: $font-weight-normal;
-
-$sidebar-font: $headings-font-family;
-$sidebar-category-weight: $font-weight-normal;
-$sidebar-category-size: 18px;
-$sidebar-page-weight: $font-weight-normal;
-$sidebar-page-size: 1rem;
-
-// Features imports - follow the order of bootstrap.scss (bootstrap's module)
-@import "node_modules/bootstrap/scss/root";
-@import "node_modules/bootstrap/scss/reboot";
-@import "node_modules/bootstrap/scss/type";
-@import "node_modules/bootstrap/scss/images";
-@import "node_modules/bootstrap/scss/code";
-@import "node_modules/bootstrap/scss/grid";
-@import "node_modules/bootstrap/scss/tables";
-@import "node_modules/bootstrap/scss/buttons";
-@import "node_modules/bootstrap/scss/transitions";
-@import "node_modules/bootstrap/scss/nav";
-@import "node_modules/bootstrap/scss/navbar";
-@import "node_modules/bootstrap/scss/breadcrumb";
-@import "node_modules/bootstrap/scss/badge";
-@import "node_modules/bootstrap/scss/spinners";
-@import "node_modules/bootstrap/scss/utilities";
-
-// Additional CSS variables
-:root {
-  --font-family-toolbar-main: #{inspect($toolbar-main-font)};
-  --font-weight-toolbar-main: #{$toolbar-main-weight};
-
-  --font-family-toolbar-details: #{inspect($toolbar-details-font)};
-  --font-weight-toolbar-details: #{$toolbar-details-weight};
-
-  --font-family-sidebar: #{inspect($sidebar-font)};
-
-  --font-size-sidebar-category: #{$sidebar-category-size};
-  --font-weight-sidebar-category: #{$sidebar-category-weight};
-
-  --font-size-sidebar-page: #{$sidebar-page-size};
-  --font-weight-sidebar-page: #{$sidebar-page-weight};
-}
diff --git a/doc-tool/resources/_includes/header.html b/doc-tool/resources/_includes/header.html
deleted file mode 100644
index 219cdf7f9a5c..000000000000
--- a/doc-tool/resources/_includes/header.html
+++ /dev/null
@@ -1 +0,0 @@
-

Some header

diff --git a/doc-tool/resources/_includes/sidebar.html b/doc-tool/resources/_includes/sidebar.html deleted file mode 100644 index 947b4b0acf27..000000000000 --- a/doc-tool/resources/_includes/sidebar.html +++ /dev/null @@ -1,44 +0,0 @@ - diff --git a/doc-tool/resources/_includes/toolbar.html b/doc-tool/resources/_includes/toolbar.html deleted file mode 100644 index 521db3980d6e..000000000000 --- a/doc-tool/resources/_includes/toolbar.html +++ /dev/null @@ -1,39 +0,0 @@ -
- -
diff --git a/doc-tool/resources/_layouts/api-page.html b/doc-tool/resources/_layouts/api-page.html deleted file mode 100644 index 21fce2c381fe..000000000000 --- a/doc-tool/resources/_layouts/api-page.html +++ /dev/null @@ -1,230 +0,0 @@ ---- -layout: main ---- - -
-
- {{ entity.kind | first | capitalize }} - - - {{ entity.modifiers | join: " " }} - - {{ entity.kind }} - -

- {{ entity.name }} - {% if entity.typeParams and entity.typeParams.size > 0 %} - - [{{ entity.typeParams | join: ", " }}] - - {% endif %} -

- - {% if entity.superTypes.size > 0 %} - extends - {% if entity.superTypes.size == 1 %} - {% renderLink entity.superTypes[0] %} - {% else %} - {% renderLink entity.superTypes[0] %} - with {% renderLink entity.superTypes[1] %} - {% if entity.superTypes.size == 3 %} - with {% renderLink entity.superTypes[2] %} - {% elsif entity.superTypes.size > 3 %} - {% assign remaining = entity.superTypes.size | minus: 2 %} - and {{remaining}} more traits - {% endif %} - {% endif %} - {% endif %} - -
- - {% if entity.comment.body %} -
- {{ entity.comment.body }} -
- {% endif %} - - {% if entity.superTypes.size > 0 %} -
-

Supertypes

- - {% for superT in entity.superTypes %} - {% renderLink superT %}{% unless forloop.last %}, {% endunless %} - {% endfor %} - -
- {% endif %} - - {% if entity.annotations.size > 0 %} -
-

Annotations

- - {% for annot in entity.annotations %} - @{{ annot }}{% unless forloop.last %}, {% endunless %} - {% endfor %} - -
- {% endif %} - - {% if entity.kind == "class" or entity.kind == "case class" %} -
-

Constructors

- {% if entity.constructors and entity.constructors.size > 0 %} -
- {% for ctorParamLists in entity.constructors %} - - - -

{{ entity.name }}

- {% for plist in ctorParamLists %} - - ( - {% if plist.isImplicit %} - implicit  - {% endif %} - {% for param in plist.list %} - - {{ param.title }}: - {% if param.isByName %}=>{% endif %} - {% renderRef param.ref %} - - {% unless forloop.last %}, {% endunless %} - {% endfor %} - ) - - {% endfor %} -
-
- {% endfor %} -
- {% else %} - This {{ entity.kind }} cannot be constructed. - {% endif %} -
- {% endif %} - -
-

Members

-
- {% for member in entity.members %} - {% if member.isPrivate or member.isProtected %} - {% assign visibilityClass = "non-public" %} - {% else %} - {% assign visibilityClass = "public" %} - {% endif %} - - {% if member.isImplicitlyAddedFrom != null %} - {% assign implicitClass = "implicitly" %} - {% else %} - {% assign implicitClass = "" %} - {% endif %} - - {% assign kindClass = member.kind | replace: " ", "-" %} - {% assign sig = member.signature %} -
- - - - {{ member.modifiers | join: " " }} - - {{ member.kind }}  - - - - -

- {% if member.kind == "class" or member.kind == "case class" or member.kind == "object" or member.kind == "trait" %} - {{ member.name }} - {% elsif member.kind == "package" %} - {{ member.name }} - {% else %} - {{ member.name }} - {% endif %} -

- - {% if member.typeParams and member.typeParams.size > 0 %} - - [{{ member.typeParams | join: ", " }}] - - {% endif %} - - {% if member.paramLists and member.paramLists.size > 0 %} - {% for plist in member.paramLists %} - - ( - {% if plist.isImplicit %} - implicit  - {% endif %} {% for param in plist.list %} - - {{ param.title }}: - {% if param.isByName %}=>{% endif %} - {% renderRef param.ref %} - - {% unless forloop.last %}, {% endunless %} - {% endfor %} - ) - - {% endfor %} - {% endif %} - - {% if member.returnValue %} - : {% renderRef member.returnValue %} - {% endif %} - - {% if member.alias %} -  = {% renderRef member.alias %} - {% endif %} -
- -
- {% if member.comment.short %} - {{ member.comment.short }} - {% else %} -

- {% endif %} -
- -
- - {% assign c = member.comment %} - {% if c %} - {{ c.body }} - {% else %} -

- {% endif %} - -
-
- {% endfor %} -
-
-
diff --git a/doc-tool/resources/_layouts/base.html b/doc-tool/resources/_layouts/base.html deleted file mode 100644 index 69eb185fef16..000000000000 --- a/doc-tool/resources/_layouts/base.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - {{ page.title }} - - - - - - - - - - - - - {% for css in page.extraCSS %} - - {% endfor %} - - - - - {{ content }} - - - - {% for js in page.extraJS %} - - {% endfor %} - - - diff --git a/doc-tool/resources/_layouts/doc-page.html b/doc-tool/resources/_layouts/doc-page.html deleted file mode 100644 index 694da12f1f20..000000000000 --- a/doc-tool/resources/_layouts/doc-page.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -layout: main ---- -
-
-

{{ page.title }}

- -
- {{ content }} -
diff --git a/doc-tool/resources/_layouts/main.html b/doc-tool/resources/_layouts/main.html deleted file mode 100644 index 69b79f5eae57..000000000000 --- a/doc-tool/resources/_layouts/main.html +++ /dev/null @@ -1,20 +0,0 @@ ---- -layout: base -extraCSS: - - css/toolbar.css - - css/sidebar.css -extraJS: - - js/toolbar.js - - js/sidebar.js ---- -{% include "toolbar" %} -{% include "sidebar" %} -
- {{ content }} -
- - diff --git a/doc-tool/resources/css/color-brewer.css b/doc-tool/resources/css/color-brewer.css deleted file mode 100644 index 9c3972d0219d..000000000000 --- a/doc-tool/resources/css/color-brewer.css +++ /dev/null @@ -1,66 +0,0 @@ -/* - -Colorbrewer theme -Original: https://github.com/mbostock/colorbrewer-theme (c) Mike Bostock -Ported by Fabrício Tavares de Oliveira - -*/ - -.hljs { - background: transparent; -} - -.hljs, -.hljs-subst { - color: #000; -} - -.hljs-string, -.hljs-meta, -.hljs-symbol, -.hljs-template-tag, -.hljs-template-variable, -.hljs-addition { - color: #756bb1; -} - -.hljs-comment, -.hljs-quote { - color: #636363; -} - -.hljs-number, -.hljs-regexp, -.hljs-literal, -.hljs-bullet, -.hljs-link { - color: #31a354; -} - -.hljs-deletion, -.hljs-variable { - color: #88f; -} - -.hljs-keyword, -.hljs-selector-tag, -.hljs-title, -.hljs-section, -.hljs-built_in, -.hljs-doctag, -.hljs-type, -.hljs-tag, -.hljs-name, -.hljs-selector-id, -.hljs-selector-class, -.hljs-strong { - color: #3182bd; -} - -.hljs-emphasis { - font-style: italic; -} - -.hljs-attribute { - color: #e6550d; -} diff --git a/doc-tool/resources/css/dottydoc.css b/doc-tool/resources/css/dottydoc.css deleted file mode 100644 index 0eabdd3acc4a..000000000000 --- a/doc-tool/resources/css/dottydoc.css +++ /dev/null @@ -1,268 +0,0 @@ -html, body { - font-weight: 300; - height: 100%; -} - -main.container { - min-height: 100vh; - padding: 15px 15px; - padding-bottom: 45px; /* prevents the content to be hidden by the gitter sidecar */ -} - -.container img { - width: 100%; - height: auto; -} - -/* headers */ -main header { - border-bottom: 1px solid rgba(0,0,0,.1); - margin-bottom: 16px; - padding-bottom: 16px; -} - -main > h1 { - margin-bottom: 20px; -} - -.byline, .byline a { - color: grey; -} -.byline .author { - display: block; -} - -/* indexes */ -ul.post-list { - list-style: none; - padding-left: 0; -} -.post-list h2 { - margin-bottom: 0; -} - -/* headings anchors */ -a.anchor { - color: white; - margin-left: -23px; - padding-right: 3px; - transition: color .4s ease-out; -} - -a.anchor::before { - content: "\f0c1"; - font-family: "Font Awesome 5 Free"; - font-weight: 900; - font-size: 20px; -} - -h1:hover a.anchor, -h2:hover a.anchor, -h3:hover a.anchor, -h4:hover a.anchor, -h5:hover a.anchor { - color: lightgrey; - text-decoration: none; -} - -h1:hover a.anchor:hover, -h2:hover a.anchor:hover, -h3:hover a.anchor:hover, -h4:hover a.anchor:hover, -h5:hover a.anchor:hover { - color: var(--secondary); -} - - -/* footer */ -footer { - color: grey; -} -footer img#author-img { - width: auto; - height: auto; - max-width:100px; - max-height:100px; - border-radius: 50%; -} - -/* api docs */ -.api span.letter-anchor { - float: left; - width: 50px; - height: 50px; - border-radius: 50px; - color: white; - margin-top: 6px; - margin-right: 8px; - line-height: 50px; - text-align: center; - text-decoration: none; - font-size: 43px; - font-family: var(--font-family-sans-serif); -} -.api span.letter-anchor.object { - line-height: 48px; -} -.api span.letter-anchor.class { - line-height: 48px; - padding-right: 3px; -} -.letter-anchor.object { - background: #2c6c8d; -} -.letter-anchor.class { - background: #44ad7d; -} -.letter-anchor.trait { - background: #19aacf; -} -.letter-anchor.enum { - background: #7803fc; -} -.letter-anchor.package { - background: #2c6c8d; -} - -.api header { - font-family: var(--font-family-sans-serif); -} -.api header .name-prefix { - display: block; -} -.api header .name-suffix { - display: inline-block; -} - -.api header h1 { - margin: -13px 8px 0 0; - display: inline-block; -} -.api h2 { - margin-top: 1rem; -} -.api h3 { - display: inline; - margin: 0; - font: inherit; - font-weight: bold; -} - -/* improved display and wrapping of parameters */ -.api .params, .api .type-params { - display: inline-flex; - flex-flow: wrap; -} - -/* api layout */ -.wide-table { - display: table; - width: 100%; -} -.api .member:hover { - background: var(--doc-bg); - cursor: pointer; -} -.api .left-column { - white-space: nowrap; - padding-left: 1em; - border-left: 3px solid transparent;/* table rows cannot have borders*/ - font-family: var(--font-family-monospace); - text-align: right; - width: 1px; -} -.api .member:hover .left-column { - border-left: 3px solid var(--secondary); -} -.api .right-column { - display: inline; - text-align: right; - font-family: var(--font-family-monospace); -} - -/* code */ -pre, code { - font-variant-ligatures: none; -} -pre { - padding: 0; - font-size: 13px; - background: var(--pre-bg); - border-radius: 2px; - border: 1px solid rgba(0, 0, 0, 0.1); -} - -pre > code { - display: block; - padding: 0.5rem; - overflow-x: auto; - background: transparent; -} - -/* admonitions */ -blockquote { - padding: 0 1em; - color: #777; - border-left: 0.25em solid #ddd; -} - -aside { - padding: 15px; - margin: 10px 0; -} - -aside.warning { - border-left: 3px solid #d62c2c; - background-color: #ffe4e4; -} - -aside.notice { - border-left: 3px solid #4c97e4; - background-color: #e4ebff; -} - -aside.success { - border-left: 3px solid #36bf1d; - background-color: #ebfddd; -} - -/* gitter chat */ -.gitter-open-chat-button { - background-color: grey; -} -.gitter-open-chat-button:focus, .gitter-open-chat-button:hover { - background-color: var(--primary); -} -.gitter-open-chat-button:focus { - box-shadow: 0 0 8px var(--primary); -} -.gitter-chat-embed { - top: 40px; /* 50px (navbar) - 10px (aside's margin) */ - bottom: -10px; -} - -/* media queries for bigger screens (dottydoc is mobile-first) */ -@media (min-width: 576px) { - .byline .author { - display: inline; - margin-left: 1em; - } - main.container { - padding: 15px 30px; - } -} -@media (min-width: 768px) { - .api .member { - display: table-row; - } - .api .left-column { - display: table-cell; - } - .api .right-column { - display: flex; - flex-flow: wrap; - } - main.container { - padding: 15px 45px; - } -} diff --git a/doc-tool/resources/images/scala-logo-white.svg b/doc-tool/resources/images/scala-logo-white.svg deleted file mode 100644 index be4e80b10768..000000000000 --- a/doc-tool/resources/images/scala-logo-white.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/doc-tool/resources/images/scala-logo.svg b/doc-tool/resources/images/scala-logo.svg deleted file mode 100644 index 6eb7cb4523f6..000000000000 --- a/doc-tool/resources/images/scala-logo.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/doc-tool/resources/images/scala3-logo-white.svg b/doc-tool/resources/images/scala3-logo-white.svg deleted file mode 100644 index 8fd33e25e3aa..000000000000 --- a/doc-tool/resources/images/scala3-logo-white.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc-tool/resources/images/scala3-logo.svg b/doc-tool/resources/images/scala3-logo.svg deleted file mode 100644 index 0bb0651aeffb..000000000000 --- a/doc-tool/resources/images/scala3-logo.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc-tool/resources/index.md b/doc-tool/resources/index.md deleted file mode 100644 index 82f1d9cfc8c6..000000000000 --- a/doc-tool/resources/index.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -layout: main ---- - -Hello, world! diff --git a/doc-tool/resources/js/bootstrap.min.js b/doc-tool/resources/js/bootstrap.min.js deleted file mode 100644 index c4c0d1f95cd3..000000000000 --- a/doc-tool/resources/js/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v4.3.1 (https://getbootstrap.com/) - * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;nthis._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=ndocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:''}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t 0) { - window.scrollTo(0, $(window.location.hash).offset().top - 90); - } -}) diff --git a/doc-tool/resources/js/highlight.pack.js b/doc-tool/resources/js/highlight.pack.js deleted file mode 100644 index 134c2336e173..000000000000 --- a/doc-tool/resources/js/highlight.pack.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! highlight.js v9.15.9 | BSD3 License | git.io/hljslicense */ -!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"==typeof exports||exports.nodeType?n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs})):e(exports)}(function(a){var f=[],u=Object.keys,N={},c={},n=/^(no-?highlight|plain|text)$/i,s=/\blang(?:uage)?-([\w-]+)\b/i,t=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,r={case_insensitive:"cI",lexemes:"l",contains:"c",keywords:"k",subLanguage:"sL",className:"cN",begin:"b",beginKeywords:"bK",end:"e",endsWithParent:"eW",illegal:"i",excludeBegin:"eB",excludeEnd:"eE",returnBegin:"rB",returnEnd:"rE",relevance:"r",variants:"v",IDENT_RE:"IR",UNDERSCORE_IDENT_RE:"UIR",NUMBER_RE:"NR",C_NUMBER_RE:"CNR",BINARY_NUMBER_RE:"BNR",RE_STARTERS_RE:"RSR",BACKSLASH_ESCAPE:"BE",APOS_STRING_MODE:"ASM",QUOTE_STRING_MODE:"QSM",PHRASAL_WORDS_MODE:"PWM",C_LINE_COMMENT_MODE:"CLCM",C_BLOCK_COMMENT_MODE:"CBCM",HASH_COMMENT_MODE:"HCM",NUMBER_MODE:"NM",C_NUMBER_MODE:"CNM",BINARY_NUMBER_MODE:"BNM",CSS_NUMBER_MODE:"CSSNM",REGEXP_MODE:"RM",TITLE_MODE:"TM",UNDERSCORE_TITLE_MODE:"UTM",COMMENT:"C",beginRe:"bR",endRe:"eR",illegalRe:"iR",lexemesRe:"lR",terminators:"t",terminator_end:"tE"},b="",h={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function _(e){return e.replace(/&/g,"&").replace(//g,">")}function E(e){return e.nodeName.toLowerCase()}function v(e,n){var t=e&&e.exec(n);return t&&0===t.index}function l(e){return n.test(e)}function g(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function R(e){var a=[];return function e(n,t){for(var r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?t+=r.nodeValue.length:1===r.nodeType&&(a.push({event:"start",offset:t,node:r}),t=e(r,t),E(r).match(/br|hr|img|input/)||a.push({event:"stop",offset:t,node:r}));return t}(e,0),a}function i(e){if(r&&!e.langApiRestored){for(var n in e.langApiRestored=!0,r)e[n]&&(e[r[n]]=e[n]);(e.c||[]).concat(e.v||[]).forEach(i)}}function m(o){function s(e){return e&&e.source||e}function c(e,n){return new RegExp(s(e),"m"+(o.cI?"i":"")+(n?"g":""))}!function n(t,e){if(!t.compiled){if(t.compiled=!0,t.k=t.k||t.bK,t.k){function r(t,e){o.cI&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var n=e.split("|");a[n[0]]=[t,n[1]?Number(n[1]):1]})}var a={};"string"==typeof t.k?r("keyword",t.k):u(t.k).forEach(function(e){r(e,t.k[e])}),t.k=a}t.lR=c(t.l||/\w+/,!0),e&&(t.bK&&(t.b="\\b("+t.bK.split(" ").join("|")+")\\b"),t.b||(t.b=/\B|\b/),t.bR=c(t.b),t.endSameAsBegin&&(t.e=t.b),t.e||t.eW||(t.e=/\B|\b/),t.e&&(t.eR=c(t.e)),t.tE=s(t.e)||"",t.eW&&e.tE&&(t.tE+=(t.e?"|":"")+e.tE)),t.i&&(t.iR=c(t.i)),null==t.r&&(t.r=1),t.c||(t.c=[]),t.c=Array.prototype.concat.apply([],t.c.map(function(e){return function(n){return n.v&&!n.cached_variants&&(n.cached_variants=n.v.map(function(e){return g(n,{v:null},e)})),n.cached_variants||n.eW&&[g(n)]||[n]}("self"===e?t:e)})),t.c.forEach(function(e){n(e,t)}),t.starts&&n(t.starts,e);var i=t.c.map(function(e){return e.bK?"\\.?(?:"+e.b+")\\.?":e.b}).concat([t.tE,t.i]).map(s).filter(Boolean);t.t=i.length?c(function(e,n){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i')+n+(t?"":b):n}function o(){E+=null!=l.sL?function(){var e="string"==typeof l.sL;if(e&&!N[l.sL])return _(g);var n=e?C(l.sL,g,!0,f[l.sL]):O(g,l.sL.length?l.sL:void 0);return 0")+'"');return g+=n,n.length||1}var s=B(e);if(!s)throw new Error('Unknown language: "'+e+'"');m(s);var a,l=t||s,f={},E="";for(a=l;a!==s;a=a.parent)a.cN&&(E=c(a.cN,"",!0)+E);var g="",R=0;try{for(var d,p,M=0;l.t.lastIndex=M,d=l.t.exec(n);)p=r(n.substring(M,d.index),d[0]),M=d.index+p;for(r(n.substr(M)),a=l;a.parent;a=a.parent)a.cN&&(E+=b);return{r:R,value:E,language:e,top:l}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{r:0,value:_(n)};throw e}}function O(t,e){e=e||h.languages||u(N);var r={r:0,value:_(t)},a=r;return e.filter(B).filter(M).forEach(function(e){var n=C(e,t,!1);n.language=e,n.r>a.r&&(a=n),n.r>r.r&&(a=r,r=n)}),a.language&&(r.second_best=a),r}function d(e){return h.tabReplace||h.useBR?e.replace(t,function(e,n){return h.useBR&&"\n"===e?"
":h.tabReplace?n.replace(/\t/g,h.tabReplace):""}):e}function o(e){var n,t,r,a,i,o=function(e){var n,t,r,a,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=s.exec(i))return B(t[1])?t[1]:"no-highlight";for(n=0,r=(i=i.split(/\s+/)).length;n/g,"\n"):n=e,i=n.textContent,r=o?C(o,i,!0):O(i),(t=R(n)).length&&((a=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=r.value,r.value=function(e,n,t){var r=0,a="",i=[];function o(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function u(e){a+=""}function s(e){("start"===e.event?c:u)(e.node)}for(;e.length||n.length;){var l=o();if(a+=_(t.substring(r,l[0].offset)),r=l[0].offset,l===e){for(i.reverse().forEach(u);s(l.splice(0,1)[0]),(l=o())===e&&l.length&&l[0].offset===r;);i.reverse().forEach(c)}else"start"===l[0].event?i.push(l[0].node):i.pop(),s(l.splice(0,1)[0])}return a+_(t.substr(r))}(t,R(a),i)),r.value=d(r.value),e.innerHTML=r.value,e.className=function(e,n,t){var r=n?c[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}(e.className,o,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function p(){if(!p.called){p.called=!0;var e=document.querySelectorAll("pre code");f.forEach.call(e,o)}}function B(e){return e=(e||"").toLowerCase(),N[e]||N[c[e]]}function M(e){var n=B(e);return n&&!n.disableAutodetect}return a.highlight=C,a.highlightAuto=O,a.fixMarkup=d,a.highlightBlock=o,a.configure=function(e){h=g(h,e)},a.initHighlighting=p,a.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",p,!1),addEventListener("load",p,!1)},a.registerLanguage=function(n,e){var t=N[n]=e(a);i(t),t.aliases&&t.aliases.forEach(function(e){c[e]=n})},a.listLanguages=function(){return u(N)},a.getLanguage=B,a.autoDetection=M,a.inherit=g,a.IR=a.IDENT_RE="[a-zA-Z]\\w*",a.UIR=a.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",a.NR=a.NUMBER_RE="\\b\\d+(\\.\\d+)?",a.CNR=a.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",a.BNR=a.BINARY_NUMBER_RE="\\b(0b[01]+)",a.RSR=a.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",a.BE=a.BACKSLASH_ESCAPE={b:"\\\\[\\s\\S]",r:0},a.ASM=a.APOS_STRING_MODE={cN:"string",b:"'",e:"'",i:"\\n",c:[a.BE]},a.QSM=a.QUOTE_STRING_MODE={cN:"string",b:'"',e:'"',i:"\\n",c:[a.BE]},a.PWM=a.PHRASAL_WORDS_MODE={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},a.C=a.COMMENT=function(e,n,t){var r=a.inherit({cN:"comment",b:e,e:n,c:[]},t||{});return r.c.push(a.PWM),r.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),r},a.CLCM=a.C_LINE_COMMENT_MODE=a.C("//","$"),a.CBCM=a.C_BLOCK_COMMENT_MODE=a.C("/\\*","\\*/"),a.HCM=a.HASH_COMMENT_MODE=a.C("#","$"),a.NM=a.NUMBER_MODE={cN:"number",b:a.NR,r:0},a.CNM=a.C_NUMBER_MODE={cN:"number",b:a.CNR,r:0},a.BNM=a.BINARY_NUMBER_MODE={cN:"number",b:a.BNR,r:0},a.CSSNM=a.CSS_NUMBER_MODE={cN:"number",b:a.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},a.RM=a.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[a.BE,{b:/\[/,e:/\]/,r:0,c:[a.BE]}]},a.TM=a.TITLE_MODE={cN:"title",b:a.IR,r:0},a.UTM=a.UNDERSCORE_TITLE_MODE={cN:"title",b:a.UIR,r:0},a.METHOD_GUARD={b:"\\.\\s*"+a.UIR,r:0},a});hljs.registerLanguage("json",function(e){var i={literal:"true false null"},n=[e.QSM,e.CNM],r={e:",",eW:!0,eE:!0,c:n,k:i},t={b:"{",e:"}",c:[{cN:"attr",b:/"/,e:/"/,c:[e.BE],i:"\\n"},e.inherit(r,{b:/:/})],i:"\\S"},c={b:"\\[",e:"\\]",c:[e.inherit(r)],i:"\\S"};return n.splice(n.length,0,t,c),{c:n,k:i,i:"\\S"}});hljs.registerLanguage("ocaml",function(e){return{aliases:["ml"],k:{keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref",literal:"true false"},i:/\/\/|>>/,l:"[a-z_]\\w*!?",c:[{cN:"literal",b:"\\[(\\|\\|)?\\]|\\(\\)",r:0},e.C("\\(\\*","\\*\\)",{c:["self"]}),{cN:"symbol",b:"'[A-Za-z_](?!')[\\w']*"},{cN:"type",b:"`[A-Z][\\w']*"},{cN:"type",b:"\\b[A-Z][\\w']*",r:0},{b:"[a-z_]\\w*'[\\w']*",r:0},e.inherit(e.ASM,{cN:"string",r:0}),e.inherit(e.QSM,{i:null}),{cN:"number",b:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",r:0},{b:/[-=]>/}]}});hljs.registerLanguage("java",function(e){var a="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",t={cN:"number",b:"\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",r:0};return{aliases:["jsp"],k:a,i:/<\/|#/,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{b:/\w+@/,r:0},{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return else",r:0},{cN:"function",b:"([À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*(<[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*(\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*)*>)?\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:a,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:a,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},t,{cN:"meta",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("ini",function(e){var b={cN:"string",c:[e.BE],v:[{b:"'''",e:"'''",r:10},{b:'"""',e:'"""',r:10},{b:'"',e:'"'},{b:"'",e:"'"}]};return{aliases:["toml"],cI:!0,i:/\S/,c:[e.C(";","$"),e.HCM,{cN:"section",b:/^\s*\[+/,e:/\]+/},{b:/^[a-z0-9\[\]_\.-]+\s*=\s*/,e:"$",rB:!0,c:[{cN:"attr",b:/[a-z0-9\[\]_\.-]+/},{b:/=/,eW:!0,r:0,c:[e.C(";","$"),e.HCM,{cN:"literal",b:/\bon|off|true|false|yes|no\b/},{cN:"variable",v:[{b:/\$[\w\d"][\w\d_]*/},{b:/\$\{(.*?)}/}]},b,{cN:"number",b:/([\+\-]+)?[\d]+_[\d_]+/},e.NM]}]}]}});hljs.registerLanguage("xml",function(s){var e={eW:!0,i:/`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],cI:!0,c:[{cN:"meta",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},s.C("\x3c!--","--\x3e",{r:10}),{b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"meta",b:/<\?xml/,e:/\?>/,r:10},{b:/<\?(php)?/,e:/\?>/,sL:"php",c:[{b:"/\\*",e:"\\*/",skip:!0},{b:'b"',e:'"',skip:!0},{b:"b'",e:"'",skip:!0},s.inherit(s.ASM,{i:null,cN:null,c:null,skip:!0}),s.inherit(s.QSM,{i:null,cN:null,c:null,skip:!0})]},{cN:"tag",b:"|$)",e:">",k:{name:"style"},c:[e],starts:{e:"",rE:!0,sL:["css","xml"]}},{cN:"tag",b:"|$)",e:">",k:{name:"script"},c:[e],starts:{e:"<\/script>",rE:!0,sL:["actionscript","javascript","handlebars","xml"]}},{cN:"tag",b:"",c:[{cN:"name",b:/[^\/><\s]+/,r:0},e]}]}});hljs.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],c:[{cN:"section",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^\\s*([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"quote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"^```w*s*$",e:"^```s*$"},{b:"`.+?`"},{b:"^( {4}|\t)",e:"$",r:0}]},{b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"string",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"symbol",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:/^\[[^\n]+\]:/,rB:!0,c:[{cN:"symbol",b:/\[/,e:/\]/,eB:!0,eE:!0},{cN:"link",b:/:\s*/,e:/$/,eB:!0}]}]}});hljs.registerLanguage("properties",function(r){var t="[ \\t\\f]*",e="("+t+"[:=]"+t+"|[ \\t\\f]+)",s="([^\\\\\\W:= \\t\\f\\n]|\\\\.)+",n="([^\\\\:= \\t\\f\\n]|\\\\.)+",a={e:e,r:0,starts:{cN:"string",e:/$/,r:0,c:[{b:"\\\\\\n"}]}};return{cI:!0,i:/\S/,c:[r.C("^\\s*[!#]","$"),{b:s+e,rB:!0,c:[{cN:"attr",b:s,endsParent:!0,r:0}],starts:a},{b:n+e,rB:!0,r:0,c:[{cN:"meta",b:n,endsParent:!0,r:0}],starts:a},{cN:"attr",r:0,b:n+t+"$"}]}});hljs.registerLanguage("ruby",function(e){var b="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},c={cN:"doctag",b:"@[A-Za-z]+"},a={b:"#<",e:">"},s=[e.C("#","$",{c:[c]}),e.C("^\\=begin","^\\=end",{c:[c],r:10}),e.C("^__END__","\\n$")],n={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{b:/<<(-?)\w+$/,e:/^\s*\w+$/}]},i={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:r},d=[t,a,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<\\s*",c:[{b:"("+e.IR+"::)?"+e.IR}]}].concat(s)},{cN:"function",bK:"def",e:"$|;",c:[e.inherit(e.TM,{b:b}),i].concat(s)},{b:e.IR+"::"},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":(?!\\s)",c:[t,{b:b}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{cN:"params",b:/\|/,e:/\|/,k:r},{b:"("+e.RSR+"|unless)\\s*",k:"unless",c:[a,{cN:"regexp",c:[e.BE,n],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(s),r:0}].concat(s);n.c=d;var l=[{b:/^\s*=>/,starts:{e:"$",c:i.c=d}},{cN:"meta",b:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>)",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,i:/\/\*/,c:s.concat(l).concat(d)}});hljs.registerLanguage("yaml",function(e){var b="true false yes no null",a="^[ \\-]*",r="[a-zA-Z_][\\w\\-]*",t={cN:"attr",v:[{b:a+r+":"},{b:a+'"'+r+'":'},{b:a+"'"+r+"':"}]},c={cN:"string",r:0,v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/\S+/}],c:[e.BE,{cN:"template-variable",v:[{b:"{{",e:"}}"},{b:"%{",e:"}"}]}]};return{cI:!0,aliases:["yml","YAML","yaml"],c:[t,{cN:"meta",b:"^---s*$",r:10},{cN:"string",b:"[\\|>] *$",rE:!0,c:c.c,e:t.v[0].b},{b:"<%[%=-]?",e:"[%-]?%>",sL:"ruby",eB:!0,eE:!0,r:0},{cN:"type",b:"!"+e.UIR},{cN:"type",b:"!!"+e.UIR},{cN:"meta",b:"&"+e.UIR+"$"},{cN:"meta",b:"\\*"+e.UIR+"$"},{cN:"bullet",b:"^ *-",r:0},e.HCM,{bK:b,k:{literal:b}},e.CNM,c]}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]};return{aliases:["sh","zsh"],l:/\b-?[a-z\._]+\b/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"meta",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,s,{cN:"",b:/\\"/},{cN:"string",b:/'/,e:/'/},t]}});hljs.registerLanguage("scala",function(e){var t={cN:"subst",v:[{b:"\\$[A-Za-z0-9_]+"},{b:"\\${",e:"}"}]},a={cN:"string",v:[{b:'"',e:'"',i:"\\n",c:[e.BE]},{b:'"""',e:'"""',r:10},{b:'[a-z]+"',e:'"',i:"\\n",c:[e.BE,t]},{cN:"string",b:'[a-z]+"""',e:'"""',c:[t],r:10}]},r={cN:"type",b:"\\b[A-Z][A-Za-z0-9_]*",r:0},c={cN:"title",b:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,r:0},i={cN:"class",bK:"class object trait type",e:/[:={\[\n;]/,eE:!0,c:[{bK:"extends with",r:10},{b:/\[/,e:/\]/,eB:!0,eE:!0,r:0,c:[r]},{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,r:0,c:[r]},c]},s={cN:"function",bK:"def",e:/[:={\[(\n;]/,eE:!0,c:[c]};return{k:{literal:"true false null",keyword:"type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit"},c:[e.CLCM,e.CBCM,a,{cN:"symbol",b:"'\\w[\\w\\d_]*(?!')"},r,s,i,e.CNM,{cN:"meta",b:"@[A-Za-z]+"}]}}); \ No newline at end of file diff --git a/doc-tool/src/dotty/tools/dottydoc/DocCompiler.scala b/doc-tool/src/dotty/tools/dottydoc/DocCompiler.scala deleted file mode 100644 index f85b38ccc89c..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/DocCompiler.scala +++ /dev/null @@ -1,77 +0,0 @@ -package dotty.tools -package dottydoc - -import core._ -import core.transform._ -import dotc.core.Contexts.{Context, ctx} -import dotc.core.Phases.Phase -import dotc.core.Mode -import dotc.{Compiler, CompilationUnit, Run} -import dotc.typer.FrontEnd - -import dotty.tools.dotc.fromtasty.{ReadTasty, TASTYRun} -import dotty.tools.dotc.transform.CookComments - -/** Custom Compiler with phases for the documentation tool - * - * The idea here is to structure `dottydoc` around the new infrastructure. As - * such, dottydoc will itself be a compiler. It will, however, produce a format - * that can be used by other tools or web-browsers. - * - * Example: - * 1. Use the existing FrontEnd to typecheck the code being fed to dottydoc, - * wihtout discarding AnyVal interfaces - * 2. Create an AST that is serializable - * 3. Serialize to JS object - */ -class DocCompiler extends Compiler { - - override def newRun(using Context): Run = { - if (ctx.settings.fromTasty.value) { - reset() - new TASTYRun(this, ctx.addMode(Mode.ReadPositions).addMode(Mode.ReadComments)) - } - else - super.newRun - } - - /** `DocFrontEnd` uses the Dotty `FrontEnd` without discarding the AnyVal - * interfaces for Boolean, Int, Char, Long, Byte etc. - * - * If `-from-tasty` is set, then the trees and documentation will be loaded - * from TASTY. The comments will be cooked after being unpickled. - * - * It currently still throws away Java sources by overriding - * `discardAfterTyper`. - */ - private class DocFrontEnd extends FrontEnd { - override protected def discardAfterTyper(unit: CompilationUnit)(using Context) = - unit.isJava - - override def isRunnable(using Context): Boolean = - super.isRunnable && !ctx.settings.fromTasty.value - } - - override def phases: List[List[Phase]] = List( - List(new DocFrontEnd), - List(new ReadTasty), - List(new CookComments), - List(new DocImplicitsPhase), - List(new DocASTPhase), - List(DocMiniTransformations( - new UsecasePhase, - new DocstringPhase)), - List(DocMiniTransformations( - new PackageObjectsPhase, - new LinkReturnTypes, - new LinkParamListTypes, - new LinkImplicitlyAddedTypes, - new LinkSuperTypes, - new LinkCompanions, - new AlternateConstructors, - new SortMembers)), - List(DocMiniTransformations( - new RemoveEmptyPackages)), - List(new StatisticsPhase) - ) -} diff --git a/doc-tool/src/dotty/tools/dottydoc/DocDriver.scala b/doc-tool/src/dotty/tools/dottydoc/DocDriver.scala deleted file mode 100644 index 3f095826b707..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/DocDriver.scala +++ /dev/null @@ -1,81 +0,0 @@ -package dotty.tools -package dottydoc - -import java.io.File - -import dotty.tools.dottydoc.util.syntax._ -import core.ContextDottydoc -import dotc.core.Contexts._ -import dotc.reporting.Reporter -import dotc.{ Compiler, Driver } -import dotc.config._ -import dotc.core.Comments.ContextDoc -import dotc.report -import staticsite.Site -import io.AbstractFile - -/** `DocDriver` implements the main entry point to the Dotty documentation - * tool. It's methods are used by the external scala and java APIs. - */ -class DocDriver extends Driver { - import java.util.{ Map => JMap } - import model.JavaConverters._ - - override def setup(args: Array[String], rootCtx: Context): (List[AbstractFile], Context) = { - val ctx = rootCtx.fresh - val summary = CompilerCommand.distill(args)(using ctx) - - ctx.setSettings(summary.sstate) - ctx.setSetting(ctx.settings.YcookComments, true) - ctx.setProperty(ContextDoc, new ContextDottydoc) - - inContext(ctx) { - val fileNames = CompilerCommand.checkUsage(summary, sourcesRequired) - val files = fileNames.map(ctx.getFile) - (files, fromTastySetup(files)) - } - } - - override def newCompiler(using Context): Compiler = new DocCompiler - - override def process(args: Array[String], rootCtx: Context): Reporter = { - val (filesToDocument, ictx) = setup(args, initCtx.fresh) - - implicit val ctx: Context = ictx - val reporter = doCompile(newCompiler, filesToDocument) - - val siteRoot = File(ctx.settings.siteRoot.value) - val projectName = ctx.settings.projectName.value - val projectVersion = ctx.settings.projectVersion.value - val projectUrl = Option(ctx.settings.projectUrl.value).filter(_.nonEmpty) - val projectLogo = Option(ctx.settings.projectLogo.value).filter(_.nonEmpty) - val docSnapshot = ctx.settings.docSnapshot.value - - val baseUrl = "" - val outDir = File(siteRoot, "_site") - val snapshotFolderName = if projectVersion.endsWith("NIGHTLY") then "nightly" else projectVersion - val snapshotOutDir = File(outDir, snapshotFolderName) - val snapshotBaseUrl = s"$baseUrl/$snapshotFolderName" - - if (projectName.isEmpty) - report.error(s"Site project name not set. Use `-project ` to set the project name") - else if (!siteRoot.exists) - report.echo(s"Site root (`-siteroot`) does not exist: $siteRoot, no documentation will be generated.") - else if (!siteRoot.isDirectory) - report.error(s"Site root (`-siteroot`) is not a directory: $siteRoot") - else { - def generateSite(outDir: File, baseUrl: String) = - Site(siteRoot, outDir, projectName, projectVersion, projectUrl, projectLogo, ctx.docbase.packages, baseUrl) - .generateApiDocs() - .copyStaticFiles() - .generateHtmlFiles() - .generateBlog() - - generateSite(outDir, baseUrl) - if docSnapshot then generateSite(snapshotOutDir, snapshotBaseUrl) - ctx.docbase.printSummary() - } - - reporter - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/Main.scala b/doc-tool/src/dotty/tools/dottydoc/Main.scala deleted file mode 100644 index f158bdbfce0c..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/Main.scala +++ /dev/null @@ -1,5 +0,0 @@ -package dotty.tools -package dottydoc - -/** Main runnable for DottyDoc */ -object Main extends DocDriver diff --git a/doc-tool/src/dotty/tools/dottydoc/core/AlternateConstructorsPhase.scala b/doc-tool/src/dotty/tools/dottydoc/core/AlternateConstructorsPhase.scala deleted file mode 100644 index 567d2dddbb53..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/AlternateConstructorsPhase.scala +++ /dev/null @@ -1,34 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.core.Contexts.{Context, ctx} - -import transform.DocMiniPhase -import model._ -import model.internal._ - -/** This DocMiniPhase adds the alternate constructors, currently defined as - * methods with the name `<init>`, to the Entity#constructors list - */ -class AlternateConstructors extends DocMiniPhase { - def partitionMembers(ent: Entity with Constructors with Members): (List[List[ParamList]], List[Entity]) = { - val (constructors, members) = ent.members.partition(x => x.name == "<init>") - - val paramLists: List[List[ParamList]] = constructors.collect { - case df: Def => df.paramLists - } - - (ent.constructors ++ paramLists, members) - } - - override def transformClass(using Context) = { case cls: ClassImpl => - val (constructors, members) = partitionMembers(cls) - cls.copy(members = members, constructors = constructors) :: Nil - } - - override def transformCaseClass(using Context) = { case cc: CaseClassImpl => - val (constructors, members) = partitionMembers(cc) - cc.copy(members = members, constructors = constructors) :: Nil - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/core/ContextDottydoc.scala b/doc-tool/src/dotty/tools/dottydoc/core/ContextDottydoc.scala deleted file mode 100644 index 31ae8bdda749..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/ContextDottydoc.scala +++ /dev/null @@ -1,136 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.core.Symbols._ -import dotc.core.Flags._ -import dotc.core.Decorators._ -import dotc.core.Comments.ContextDocstrings -import model.{ Package, Entity } -import model.comment.Comment - -import dotc.core.Contexts.{Context, ctx} -import dotc.printing.Highlighting._ -import dotc.printing.Formatting.hl -import dotc.util.{ SourcePosition, NoSourcePosition } -import dotc.report - -class ContextDottydoc extends ContextDocstrings { - import scala.collection.mutable - - private[this] val _packages: mutable.Map[String, Package] = mutable.Map.empty - def packages: Map[String, Package] = _packages.toMap - def packagesMutable: mutable.Map[String, Package] = _packages - - private[this] var _statistics: Map[String, Statistics] = Map.empty - def registerStatistics(pkgName: String, stat: Statistics): Unit = - _statistics = _statistics + (pkgName -> stat) - - def statistics: Map[String, Statistics] = _statistics - - /** Should perhaps factorize this into caches that get flushed */ - private[this] var _defs: Map[Symbol, Set[Symbol]] = Map.empty - def defs(sym: Symbol): Set[Symbol] = _defs.get(sym).getOrElse(Set.empty) - - def addDef(s: Symbol, d: Symbol): Unit = _defs = (_defs + { - s -> _defs.get(s).map(xs => xs + d).getOrElse(Set(d)) - }) - - def error(msg: String, pos: SourcePosition)(using Context): Unit = report.error({ - NoColor("[") + Red("doc error") + "] " + msg - }.toString, pos) - - def error(msg: String)(using Context): Unit = error(msg, NoSourcePosition) - - def warn(msg: String, pos: SourcePosition)(using Context): Unit = report.warning({ - NoColor("[") + Yellow("doc warn") + "] " + msg - }.toString, pos) - - def warn(msg: String)(using Context): Unit = warn(msg, NoSourcePosition) - - def echo(msg: String, pos: SourcePosition)(using Context): Unit = report.echo({ - "[doc info] " + msg - }.toString, pos) - - def echo(msg: String)(using Context): Unit = echo(msg, NoSourcePosition) - - def debug(msg: String, pos: SourcePosition)(using Context): Unit = - if (ctx.settings.Ydebug.value) report.inform({ - "[doc debug] " + msg - }.toString, pos) - - def debug(msg: String)(using Context): Unit = debug(msg, NoSourcePosition) - - def printSummary()(using Context): Unit = { - def colored(part: Int, total: Int) = - if (total == 0) "0" - else { - val percentage = (part * 100.0 / total).toInt - val str = s"$part/$total ($percentage%)" - - if (percentage > 75) Green(str) - else if (percentage > 50) Yellow(str) - else Red(str) - } - - val totalEntities = statistics.totalEntities - - val projectName = ctx.settings.projectName.value - val warningsText = - if (ctx.reporter.hasWarnings) - s"total warnings with regards to compilation and documentation: ${ctx.reporter.warningCount}" - else "" - - val api = statistics.values.iterator.map(_.api).foldLeft(Counters(0,0,0,0,0,0))(_ merge _) - val internalApi = statistics.values.iterator.map(_.internalApi).foldLeft(Counters(0,0,0,0,0,0))(_ merge _) - - val apiSummary = (for { - (pkgName, stat) <- statistics.toList.sortBy(_._1) - } yield { - val pub = colored(stat.api.publicDocstrings, stat.api.publicEntities) - val pro = colored(stat.api.protectedDocstrings, stat.api.protectedEntities) - s"""|package $pkgName - |${Blue("-" * ctx.settings.pageWidth.value)} - |public: $pub \t protected: $pro - |""".stripMargin - }).mkString("\n") - - val internalSummary = (for { - (pkgName, stat) <- statistics.toList.sortBy(_._1) - } yield { - val pub = colored(stat.internalApi.publicDocstrings, stat.internalApi.publicEntities) - val pro = colored(stat.internalApi.protectedDocstrings, stat.internalApi.protectedEntities) - val pri = colored(stat.internalApi.privateDocstrings, stat.internalApi.privateEntities) - s"""|package $pkgName - |${Blue("-" * ctx.settings.pageWidth.value)} - |public: $pub \t protected: $pro \t private: $pri - |""".stripMargin - }).mkString("\n") - - report.echo { - s"""|${Blue("=" * ctx.settings.pageWidth.value)} - |Dottydoc summary report for project `$projectName` - |${Blue("=" * ctx.settings.pageWidth.value)} - |Documented members in public API: - | - |$apiSummary - | - |Summary: - | - |public members with docstrings: ${colored(api.publicDocstrings, api.publicEntities)} - |${hl("protected")} members with docstrings: ${colored(api.protectedDocstrings, api.protectedEntities)} - |${Blue("=" * ctx.settings.pageWidth.value)} - | - |Documented members in internal API: - | - |$internalSummary - | - |Summary internal API: - | - |public members with docstrings: ${colored(internalApi.publicDocstrings, internalApi.publicEntities)} - |${hl("protected")} members with docstrings: ${colored(internalApi.protectedDocstrings, internalApi.protectedEntities)} - |${hl("private")} members with docstrings: ${colored(internalApi.privateDocstrings, internalApi.privateEntities)} - |$warningsText""".stripMargin - } - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/core/DocASTPhase.scala b/doc-tool/src/dotty/tools/dottydoc/core/DocASTPhase.scala deleted file mode 100644 index d9a1fde9781f..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/DocASTPhase.scala +++ /dev/null @@ -1,256 +0,0 @@ -package dotty.tools -package dottydoc -package core - -/** Dotty and Dottydoc imports */ -import dotc.ast.Trees._ -import dotc.CompilationUnit -import dotc.core.Contexts.{Context, ctx} -import dotc.core.Types.PolyType -import dotc.core.Phases.Phase -import dotc.core.Symbols.{ Symbol, NoSymbol } -import dotc.core.NameOps._ -import dotc.report - -class DocASTPhase extends Phase { - import model._ - import model.factories._ - import model.internal._ - import dotty.tools.dotc.core.Flags - import dotty.tools.dotc.ast.tpd._ - import dotty.tools.dottydoc.util.syntax._ - import util.traversing._ - import util.internal.setters._ - - def phaseName = "docASTPhase" - - /** Build documentation hierarchy from existing tree */ - def collect(tree: Tree)(using Context): List[Entity] = { - val implicitConversions = ctx.docbase.defs(tree.symbol) - - def collectList(xs: List[Tree]): List[Entity] = - xs.flatMap(collect) - - def collectEntityMembers(xs: List[Tree]) = - collectList(xs).asInstanceOf[List[Entity with Members]] - - def collectMembers(tree: Tree)(using Context): List[Entity] = { - val defs = tree match { - case t: Template => collectList(t.body) - case _ => Nil - } - - defs ++ implicitConversions.flatMap(membersFromSymbol) - } - - def membersFromSymbol(sym: Symbol): List[Entity] = { - if (sym.info.exists) { - val defs = sym.info.bounds.hi.finalResultType.membersBasedOnFlags(Flags.Method, Flags.Synthetic | Flags.Private) - .filterNot(_.symbol.owner.name.show == "Any") - .map { meth => - DefImpl( - meth.symbol, - annotations(meth.symbol), - meth.symbol.name.show, - Nil, - path(meth.symbol), - returnType(meth.info), - typeParams(meth.symbol), - paramLists(meth.info), - implicitlyAddedFrom = Some(returnType(meth.symbol.owner.info)) - ) - }.toList - - // don't add privates, synthetics or class parameters (i.e. value class constructor val) - val vals = sym.info.fields.filterNot(_.symbol.isOneOf(Flags.ParamAccessor | Flags.Private | Flags.Synthetic)).map { value => - val kind = if (value.symbol.is(Flags.Mutable)) "var" else "val" - ValImpl( - value.symbol, - annotations(value.symbol), - value.symbol.name.show, - Nil, path(value.symbol), - returnType(value.info), - kind, - implicitlyAddedFrom = Some(returnType(value.symbol.owner.info)) - ) - } - - defs ++ vals - } - else Nil - } - - - if (tree.symbol.is(Flags.Synthetic) && !tree.symbol.is(Flags.Module)) Nil - else tree match { - /** package */ - case pd @ PackageDef(pid, st) => - addPackage(PackageImpl(pd.symbol, annotations(pd.symbol), pd.symbol.showFullName, collectEntityMembers(st), path(pd.symbol))) :: Nil - - /** type alias */ - case t: TypeDef if !t.isClassDef => - val sym = t.symbol - if (sym.isOneOf(Flags.Synthetic | Flags.Param)) - Nil - else { - val tparams = t.rhs.tpe match { - case tp: PolyType => tp.paramNames.map(_.show) - case _ => Nil - } - TypeAliasImpl(sym, annotations(sym), flags(t), t.name.show.split("\\$\\$").last, path(sym), alias(t.rhs.tpe), tparams) :: Nil - } - - /** trait */ - case t @ TypeDef(n, rhs) if t.symbol.is(Flags.Trait) => - //TODO: should not `collectMember` from `rhs` - instead: get from symbol, will get inherited members as well - TraitImpl(t.symbol, annotations(t.symbol), n.show, collectMembers(rhs), flags(t), path(t.symbol), typeParams(t.symbol), traitParameters(t.symbol), superTypes(t)) :: Nil - - /** objects, on the format "Object$" so drop the last letter */ - case o @ TypeDef(n, rhs) if o.symbol.is(Flags.Module) => - //TODO: should not `collectMember` from `rhs` - instead: get from symbol, will get inherited members as well - ObjectImpl(o.symbol, annotations(o.symbol), o.name.stripModuleClassSuffix.show, collectMembers(rhs), flags(o), path(o.symbol), superTypes(o)) :: Nil - - /** class / case class */ - case c @ TypeDef(n, rhs) if c.symbol.isClass => - //TODO: should not `collectMember` from `rhs` - instead: get from symbol, will get inherited members as well - val parameters = (c.symbol, annotations(c.symbol), n.show, collectMembers(rhs), flags(c), path(c.symbol), typeParams(c.symbol), constructors(c.symbol), superTypes(c), None, Nil, None) - val constr = - if (c.symbol.is(Flags.CaseClass)) CaseClassImpl.apply - else ClassImpl.apply - - constr.tupled(parameters) :: Nil - - /** def */ - case d: DefDef => - DefImpl(d.symbol, annotations(d.symbol), d.name.decode.toString, flags(d), path(d.symbol), returnType(d.tpt.tpe), typeParams(d.symbol), paramLists(d.symbol.info)) :: Nil - - /** val */ - case v: ValDef if !v.symbol.is(Flags.ModuleVal) => - val kind = if (v.symbol.is(Flags.Mutable)) "var" else "val" - ValImpl(v.symbol, annotations(v.symbol), v.name.decode.toString, flags(v), path(v.symbol), returnType(v.tpt.tpe), kind) :: Nil - - case x => { - ctx.docbase.debug(s"Found unwanted entity: $x (${x.span},\n${x.show}") - Nil - } - } - } - - var packages: Map[String, PackageImpl] = Map.empty - - def addPackage(newPkg: PackageImpl): Package = { - def mergeMembers(newPkg: PackageImpl, oldPkg: PackageImpl): Unit = { - val othersNew = newPkg.members.filterNot(_.kind == "package") - val (oldPacks, othersOld) = oldPkg.members.partition(_.kind == "package") - - val others = othersNew ::: othersOld - // here we can just choose the old packs, since we're recursively (bottom up) - // discovering the tree, we should have met the child packages first, as - // such - they were already inserted into the tree - val newMembers = (others ++ oldPacks) - - oldPkg.members = newMembers - } - - // This function mutates packages in place as not to create any orphaned references - def mergedPackages(old: PackageImpl, newPkg: PackageImpl): PackageImpl = { - if (old.symbol eq NoSymbol) old.symbol = newPkg.symbol - if (old.annotations.isEmpty) old.annotations = newPkg.annotations - mergeMembers(newPkg, old) - if (old.superTypes.isEmpty) old.superTypes = newPkg.superTypes - if (old.comment.isEmpty) old.comment = newPkg.comment - old - } - - def insertOrModifyRoot(): PackageImpl = { - val modifiedPkg = - packages - .get(newPkg.name) - .map(mergedPackages(_, newPkg)) - .getOrElse(newPkg) - - packages = packages + (modifiedPkg.name -> modifiedPkg) - modifiedPkg - } - - // This function inserts a package by creating empty packages to the point - // where it can insert the supplied package `newPkg`. - def createAndInsert(currentPkg: PackageImpl, path: List[String]): PackageImpl = { - (path: @unchecked) match { - case x :: Nil => { - val existingPkg = currentPkg.members.collectFirst { - case p: PackageImpl if p.name == newPkg.name => p - } - - if (existingPkg.isDefined) mergedPackages(existingPkg.get, newPkg) - else { - currentPkg.members = newPkg :: currentPkg.members - newPkg - } - } - case x :: xs => { - val subPkg = s"${currentPkg.name}.$x" - val existingPkg = currentPkg.members.collectFirst { - case p: PackageImpl if p.name == subPkg => p - } - - if (existingPkg.isDefined) createAndInsert(existingPkg.get, xs) - else { - val newEmpty = EmptyPackage(currentPkg.path :+ x, subPkg) - packages = packages + (subPkg -> newEmpty) - currentPkg.members = newEmpty :: currentPkg.members - createAndInsert(newEmpty, xs) - } - } - } - } - - val path = newPkg.path - if (path.length == 1) - insertOrModifyRoot() - else if (packages.contains(newPkg.name)) - mergedPackages(packages(newPkg.name), newPkg) - else { - val root = packages.get(path.head) - if (root.isDefined) - // Root ancestor of `newPkg` exists, start recursing to point of - // insertion. Point of insertion will be the parent package of `newPkg`. - // - // Which is the first element of `newPkg`'s path - thus we use the tail - // to continue traversing down the tree. - createAndInsert(root.get, path.tail) - else { - val newEmpty = EmptyPackage(List(path.head), path.head) - packages = packages + (path.head -> newEmpty) - createAndInsert(newEmpty, path.tail) - } - } - } - - private[this] var totalRuns = 0 - private[this] var currentRun = 0 - - override def run(using Context): Unit = { - currentRun += 1 - report.echo(s"Compiling ($currentRun/$totalRuns): ${ctx.compilationUnit.source.file.name}") - collect(ctx.compilationUnit.tpdTree) // Will put packages in `packages` var - } - - override def runOn(units: List[CompilationUnit])(using Context): List[CompilationUnit] = { - // (1) Create package structure for all `units`, this will give us a complete structure - totalRuns = units.length - val compUnits = super.runOn(units) - - // (2) Set parents of entities, needed for linking - for { - parent <- rootPackages(packages) - child <- parent.members - } setParent(child, to = parent) - - // (3) Update Doc AST in ctx.base - for (kv <- packages) ctx.docbase.packagesMutable += kv - - // Return super's result - compUnits - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/core/DocImplicitsPhase.scala b/doc-tool/src/dotty/tools/dottydoc/core/DocImplicitsPhase.scala deleted file mode 100644 index e9f61c47dce5..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/DocImplicitsPhase.scala +++ /dev/null @@ -1,26 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotty.tools.dotc.transform.MegaPhase.MiniPhase -import dotty.tools.dotc.core.Flags -import dotc.core.Contexts.{Context, ctx} -import util.syntax._ - -class DocImplicitsPhase extends MiniPhase { - import dotty.tools.dotc.ast.tpd._ - - def phaseName = "addImplicitsPhase" - - override def transformDefDef(tree: DefDef)(using Context): Tree = { - if tree.symbol.isOneOf(Flags.GivenOrImplicit) // has to have an implicit flag - && tree.symbol.owner.isStaticOwner // owner has to be static (e.g. top-level `object`) - && tree.termParamss.length > 0 - && tree.termParamss(0).length == 1 // should only take one arg, since it has to be a transformation - then - val convertee = tree.termParamss(0)(0).symbol.info.widenDealias.finalResultType.typeSymbol // the pimped type (i.e. `class`) - ctx.docbase.addDef(convertee, tree.symbol.info.widenDealias.finalResultType.typeSymbol) - - tree - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/core/DocstringPhase.scala b/doc-tool/src/dotty/tools/dottydoc/core/DocstringPhase.scala deleted file mode 100644 index 4b8b9402936a..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/DocstringPhase.scala +++ /dev/null @@ -1,74 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.core.Contexts.{Context, ctx} -import dotc.core.Symbols.Symbol -import dotc.core.Comments.{ Comment => CompilerComment } -import transform.DocMiniPhase -import model._ -import model.internal._ -import model.comment._ -import util.syntax._ - -/** Phase to add docstrings to the Dottydoc AST */ -class DocstringPhase extends DocMiniPhase with CommentParser with CommentCleaner { - - private def getComment(sym: Symbol)(using Context): Option[CompilerComment] = { - ctx.docbase.docstring(sym) - .orElse { - // If the symbol doesn't have a docstring, look for an overridden - // ancestor with a docstring - sym.allOverriddenSymbols.collectFirst { - case parentSym if ctx.docbase.docstring(parentSym).isDefined => - parentSym - } - .flatMap(ctx.docbase.docstring) - } - } - - private def parsedComment(ent: Entity)(using Context): Option[Comment] = { - for { - comment <- getComment(ent.symbol) - text <- comment.expandedBody - } yield { - val parsed = parse(ent, ctx.docbase.packages, clean(text), text, comment.span) - if (ctx.settings.wikiSyntax.value) - WikiComment(ent, parsed, comment.span).comment - else - MarkdownComment(ent, parsed, comment.span).comment - } - } - - override def transformPackage(using Context) = { case ent: PackageImpl => - ent.copy(comment = parsedComment(ent)) :: Nil - } - - override def transformClass(using Context) = { case ent: ClassImpl => - ent.copy(comment = parsedComment(ent)) :: Nil - } - - override def transformCaseClass(using Context) = { case ent: CaseClassImpl => - ent.copy(comment = parsedComment(ent)) :: Nil - } - - override def transformTrait(using Context) = { case ent: TraitImpl => - ent.copy(comment = parsedComment(ent)) :: Nil - } - - override def transformObject(using Context) = { case ent: ObjectImpl => - ent.copy(comment = parsedComment(ent)) :: Nil - } - - override def transformDef(using Context) = { case ent: DefImpl => - ent.copy(comment = parsedComment(ent)) :: Nil - } - - override def transformVal(using Context) = { case ent: ValImpl => - ent.copy(comment = parsedComment(ent)) :: Nil - } - - override def transformTypeAlias(using Context) = { case ent: TypeAliasImpl => - ent.copy(comment = parsedComment(ent)) :: Nil - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/core/LinkCompanionsPhase.scala b/doc-tool/src/dotty/tools/dottydoc/core/LinkCompanionsPhase.scala deleted file mode 100644 index a3135a3b3f59..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/LinkCompanionsPhase.scala +++ /dev/null @@ -1,42 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.core.Contexts.{Context, ctx} - -import transform.DocMiniPhase -import model.internal._ -import model._ - -class LinkCompanions extends DocMiniPhase { - private def linkCompanions(ent: Entity)(using Context): ent.type = { - ent.children.groupBy(_.name).foreach { - case (_, List(x1: Companion, x2: Companion)) => - x1.companionPath = x2.path - x2.companionPath = x1.path - - case _ => () - } - ent - } - - override def transformPackage(using Context) = { case ent: PackageImpl => - linkCompanions(ent) :: Nil - } - - override def transformClass(using Context) = { case ent: ClassImpl => - linkCompanions(ent) :: Nil - } - - override def transformCaseClass(using Context) = { case ent: CaseClassImpl => - linkCompanions(ent) :: Nil - } - - override def transformObject(using Context) = { case ent: ObjectImpl => - linkCompanions(ent) :: Nil - } - - override def transformTrait(using Context) = { case ent: TraitImpl => - linkCompanions(ent) :: Nil - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/core/PackageObjectsPhase.scala b/doc-tool/src/dotty/tools/dottydoc/core/PackageObjectsPhase.scala deleted file mode 100644 index 74636755c65d..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/PackageObjectsPhase.scala +++ /dev/null @@ -1,30 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.core.Contexts.{Context, ctx} -import model._ -import model.internal._ -import transform.DocMiniPhase - -class PackageObjectsPhase extends DocMiniPhase { - - override def transformPackage(using Context) = { case pkg: PackageImpl => - pkg - .members - .collectFirst { case o: Object if o.symbol.isPackageObject => o } - .map { obj => - pkg.copy( - members = obj.members ++ pkg.members, - superTypes = obj.superTypes, - comment = obj.comment - ) - } - .getOrElse(pkg) :: Nil - } - - override def transformObject(using Context) = { case obj: Object => - if (obj.symbol.isPackageObject) Nil - else obj :: Nil - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/core/RemoveEmptyPackagesPhase.scala b/doc-tool/src/dotty/tools/dottydoc/core/RemoveEmptyPackagesPhase.scala deleted file mode 100644 index 19bcee63133e..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/RemoveEmptyPackagesPhase.scala +++ /dev/null @@ -1,15 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.core.Contexts.{Context, ctx} - -import transform.DocMiniPhase -import model._ - -class RemoveEmptyPackages extends DocMiniPhase { - override def transformPackage(using Context) = { case p: Package => - if (p.members.exists(_.kind != "package")) p :: Nil - else Nil - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/core/SortMembersPhase.scala b/doc-tool/src/dotty/tools/dottydoc/core/SortMembersPhase.scala deleted file mode 100644 index a544df2c6a92..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/SortMembersPhase.scala +++ /dev/null @@ -1,55 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.core.Contexts.{Context, ctx} - -import transform.DocMiniPhase -import model._ -import model.internal._ - -/** This DocMiniPhase sorts the members of all classes, traits, objects and packages */ -class SortMembers extends DocMiniPhase { - private implicit val EntityOrdering: Ordering[Entity] = new Ordering[Entity] { - def compare(x: Entity, y: Entity): Int = { - val nameComp = x.name.compareTo(y.name) - if (nameComp == 0) x.kind.compareTo(y.kind) - else nameComp - } - } - - private def sort(xs: List[Entity]): List[Entity] = { - def sortOrNil(xs: Option[List[Entity]]*) = - xs.map(_.getOrElse(Nil)).reduceLeft(_ ++ _).sorted - - val map = xs.groupBy(_.kind) - - val pkgs = sortOrNil(map.get("package")) - val typs = sortOrNil(map.get("type")) - val vals = sortOrNil(map.get("val"), map.get("var")) - val nested = sortOrNil(map.get("object"), map.get("class"), map.get("case class"), map.get("trait")) - val defs = sortOrNil(map.get("def")) - - pkgs ++ nested ++ typs ++ vals ++ defs - } - - override def transformPackage(using Context) = { case p: PackageImpl => - p.copy(members = sort(p.members)) :: Nil - } - - override def transformClass(using Context) = { case c: ClassImpl => - c.copy(members = sort(c.members)) :: Nil - } - - override def transformCaseClass(using Context) = { case cc: CaseClassImpl => - cc.copy(members = sort(cc.members)) :: Nil - } - - override def transformTrait(using Context) = { case t: TraitImpl => - t.copy(members = sort(t.members)) :: Nil - } - - override def transformObject(using Context) = { case o: ObjectImpl => - o.copy(members = sort(o.members)) :: Nil - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/core/StatisticsPhase.scala b/doc-tool/src/dotty/tools/dottydoc/core/StatisticsPhase.scala deleted file mode 100644 index bb409bbb5259..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/StatisticsPhase.scala +++ /dev/null @@ -1,156 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.core.Phases.Phase -import dotc.core.Contexts.{Context, ctx} -import dotc.core.Symbols.Symbol -import dotc.core.Decorators._ -import dotc.core.Flags._ -import dotc.CompilationUnit -import dottydoc.util.syntax._ -import dottydoc.util.traversing._ - -import model._ - -object Statistics { - implicit class MapTotals(val map: Map[String, Statistics]) extends AnyVal { - def totalEntities = - map.values.foldLeft(0)(_ + _.totalEntities) - } -} - -case class Statistics(pkgName: String, api: Counters, internalApi: Counters) { - def totalEntities = - api.totalEntities + internalApi.totalEntities - - def totalDocstrings = - api.totalDocstrings + internalApi.totalDocstrings -} - -case class Counters( - publicEntities: Int, - privateEntities: Int, - protectedEntities: Int, - - publicDocstrings: Int, - privateDocstrings: Int, - protectedDocstrings: Int -) { - def totalEntities = - publicEntities + privateEntities + protectedEntities - - def totalDocstrings = - publicDocstrings + privateDocstrings + protectedDocstrings - - def merge(o: Counters): Counters = Counters( - publicEntities + o.publicEntities, - privateEntities + o.privateEntities, - protectedEntities + o.protectedEntities, - publicDocstrings + o.publicDocstrings, - privateDocstrings + o.privateDocstrings, - protectedDocstrings + o.protectedDocstrings - ) -} - -class StatisticsPhase extends Phase { - - def phaseName = "StatisticsPhase" - - override def run(using Context): Unit = () - - override def runOn(units: List[CompilationUnit])(using Context): List[CompilationUnit] = { - for { - (pkgName, pack) <- ctx.docbase.packages - externalApi = collectPublicStats(pack) - internalApi = collectInternalStats(pack) - stats = Statistics(pkgName, externalApi, internalApi) - } ctx.docbase.registerStatistics(pkgName, stats) - - units - } - - def collectPublicStats(pack: Package)(using Context): Counters = { - var publicEntities: Int = 0 - var protectedEntities: Int = 0 - var publicDocstrings: Int = 0 - var protectedDocstrings: Int = 0 - - if (pack.comment.isDefined) { - publicEntities += 1 - publicDocstrings += 1 - } - - def doCount(sym: Symbol, comment: Int): Unit = - if (!sym.is(Protected)) { - publicEntities += 1 - publicDocstrings += comment - } - else { - protectedEntities += 1 - protectedDocstrings += comment - } - - - def recur(e: Entity, reachable: Boolean): Unit = { - val isVisible = !e.symbol.is(Private) && !e.symbol.privateWithin.exists - val shouldCount = isVisible && reachable - e match { - case e: Package => () - case e: Entity with Members => if (shouldCount) { - doCount(e.symbol, if (e.comment.isDefined) 1 else 0) - e.members.foreach { c => - if (!(e.symbol.is(Final) && c.symbol.is(Protected))) recur(c, true) - } - } - case e => - if (shouldCount) doCount(e.symbol, if (e.comment.isDefined) 1 else 0) - } - } - - pack.members.foreach(recur(_, true)) - Counters(publicEntities, 0, protectedEntities, publicDocstrings, 0, protectedDocstrings) - } - - def collectInternalStats(pack: Package)(using Context): Counters = { - var publicEntities: Int = 0 - var privateEntities: Int = 0 - var protectedEntities: Int = 0 - var publicDocstrings: Int = 0 - var privateDocstrings: Int = 0 - var protectedDocstrings: Int = 0 - - def doCount(sym: Symbol, comment: Int): Unit = - if (sym.is(Private)) { - privateEntities += 1 - privateDocstrings += comment - } - else if (!sym.is(Protected)) { - publicEntities += 1 - publicDocstrings += comment - } - else { - protectedEntities += 1 - protectedDocstrings += comment - } - - - def recur(e: Entity, reachable: Boolean): Unit = { - val internal = !reachable || e.symbol.is(Private) || e.symbol.privateWithin.exists - e match { - case _: Package => () - case e: Entity with Members => - e.members.foreach { c => - val childIsInternal = !internal || (e.symbol.is(Final) && c.symbol.is(Protected)) - recur(c, childIsInternal) - } - if (internal) doCount(e.symbol, if (e.comment.isDefined) 1 else 0) - case _ => - if (internal) doCount(e.symbol, if (e.comment.isDefined) 1 else 0) - } - } - - pack.members.foreach(recur(_, true)) - Counters(publicEntities, privateEntities, protectedEntities, publicDocstrings, privateDocstrings, protectedDocstrings) - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/core/TypeLinkingPhases.scala b/doc-tool/src/dotty/tools/dottydoc/core/TypeLinkingPhases.scala deleted file mode 100644 index be780b7c06c1..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/TypeLinkingPhases.scala +++ /dev/null @@ -1,119 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.core.Contexts.{Context, ctx} - -import transform.DocMiniPhase -import model._ -import model.internal._ -import model.comment._ -import model.references._ -import HtmlParsers._ -import util.MemberLookup -import util.syntax._ - -class LinkReturnTypes extends DocMiniPhase with TypeLinker { - override def transformDef(using Context) = { case df: DefImpl => - val returnValue = linkReference(df, df.returnValue, ctx.docbase.packages) - df.copy(returnValue = returnValue) :: Nil - } - - override def transformVal(using Context) = { case vl: ValImpl => - val returnValue = linkReference(vl, vl.returnValue, ctx.docbase.packages) - vl.copy(returnValue = returnValue) :: Nil - } - - override def transformTypeAlias(using Context) = { case ta: TypeAliasImpl => - ta.alias.map { alias => - val linkedAlias = linkReference(ta, alias, ctx.docbase.packages) - ta.copy(alias = Some(linkedAlias)) :: Nil - } - .getOrElse(ta :: Nil) - } -} - -class LinkParamListTypes extends DocMiniPhase with TypeLinker { - override def transformDef(using Context) = { case df: DefImpl => - val newParamLists = for { - ParamListImpl(list, isImplicit) <- df.paramLists - newList = list.map(linkReference(df, _, ctx.docbase.packages)) - } yield ParamListImpl(newList.asInstanceOf[List[NamedReference]], isImplicit) - - df.copy(paramLists = newParamLists) :: Nil - } -} - -class LinkSuperTypes extends DocMiniPhase with TypeLinker { - def linkSuperTypes(ent: Entity with SuperTypes)(using Context): List[MaterializableLink] = - ent.superTypes.collect { - case UnsetLink(title, query) => - handleEntityLink(title, lookup(Some(ent), ctx.docbase.packages, query), ent) - } - - override def transformClass(using Context) = { case cls: ClassImpl => - cls.copy(superTypes = linkSuperTypes(cls)) :: Nil - } - - override def transformCaseClass(using Context) = { case cc: CaseClassImpl => - cc.copy(superTypes = linkSuperTypes(cc)) :: Nil - } - - override def transformTrait(using Context) = { case trt: TraitImpl => - trt.copy(superTypes = linkSuperTypes(trt)) :: Nil - } - - override def transformObject(using Context) = { case obj: ObjectImpl => - obj.copy(superTypes = linkSuperTypes(obj)) :: Nil - } -} - -class LinkImplicitlyAddedTypes extends DocMiniPhase with TypeLinker { - override def transformDef(using Context) = { - case df: DefImpl if df.implicitlyAddedFrom.isDefined => - val implicitlyAddedFrom = linkReference(df, df.implicitlyAddedFrom.get, ctx.docbase.packages) - df.copy(implicitlyAddedFrom = Some(implicitlyAddedFrom)) :: Nil - } - - override def transformVal(using Context) = { - case vl: ValImpl if vl.implicitlyAddedFrom.isDefined => - val implicitlyAddedFrom = linkReference(vl, vl.implicitlyAddedFrom.get, ctx.docbase.packages) - vl.copy(implicitlyAddedFrom = Some(implicitlyAddedFrom)) :: Nil - } -} - -trait TypeLinker extends MemberLookup { - def handleEntityLink(title: String, target: Option[Entity], ent: Entity, query: String = ""): MaterializableLink = - target match { - case Some(target) => new MaterializedLink(title, target) - case none => NoLink(title, query) - } - - def linkReference(ent: Entity, ref: Reference, packs: Map[String, Package]): Reference = { - def linkRef(ref: Reference) = linkReference(ent, ref, packs) - - ref match { - case ref @ TypeReference(_, UnsetLink(t, query), tps) => - val inlineToHtml = InlineToHtml(ent) - val title = t - - val target = handleEntityLink(title, lookup(Some(ent), packs, query), ent, query) - val tpTargets = tps.map(linkReference(ent, _, packs)) - ref.copy(tpeLink = target, paramLinks = tpTargets) - case ref @ OrTypeReference(left, right) => - ref.copy(left = linkReference(ent, left, packs), right = linkReference(ent, right, packs)) - case ref @ AndTypeReference(left, right) => - ref.copy(left = linkReference(ent, left, packs), right = linkReference(ent, right, packs)) - case ref @ NamedReference(_, rf, _, _) => - ref.copy(ref = linkRef(rf)) - case ref @ FunctionReference(args, rv, _) => - ref.copy(args = args.map(linkReference(ent, _, packs)), returnValue = linkReference(ent, rv, packs)) - case ref @ TupleReference(args) => - ref.copy(args = args.map(linkRef)) - case ref @ BoundsReference(low, high) => - ref.copy(low = linkRef(low), high = linkRef(high)) - case _ => - ref - } - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/core/UsecasePhase.scala b/doc-tool/src/dotty/tools/dottydoc/core/UsecasePhase.scala deleted file mode 100644 index 3bf100a059f9..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/UsecasePhase.scala +++ /dev/null @@ -1,38 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.core.Contexts.{Context, ctx} -import dotc.ast.tpd - -import transform.DocMiniPhase -import model.internal._ -import model.factories._ -import dotty.tools.dotc.core.Symbols.Symbol -import util.syntax._ - -class UsecasePhase extends DocMiniPhase { - private def defdefToDef(d: tpd.DefDef, sym: Symbol)(using Context) = { - val name = d.name.show.split("\\$").head - DefImpl( - sym, - annotations(sym), - name, - flags(d), - path(d.symbol).init :+ name, - returnType(d.tpt.tpe), - typeParams(d.symbol), - paramLists(d.symbol.info) - ) - } - - override def transformDef(using Context) = { case df: DefImpl => - val defdefs = - ctx.docbase.docstring(df.symbol) - .map(_.usecases.flatMap(_.tpdCode)) - .getOrElse(Nil) - - if (defdefs.isEmpty) df :: Nil - else defdefs.map(defdefToDef(_, df.symbol)) - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/core/transform.scala b/doc-tool/src/dotty/tools/dottydoc/core/transform.scala deleted file mode 100644 index 04e2d771159a..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/core/transform.scala +++ /dev/null @@ -1,234 +0,0 @@ -package dotty.tools -package dottydoc -package core - -import dotc.CompilationUnit -import dotc.core.Contexts.{Context, ctx} -import dotc.core.Phases.Phase -import model._ -import model.internal._ -import util.syntax._ -import util.traversing._ - -object transform { - /** - * The idea behind DocMiniTransformations is to fuse transformations to the - * doc AST, much like `MiniPhase` in dotty core - but in a much simpler - * implementation - * - * Usage - * ----- - * - * Create a `DocMiniPhase` which overrides the relevant method: - * - * ``` - * override def transformDef(using Context) = { - * case x if shouldTransform(x) => x.copy(newValue = ...) :: Nil - * } - * ``` - * - * On each node in the AST, the appropriate method in `DocMiniPhase` will be - * called in the order that they are supplied in - * `DocMiniphaseTransformations`. - * - * There won't be a match-error as `transformX` is composed with an - * `identity` function. - * - * The transformations in `DocMiniTransformations` will apply transformations - * to all nodes - this means that you do _not_ need to transform children in - * `transformPackage`, because `transformX` will be called for the relevant - * children. If you want to add children to `Package` you need to do that in - * `transformPackage`, these additions will be persisted. - * - * Deleting nodes in the AST - * ------------------------- - * To delete a node in the AST, simply return an empty list from transforming method - */ - abstract class DocMiniTransformations extends Phase { - def transformations: List[DocMiniPhase] - - override def runOn(units: List[CompilationUnit])(using Context): List[CompilationUnit] = { - for { - pack <- rootPackages(ctx.docbase.packages) - transformed = performPackageTransform(pack) - } { - ctx.docbase.packagesMutable -= pack.name - transformed.foreach(p => ctx.docbase.packagesMutable += p.name -> p) - } - - units - } - - private def performPackageTransform(pack: Package)(using Context): List[Package] = { - def transformEntity[E <: Entity](e: E, f: DocMiniPhase => E => List[E])(createNew: E => E): List[Entity] = { - val transformEntities = transformations.foldLeft(e :: Nil) { case (oldEs, transf) => - oldEs.flatMap(f(transf)) - } - transformEntities.map(createNew) - } - - def traverse(ent: Entity): List[Entity] = ent match { - case p: Package => transformEntity(p, _.packageTransformation) { p => - val newPackage = PackageImpl( - p.symbol, - p.annotations, - p.name, - p.members.flatMap(traverse), - p.path, - p.superTypes, - p.comment, - p.parent - ) - - // Update reference in context to newPackage - ctx.docbase.packagesMutable += (newPackage.path.mkString(".") -> newPackage) - - newPackage - } - case t: TypeAlias => transformEntity(t, _.typeAliasTransformation) { t => - TypeAliasImpl( - t.symbol, - t.annotations, - t.modifiers, - t.name, - t.path, - t.alias, - t.typeParams, - t.comment, - t.parent - ) - } - case c: Class => transformEntity(c, _.classTransformation) { cls => - ClassImpl( - cls.symbol, - cls.annotations, - cls.name, - cls.members.flatMap(traverse), - cls.modifiers, - cls.path, - cls.typeParams, - cls.constructors, - cls.superTypes, - cls.comment, - cls.companionPath, - cls.parent - ) - } - case cc: CaseClass => transformEntity(cc, _.caseClassTransformation) { cc => - CaseClassImpl( - cc.symbol, - cc.annotations, - cc.name, - cc.members.flatMap(traverse), - cc.modifiers, - cc.path, - cc.typeParams, - cc.constructors, - cc.superTypes, - cc.comment, - cc.companionPath, - cc.parent - ) - } - case trt: Trait => transformEntity(trt, _.traitTransformation) { trt => - TraitImpl( - trt.symbol, - trt.annotations, - trt.name, - trt.members.flatMap(traverse), - trt.modifiers, - trt.path, - trt.typeParams, - trt.traitParams, - trt.superTypes, - trt.comment, - trt.companionPath, - trt.parent - ) - } - case obj: Object => transformEntity(obj, _.objectTransformation) { obj => - ObjectImpl( - obj.symbol, - obj.annotations, - obj.name, - obj.members.flatMap(traverse), - obj.modifiers, - obj.path, - obj.superTypes, - obj.comment, - obj.companionPath, - obj.parent - ) - } - case df: Def => transformEntity(df, _.defTransformation) { df => - DefImpl( - df.symbol, - df.annotations, - df.name, - df.modifiers, - df.path, - df.returnValue, - df.typeParams, - df.paramLists, - df.comment, - df.implicitlyAddedFrom, - df.parent - ) - } - case vl: Val => transformEntity(vl, _.valTransformation) { vl => - ValImpl( - vl.symbol, - vl.annotations, - vl.name, - vl.modifiers, - vl.path, - vl.returnValue, - vl.kind, - vl.comment, - vl.implicitlyAddedFrom, - vl.parent - ) - } - } - - traverse(pack).asInstanceOf[List[Package]] - } - - override def run(using Context): Unit = () - } - - object DocMiniTransformations { - private var previousPhase = 0 - def apply(miniPhases: DocMiniPhase*) = - new DocMiniTransformations { - val transformations = miniPhases.toList - val packages = Map.empty[String, Package] - - def phaseName = s"MiniTransformation${ previousPhase += 1 }" - } - } - - trait DocMiniPhase { phase => - private def identity[E]: PartialFunction[E, List[E]] = { - case id: E @unchecked => id :: Nil - } - - def transformPackage(using Context): PartialFunction[Package, List[Package]] = identity - def transformTypeAlias(using Context): PartialFunction[TypeAlias, List[TypeAlias]] = identity - def transformClass(using Context): PartialFunction[Class, List[Class]] = identity - def transformCaseClass(using Context): PartialFunction[CaseClass, List[CaseClass]] = identity - def transformTrait(using Context): PartialFunction[Trait, List[Trait]] = identity - def transformObject(using Context): PartialFunction[Object, List[Object]] = identity - def transformDef(using Context): PartialFunction[Def, List[Def]] = identity - def transformVal(using Context): PartialFunction[Val, List[Val]] = identity - - private[transform] def packageTransformation(p: Package)(using Context) = (transformPackage orElse identity)(p) - private[transform] def typeAliasTransformation(alias: TypeAlias)(using Context) = (transformTypeAlias orElse identity)(alias) - private[transform] def classTransformation(cls: Class)(using Context) = (transformClass orElse identity)(cls) - private[transform] def caseClassTransformation(cc: CaseClass)(using Context) = (transformCaseClass orElse identity)(cc) - private[transform] def traitTransformation(trt: Trait)(using Context) = (transformTrait orElse identity)(trt) - private[transform] def objectTransformation(obj: Object)(using Context) = (transformObject orElse identity)(obj) - private[transform] def defTransformation(df: Def)(using Context) = (transformDef orElse identity)(df) - private[transform] def valTransformation(vl: Val)(using Context) = (transformVal orElse identity)(vl) - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/model/JavaConverters.scala b/doc-tool/src/dotty/tools/dottydoc/model/JavaConverters.scala deleted file mode 100644 index f9d26e1052d1..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/JavaConverters.scala +++ /dev/null @@ -1,299 +0,0 @@ -package dotty.tools.dottydoc -package model - -import comment._ -import references._ - -import java.util.LinkedList - -object JavaConverters { - import scala.collection.JavaConverters._ - import java.util.{ Map => JMap } - - implicit class OptStr(val opt: Option[String]) extends AnyVal { - def asJava = opt.getOrElse(null) - } - - implicit class OptMap(val opt: Option[JMap[String, _]]) extends AnyVal { - def asJava = opt.getOrElse(Map.empty.asJava) - } - - implicit class JavaComment(val cmt: Comment) extends AnyVal { - def asJava: JMap[String, _] = Map( - "body" -> cmt.body, - "short" -> cmt.short, - "authors" -> cmt.authors.asJava, - "see" -> cmt.see.asJava, - "result" -> cmt.result.asJava, - "throws" -> cmt.throws.asJava, - "valueParams" -> cmt.valueParams.asJava, - "typeParams" -> cmt.typeParams.asJava, - "version" -> cmt.version.asJava, - "since" -> cmt.since.asJava, - "todo" -> cmt.todo.asJava, - "deprecated" -> cmt.deprecated.asJava, - "note" -> cmt.note.asJava, - "example" -> cmt.example.asJava, - "constructor" -> cmt.constructor.asJava, - "group" -> cmt.group.asJava, - "groupDesc" -> cmt.groupDesc.asJava, - "groupNames" -> cmt.groupNames.asJava, - "groupPrio" -> cmt.groupPrio.asJava, - "hideImplicitConversions" -> cmt.hideImplicitConversions.asJava - ).asJava - } - - implicit class JavaParamList(val pl: ParamList) extends AnyVal { - def asJava: JMap[String, _] = Map( - "list" -> pl.list.map(_.asJava).asJava, - "isImplicit" -> pl.isImplicit - ).asJava - } - - implicit class JavaReference(val ref: Reference) extends AnyVal { - def asJava: JMap[String, _] = ref match { - case TypeReference(title, tpeLink, paramLinks) => Map( - "kind" -> "TypeReference", - "title" -> title, - "tpeLink" -> tpeLink.asJava, - "paramLinks" -> paramLinks.map(_.asJava).asJava, - "scala" -> ref - ).asJava - - case OrTypeReference(left, right) => Map( - "kind" -> "OrTypeReference", - "left" -> left.asJava, - "right" -> right.asJava, - "scala" -> ref - ).asJava - - case AndTypeReference(left, right) => Map( - "kind" -> "AndTypeReference", - "left" -> left.asJava, - "right" -> right.asJava, - "scala" -> ref - ).asJava - - case FunctionReference(args, returnValue, isImplicit) => Map( - "kind" -> "FunctionReference", - "args" -> args.map(_.asJava).asJava, - "returnValue" -> returnValue.asJava, - "isImplicit" -> isImplicit, - "scala" -> ref - ).asJava - - case TupleReference(args) => Map( - "kind" -> "TupleReference", - "args" -> args.map(_.asJava).asJava, - "scala" -> ref - ).asJava - - case BoundsReference(low, high) => Map( - "kind" -> "BoundsReference", - "low" -> low.asJava, - "hight" -> high.asJava, - "scala" -> ref - ).asJava - - case NamedReference(title, ref, isByName, isRepeated) => Map( - "kind" -> "NamedReference", - "title" -> title, - "ref" -> ref.asJava, - "isByName" -> isByName, - "isRepeated" -> isRepeated, - "scala" -> ref - ).asJava - - case ConstantReference(title) => Map( - "kind" -> "ConstantReference", - "title" -> title, - "scala" -> ref - ).asJava - - case EmptyReference => - throw new IllegalStateException("Empty reference discovered while converting to Java Map") - } - } - - implicit class JavaMaterializableLink(val link: MaterializableLink) extends AnyVal { - def asJava: JMap[String, _] = link match { - case UnsetLink(title, query) => Map( - "kind" -> "UnsetLink", - "title" -> title, - "query" -> query, - "scala" -> link - ).asJava - - case MaterializedLink(title, target) => Map( - "kind" -> "MaterializedLink", - "title" -> title, - "target" -> target, - "scala" -> link - ).asJava - - case NoLink(title, target) => Map( - "kind" -> "NoLink", - "title" -> title, - "target" -> target, - "scala" -> link - ).asJava - } - } - - implicit class JavaEntity(val ent: Entity) extends AnyVal { - def asJava: JMap[String, _] = parseEntity(ent) - } - - private def parseEntity(ent: Entity): JMap[String, _] = { - val entity = Map( - "kind" -> ent.kind, - "annotations" -> ent.annotations.asJava, - "name" -> ent.name, - "path" -> ent.path.asJava, - "children" -> ent.children.map(_.asJava).asJava, - "comment" -> ent.comment.map(_.asJava).asJava, - "signature" -> ent.signature - ) - val members = ent match { - case ent: Members => Map( - "members" -> ent.members.map(_.asJava).asJava, - "hasVisibleMembers" -> ent.hasVisibleMembers - ) - case _ => Map.empty - } - val superTypes = ent match { - case ent: SuperTypes => Map( - "superTypes" -> ent.superTypes.map(_.asJava).asJava - ) - case _ => Map.empty - } - val modifiers = ent match { - case ent: Modifiers => Map( - "modifiers" -> ent.modifiers.asJava, - "isPrivate" -> ent.isPrivate, - "isProtected" -> ent.isProtected - ) - case _ => Map.empty - } - val typeParams = ent match { - case ent: TypeParams => Map( - "typeParams" -> ent.typeParams.asJava - ) - case _ => Map.empty - } - val constructors = ent match { - case ent: Constructors => Map( - "constructors" -> ent.constructors.map(_.map(_.asJava).asJava).asJava - ) - case _ => Map.empty - } - val companion = ent match { - case ent: Companion => Map( - "hasCompanion" -> ent.hasCompanion, - "companionPath" -> ent.companionPath.asJava - ) - case _ => Map.empty - } - val returnValue = ent match { - case ent: ReturnValue => Map( - "returnValue" -> ent.returnValue.asJava - ) - case _ => Map.empty - } - val implicitlyAddedEntity = ent match { - case ent: ImplicitlyAddedEntity => Map( - "implicitlyAddedFrom" -> ent.implicitlyAddedFrom.map(_.asJava).asJava - ) - case _ => Map.empty - } - val typeAlias : Map[String, _] = ent match { - case ent: TypeAlias => Map( - "alias" -> ent.alias.map(_.asJava).asJava - ) - case _ => Map.empty - } - val trt = ent match { - case ent: Trait => Map( - "traitParams" -> ent.traitParams.map(_.asJava).asJava - ) - case _ => Map.empty - } - val df = ent match { - case ent: Def => Map( - "paramLists" -> ent.paramLists.map(_.asJava).asJava - ) - case _ => Map.empty - } - - { - entity ++ - members ++ - superTypes ++ - modifiers ++ - typeParams ++ - constructors ++ - companion ++ - returnValue ++ - implicitlyAddedEntity ++ - typeAlias ++ - trt ++ - df - }.asJava - } - - implicit class JavaMap(val map: collection.immutable.Map[String, Package]) extends AnyVal { - def toJavaList: LinkedList[AnyRef] = - convertToList(map.transform((_, v) => v.asJava).toMap) - - def flattened: LinkedList[AnyRef] = - convertToList(map.transform((_, v) => flattenEntity(v)).toMap) - - private[this] def convertToList(ms: collection.Map[String, AnyRef]): LinkedList[AnyRef] = - ms.toList.sortBy(_._1) - .foldLeft(new LinkedList[AnyRef]()) { case (list, (_, value)) => - list.add(value); list - } - - private[this] def flattenEntity(e: Entity): JMap[String, _] = { - def entity(e: Entity) = - Map("name" -> e.name, "path" -> e.path.asJava, "kind" -> e.kind) - - def members(e: Entity with Members) = - Map("members" -> e.members.map(flattenEntity).asJava) - - def companion(e: Companion) = Map( - "hasCompanion" -> e.hasCompanion, - "companionPath" -> e.companionPath.asJava - ) - - def typeParams(e: TypeParams) = - Map("typeParams" -> e.typeParams.asJava) - - def paramLists(e: Def) = Map( - "paramLists" -> { - e.paramLists.map { paramList => - Map( - "isImplicit" -> paramList.isImplicit, - "list" -> paramList.list.map(_.asJava).asJava - ).asJava - } - .asJava - } - ) - - def returnValue(e: ReturnValue) = - Map("returnValue" -> e.returnValue.asJava) - - entity(e) ++ (e match { - case e: Package => members(e) - case e: Class => members(e) ++ companion(e) - case e: CaseClass => members(e) ++ companion(e) - case e: Trait => members(e) ++ companion(e) - case e: Object => members(e) ++ companion(e) - case e: Def => typeParams(e) ++ paramLists(e) ++ returnValue(e) - case e: TypeAlias => Map.empty - case e: Val => Map.empty - }) - }.asJava - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/model/comment/BodyEntities.scala b/doc-tool/src/dotty/tools/dottydoc/model/comment/BodyEntities.scala deleted file mode 100644 index 019ba24dfec4..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/comment/BodyEntities.scala +++ /dev/null @@ -1,94 +0,0 @@ -package dotty.tools.dottydoc -package model -package comment - -import scala.collection.SortedMap - -/** A body of text. A comment has a single body, which is composed of - * at least one block. Inside every body is exactly one summary (see - * [[scala.tools.nsc.doc.model.comment.Summary]]). */ -final case class Body(blocks: Seq[Block]) { - - /** The summary text of the comment body. */ - lazy val summary: Option[Body] = { - def summaryInBlock(block: Block): Seq[Inline] = block match { - case Title(text, _) => summaryInInline(text) - case Paragraph(text) => summaryInInline(text) - case UnorderedList(items) => items flatMap summaryInBlock - case OrderedList(items, _) => items flatMap summaryInBlock - case DefinitionList(items) => items.values.toSeq flatMap summaryInBlock - case _ => Nil - } - def summaryInInline(text: Inline): Seq[Inline] = text match { - case Summary(text) => List(text) - case Chain(items) => items flatMap summaryInInline - case Italic(text) => summaryInInline(text) - case Bold(text) => summaryInInline(text) - case Underline(text) => summaryInInline(text) - case Superscript(text) => summaryInInline(text) - case Subscript(text) => summaryInInline(text) - case Link(_, title) => summaryInInline(title) - case _ => Nil - } - (blocks flatMap summaryInBlock).toList match { - case Nil => None - case inl :: Nil => Some(Body(Seq(Paragraph(inl)))) - case inls => Some(Body(Seq(Paragraph(Chain(inls))))) - } - } -} - -/** A block-level element of text, such as a paragraph or code block. */ -sealed abstract class Block - -final case class Title(text: Inline, level: Int) extends Block -final case class Paragraph(text: Inline) extends Block -final case class Code(data: String) extends Block -final case class UnorderedList(items: Seq[Block]) extends Block -final case class OrderedList(items: Seq[Block], style: String) extends Block -final case class DefinitionList(items: SortedMap[Inline, Block]) extends Block -final case class HorizontalRule() extends Block - -/** An section of text inside a block, possibly with formatting. */ -sealed abstract class Inline - -final case class Chain(items: Seq[Inline]) extends Inline -final case class Italic(text: Inline) extends Inline -final case class Bold(text: Inline) extends Inline -final case class Underline(text: Inline) extends Inline -final case class Superscript(text: Inline) extends Inline -final case class Subscript(text: Inline) extends Inline -final case class Link(target: String, title: Inline) extends Inline -final case class Monospace(text: Inline) extends Inline -final case class Text(text: String) extends Inline -abstract class EntityLink(val title: Inline) extends Inline { def link: LinkTo } -object EntityLink { - def apply(title: Inline, linkTo: LinkTo) = new EntityLink(title) { def link: LinkTo = linkTo } - def unapply(el: EntityLink): Some[(Inline, LinkTo)] = Some((el.title, el.link)) -} -final case class HtmlTag(data: String) extends Inline { - private val Pattern = """(?ms)\A<(/?)(.*?)[\s>].*\z""".r - private val (isEnd, tagName) = data match { - case Pattern(s1, s2) => - (! s1.isEmpty, Some(s2.toLowerCase)) - case _ => - (false, None) - } - - def canClose(open: HtmlTag) = { - isEnd && tagName == open.tagName - } - - private val TagsNotToClose = Set("br", "img") - def close = tagName collect { case name if !TagsNotToClose(name) => HtmlTag(s"</$name>") } -} - -/** The summary of a comment, usually its first sentence. There must be exactly one summary per body. */ -final case class Summary(text: Inline) extends Inline - -sealed trait LinkTo -final case class LinkToExternal(name: String, url: String) extends LinkTo -final case class Tooltip(name: String) extends LinkTo - -/** Linking directly to entities is not picklable because of cyclic references */ -final case class LinkToEntity(entity: Entity) extends LinkTo diff --git a/doc-tool/src/dotty/tools/dottydoc/model/comment/Comment.scala b/doc-tool/src/dotty/tools/dottydoc/model/comment/Comment.scala deleted file mode 100644 index 619445cf8d3b..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/comment/Comment.scala +++ /dev/null @@ -1,173 +0,0 @@ -package dotty.tools -package dottydoc -package model -package comment - -import dotty.tools.dottydoc.util.syntax._ -import dotty.tools.dotc.core.Contexts.{Context, ctx} -import dotty.tools.dotc.util.Spans._ -import com.vladsch.flexmark.util.ast.{ Node => MarkdownNode } -import HtmlParsers._ -import util.MemberLookup - -case class Comment ( - body: String, - short: String, - authors: List[String], - see: List[String], - result: Option[String], - throws: Map[String, String], - valueParams: Map[String, String], - typeParams: Map[String, String], - version: Option[String], - since: Option[String], - todo: List[String], - deprecated: Option[String], - note: List[String], - example: List[String], - constructor: Option[String], - group: Option[String], - groupDesc: Map[String, String], - groupNames: Map[String, String], - groupPrio: Map[String, String], - /** List of conversions to hide - containing e.g: `scala.Predef.FloatArrayOps` */ - hideImplicitConversions: List[String] -) - -private[comment] case class ParsedComment ( - body: String, - authors: List[String], - see: List[String], - result: List[String], - throws: Map[String, String], - valueParams: Map[String, String], - typeParams: Map[String, String], - version: List[String], - since: List[String], - todo: List[String], - deprecated: List[String], - note: List[String], - example: List[String], - constructor: List[String], - group: List[String], - groupDesc: Map[String, String], - groupNames: Map[String, String], - groupPrio: Map[String, String], - hideImplicitConversions: List[String], - shortDescription: List[String] -) - -trait MarkupConversion[T] extends MemberLookup { - def ent: Entity - def span: Span - def parsed: ParsedComment - - protected def linkedExceptions(m: Map[String, String])(using Context): Map[String, String] - protected def stringToMarkup(str: String)(using Context): T - protected def markupToHtml(t: T)(using Context): String - protected def stringToShortHtml(str: String)(using Context): String - protected def filterEmpty(xs: List[String])(using Context): List[T] - protected def filterEmpty(xs: Map[String, String])(using Context): Map[String, T] - - private def single(annot: String, xs: List[String], filter: Boolean = true)(using Context): Option[T] = - (if (filter) filterEmpty(xs) else xs.map(stringToMarkup)) match { - case x :: xs => - if (xs.nonEmpty) ctx.docbase.warn( - s"Only allowed to have a single annotation for $annot", - ent.symbol.sourcePosition(span) - ) - Some(x) - case _ => None - } - - final def comment(using Context): Comment = Comment( - body = markupToHtml(stringToMarkup(parsed.body)), - short = stringToShortHtml(parsed.body), - authors = filterEmpty(parsed.authors).map(markupToHtml), - see = filterEmpty(parsed.see).map(markupToHtml), - result = single("@return", parsed.result).map(markupToHtml), - throws = linkedExceptions(parsed.throws), - valueParams = filterEmpty(parsed.valueParams).transform((_, v) => markupToHtml(v)).toMap, - typeParams = filterEmpty(parsed.typeParams).transform((_, v) => markupToHtml(v)).toMap, - version = single("@version", parsed.version).map(markupToHtml), - since = single("@since", parsed.since).map(markupToHtml), - todo = filterEmpty(parsed.todo).map(markupToHtml), - deprecated = single("@deprecated", parsed.deprecated, filter = false).map(markupToHtml), - note = filterEmpty(parsed.note).map(markupToHtml), - example = filterEmpty(parsed.example).map(markupToHtml), - constructor = single("@constructor", parsed.constructor).map(markupToHtml), - group = single("@group", parsed.group).map(markupToHtml), - groupDesc = filterEmpty(parsed.groupDesc).transform((_, v) => markupToHtml(v)).toMap, - groupNames = filterEmpty(parsed.groupNames).transform((_, v) => markupToHtml(v)).toMap, - groupPrio = filterEmpty(parsed.groupPrio).transform((_, v) => markupToHtml(v)).toMap, - hideImplicitConversions = filterEmpty(parsed.hideImplicitConversions).map(markupToHtml) - ) -} - -case class MarkdownComment(ent: Entity, parsed: ParsedComment, span: Span) -extends MarkupConversion[MarkdownNode] { - - def stringToMarkup(str: String)(using Context) = - str.toMarkdown(ent) - - def stringToShortHtml(str: String)(using Context) = - str.toMarkdown(ent).shortenAndShow - - def markupToHtml(md: MarkdownNode)(using Context) = - md.show - - def linkedExceptions(m: Map[String, String])(using Context) = { - val inlineToHtml = InlineToHtml(ent) - m.map { case (targetStr, body) => - val link = makeEntityLink(ent, ctx.docbase.packages, Monospace(Text(targetStr)), targetStr) - (targetStr, inlineToHtml(link)) - } - } - - def filterEmpty(xs: List[String])(using Context) = - xs.map(_.trim) - .filterNot(_.isEmpty) - .map(stringToMarkup) - - def filterEmpty(xs: Map[String, String])(using Context) = - xs.transform((_, v) => v.trim) - .filterNot { case (_, v) => v.isEmpty } - .transform((_, v) => stringToMarkup(v)) -} - -case class WikiComment(ent: Entity, parsed: ParsedComment, span: Span) -extends MarkupConversion[Body] { - - def filterEmpty(xs: Map[String,String])(using Context) = - xs.transform((_, v) => v.toWiki(ent, ctx.docbase.packages, span)) - .filterNot { case (_, v) => v.blocks.isEmpty } - - def filterEmpty(xs: List[String])(using Context) = - xs.map(_.toWiki(ent, ctx.docbase.packages, span)) - - def markupToHtml(t: Body)(using Context) = - t.show(ent) - - def stringToMarkup(str: String)(using Context) = - str.toWiki(ent, ctx.docbase.packages, span) - - def stringToShortHtml(str: String)(using Context) = { - val parsed = stringToMarkup(str) - parsed.summary.getOrElse(parsed).show(ent) - } - - def linkedExceptions(m: Map[String, String])(using Context) = { - m.transform((_, v) => v.toWiki(ent, ctx.docbase.packages, span)).map { case (targetStr, body) => - val link = lookup(Some(ent), ctx.docbase.packages, targetStr) - val newBody = body match { - case Body(List(Paragraph(Chain(content)))) => - val descr = Text(" ") +: content - val link = makeEntityLink(ent, ctx.docbase.packages, Monospace(Text(targetStr)), targetStr) - Body(List(Paragraph(Chain(link +: descr)))) - case _ => body - } - - (targetStr, newBody.show(ent)) - } - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentCleaner.scala b/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentCleaner.scala deleted file mode 100644 index 3ac2ea1623c8..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentCleaner.scala +++ /dev/null @@ -1,26 +0,0 @@ -package dotty.tools.dottydoc -package model -package comment - -trait CommentCleaner { - import Regexes._ - import java.util.regex.Matcher - - def clean(comment: String): List[String] = { - def cleanLine(line: String): String = { - // Remove trailing whitespaces - TrailingWhitespace.replaceAllIn(line, "") match { - case CleanCommentLine(ctl) => ctl - case tl => tl - } - } - val strippedComment = comment.trim.stripPrefix("/*").stripSuffix("*/") - val safeComment = DangerousTags.replaceAllIn(strippedComment, { htmlReplacement(_) }) - val javadoclessComment = JavadocTags.replaceAllIn(safeComment, { javadocReplacement(_) }) - val markedTagComment = - SafeTags.replaceAllIn(javadoclessComment, { mtch => - Matcher.quoteReplacement(s"${safeTagMarker}${mtch.matched}${safeTagMarker}") - }) - markedTagComment.linesIterator.toList map (cleanLine) - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentParser.scala b/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentParser.scala deleted file mode 100644 index a73ab94bc18e..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentParser.scala +++ /dev/null @@ -1,243 +0,0 @@ -package dotty.tools.dottydoc -package model -package comment - -import dotty.tools.dottydoc.util.syntax._ -import dotty.tools.dotc.util.Spans._ -import dotty.tools.dotc.core.Symbols._ -import dotty.tools.dotc.core.Contexts.{Context, ctx} -import dotty.tools.dotc.core.Decorators._ -import dotty.tools.dotc.printing.Formatting.hl -import scala.collection.mutable -import dotty.tools.dotc.config.Printers.dottydoc -import scala.util.matching.Regex -import com.vladsch.flexmark.util.ast.{ Node => MarkdownNode } -import com.vladsch.flexmark.parser.{ Parser => MarkdownParser } - -trait CommentParser extends util.MemberLookup { - import Regexes._ - import model.internal._ - - /** Parses a raw comment string into a `Comment` object. - * @param packages all packages parsed by Scaladoc tool, used for lookup - * @param cleanComment a cleaned comment to be parsed - * @param src the raw comment source string. - * @param span the position of the comment in source. - */ - def parse( - entity: Entity, - packages: Map[String, Package], - comment: List[String], - src: String, - span: Span, - site: Symbol = NoSymbol - )(using Context): ParsedComment = { - - /** Parses a comment (in the form of a list of lines) to a `Comment` - * instance, recursively on lines. To do so, it splits the whole comment - * into main body and tag bodies, then runs the `WikiParser` on each body - * before creating the comment instance. - * - * @param docBody The body of the comment parsed until now. - * @param tags All tags parsed until now. - * @param lastTagKey The last parsed tag, or `None` if the tag section - * hasn't started. Lines that are not tagged are part - * of the previous tag or, if none exists, of the body. - * @param remaining The lines that must still recursively be parsed. - * @param inCodeBlock Whether the next line is part of a code block (in - * which no tags must be read). - */ - def parseComment ( - docBody: StringBuilder, - tags: Map[TagKey, List[String]], - lastTagKey: Option[TagKey], - remaining: List[String], - inCodeBlock: Boolean - ): ParsedComment = remaining match { - - case CodeBlockStartRegex(before, marker, after) :: ls if (!inCodeBlock) => - if (!before.trim.isEmpty && !after.trim.isEmpty) - parseComment(docBody, tags, lastTagKey, before :: marker :: after :: ls, inCodeBlock = false) - else if (!before.trim.isEmpty) - parseComment(docBody, tags, lastTagKey, before :: marker :: ls, inCodeBlock = false) - else if (!after.trim.isEmpty) - parseComment(docBody, tags, lastTagKey, marker :: after :: ls, inCodeBlock = true) - else lastTagKey match { - case Some(key) => - val value = - ((tags get key): @unchecked) match { - case Some(b :: bs) => (b + endOfLine + marker) :: bs - case None => oops("lastTagKey set when no tag exists for key") - } - parseComment(docBody, tags + (key -> value), lastTagKey, ls, inCodeBlock = true) - case None => - parseComment(docBody append endOfLine append marker, tags, lastTagKey, ls, inCodeBlock = true) - } - - case CodeBlockEndRegex(before, marker, after) :: ls => { - if (!before.trim.isEmpty && !after.trim.isEmpty) - parseComment(docBody, tags, lastTagKey, before :: marker :: after :: ls, inCodeBlock = true) - if (!before.trim.isEmpty) - parseComment(docBody, tags, lastTagKey, before :: marker :: ls, inCodeBlock = true) - else if (!after.trim.isEmpty) - parseComment(docBody, tags, lastTagKey, marker :: after :: ls, inCodeBlock = false) - else lastTagKey match { - case Some(key) => - val value = - ((tags get key): @unchecked) match { - case Some(b :: bs) => (b + endOfLine + marker) :: bs - case None => oops("lastTagKey set when no tag exists for key") - } - parseComment(docBody, tags + (key -> value), lastTagKey, ls, inCodeBlock = false) - case None => - parseComment(docBody append endOfLine append marker, tags, lastTagKey, ls, inCodeBlock = false) - } - } - - case SymbolTagRegex(name, sym, body) :: ls if (!inCodeBlock) => { - val key = SymbolTagKey(name, sym) - val value = body :: tags.getOrElse(key, Nil) - parseComment(docBody, tags + (key -> value), Some(key), ls, inCodeBlock) - } - - case SimpleTagRegex(name, body) :: ls if (!inCodeBlock) => { - val key = SimpleTagKey(name) - val value = body :: tags.getOrElse(key, Nil) - parseComment(docBody, tags + (key -> value), Some(key), ls, inCodeBlock) - } - - case SingleTagRegex(name) :: ls if (!inCodeBlock) => { - val key = SimpleTagKey(name) - val value = "" :: tags.getOrElse(key, Nil) - parseComment(docBody, tags + (key -> value), Some(key), ls, inCodeBlock) - } - - case line :: ls if (lastTagKey.isDefined) => { - val newtags = if (!line.isEmpty) { - val key = lastTagKey.get - val value = - ((tags get key): @unchecked) match { - case Some(b :: bs) => (b + endOfLine + line) :: bs - case None => oops("lastTagKey set when no tag exists for key") - } - tags + (key -> value) - } else tags - parseComment(docBody, newtags, lastTagKey, ls, inCodeBlock) - } - - case line :: ls => { - if (docBody.length > 0) docBody append endOfLine - docBody append line - parseComment(docBody, tags, lastTagKey, ls, inCodeBlock) - } - - case Nil => { - // Take the {inheritance, content} diagram keys aside, as it doesn't need any parsing - val inheritDiagramTag = SimpleTagKey("inheritanceDiagram") - val contentDiagramTag = SimpleTagKey("contentDiagram") - - val inheritDiagramText: List[String] = tags.get(inheritDiagramTag) match { - case Some(list) => list - case None => List.empty - } - - val contentDiagramText: List[String] = tags.get(contentDiagramTag) match { - case Some(list) => list - case None => List.empty - } - - val stripTags = List(inheritDiagramTag, contentDiagramTag, SimpleTagKey("template"), SimpleTagKey("documentable")) - val tagsWithoutDiagram = tags.filterNot(pair => stripTags.contains(pair._1)) - - val bodyTags: mutable.Map[TagKey, List[String]] = - mutable.Map((tagsWithoutDiagram).toSeq: _*) - - def allTags(key: SimpleTagKey): List[String] = - (bodyTags remove key).getOrElse(Nil).reverse - - def allSymsOneTag(key: TagKey, filterEmpty: Boolean = true): Map[String, String] = { - val keys: Seq[SymbolTagKey] = - bodyTags.keys.toSeq flatMap { - case stk: SymbolTagKey if (stk.name == key.name) => Some(stk) - case stk: SimpleTagKey if (stk.name == key.name) => - dottydoc.println(s"$span: tag '@${stk.name}' must be followed by a symbol name") - None - case _ => None - } - val pairs: Seq[(String, String)] = - for (key <- keys) yield { - val bs = (bodyTags remove key).get - if (bs.length > 1) - dottydoc.println(s"$span: only one '@${key.name}' tag for symbol ${key.symbol} is allowed") - (key.symbol, bs.head) - } - Map.empty[String, String] ++ pairs - } - - val cmt = ParsedComment( - body = docBody.toString, - authors = allTags(SimpleTagKey("author")), - see = allTags(SimpleTagKey("see")), - result = allTags(SimpleTagKey("return")), - throws = allSymsOneTag(SimpleTagKey("throws")), - valueParams = allSymsOneTag(SimpleTagKey("param")), - typeParams = allSymsOneTag(SimpleTagKey("tparam")), - version = allTags(SimpleTagKey("version")), - since = allTags(SimpleTagKey("since")), - todo = allTags(SimpleTagKey("todo")), - deprecated = allTags(SimpleTagKey("deprecated")), - note = allTags(SimpleTagKey("note")), - example = allTags(SimpleTagKey("example")), - constructor = allTags(SimpleTagKey("constructor")), - group = allTags(SimpleTagKey("group")), - groupDesc = allSymsOneTag(SimpleTagKey("groupdesc")), - groupNames = allSymsOneTag(SimpleTagKey("groupname")), - groupPrio = allSymsOneTag(SimpleTagKey("groupprio")), - hideImplicitConversions = allTags(SimpleTagKey("hideImplicitConversion")), - shortDescription = allTags(SimpleTagKey("shortDescription")) - ) - - for ((key, _) <- bodyTags) ctx.docbase.warn( - em"Tag '${hl("@" + key.name)}' is not recognised", - // FIXME: here the position is stretched out over the entire comment, - // with the point being at the very end. This ensures that the entire - // comment will be visible in error reporting. A more fine-grained - // reporting would be amazing here. - entity.symbol.sourcePosition(Span(span.start, span.end, span.end)) - ) - - cmt - } - } - - parseComment(new StringBuilder(comment.size), Map.empty, None, comment, inCodeBlock = false) - } - - /** A key used for a tag map. The key is built from the name of the tag and - * from the linked symbol if the tag has one. - * Equality on tag keys is structural. */ - private sealed abstract class TagKey { - def name: String - } - - private /*final*/ case class SimpleTagKey(name: String) extends TagKey - private /*final*/ case class SymbolTagKey(name: String, symbol: String) extends TagKey - - /** Something that should not have happened, happened, and Scaladoc should exit. */ - private def oops(msg: String): Nothing = - throw new IllegalArgumentException("program logic: " + msg) - - /** Parses a string containing wiki syntax into a `Comment` object. - * Note that the string is assumed to be clean: - * - Removed Scaladoc start and end markers. - * - Removed start-of-line star and one whitespace afterwards (if present). - * - Removed all end-of-line whitespace. - * - Only `endOfLine` is used to mark line endings. */ - def parseWikiAtSymbol( - entity: Entity, - packages: Map[String, Package], - string: String, - span: Span, - site: Symbol - )(using Context): Body = new WikiParser(entity, packages, string, span, site).document() -} diff --git a/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentRegex.scala b/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentRegex.scala deleted file mode 100644 index faefd19a7c08..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/comment/CommentRegex.scala +++ /dev/null @@ -1,84 +0,0 @@ -package dotty.tools.dottydoc -package model -package comment - -import scala.util.matching.Regex - -object Regexes { - val TrailingWhitespace = """\s+$""".r - - /** The body of a line, dropping the (optional) start star-marker, - * one leading whitespace and all trailing whitespace - */ - val CleanCommentLine = - new Regex("""(?:\s*\*\s?\s?)?(.*)""") - - /** Dangerous HTML tags that should be replaced by something safer, - * such as wiki syntax, or that should be dropped - */ - val DangerousTags = - new Regex("""<(/?(div|ol|ul|li|h[1-6]|p))( [^>]*)?/?>|<!--.*-->""") - - /** Javadoc tags that should be replaced by something useful, such as wiki - * syntax, or that should be dropped. */ - val JavadocTags = - new Regex("""\{\@(code|docRoot|linkplain|link|literal|value)\p{Zs}*([^}]*)\}""") - - /** Maps a javadoc tag to a useful wiki replacement, or an empty string if it cannot be salvaged. */ - def javadocReplacement(mtch: Regex.Match): String = { - mtch.group(1) match { - case "code" => "<code>" + mtch.group(2) + "</code>" - case "docRoot" => "" - case "link" => "`[[" + mtch.group(2) + "]]`" - case "linkplain" => "[[" + mtch.group(2) + "]]" - case "literal" => "`" + mtch.group(2) + "`" - case "value" => "`" + mtch.group(2) + "`" - case _ => "" - } - } - - /** Maps a dangerous HTML tag to a safe wiki replacement, or an empty string - * if it cannot be salvaged. */ - def htmlReplacement(mtch: Regex.Match): String = mtch.group(1) match { - case "p" | "div" => "\n\n" - case "h1" => "\n= " - case "/h1" => " =\n" - case "h2" => "\n== " - case "/h2" => " ==\n" - case "h3" => "\n=== " - case "/h3" => " ===\n" - case "h4" | "h5" | "h6" => "\n==== " - case "/h4" | "/h5" | "/h6" => " ====\n" - case "li" => "\n * - " - case _ => "" - } - - /** Safe HTML tags that can be kept. */ - val SafeTags = - new Regex("""((&\w+;)|(&#\d+;)|(</?(abbr|acronym|address|area|a|bdo|big|blockquote|br|button|b|caption|cite|code|col|colgroup|dd|del|dfn|em|fieldset|form|hr|img|input|ins|i|kbd|label|legend|link|map|object|optgroup|option|param|pre|q|samp|select|small|span|strong|sub|sup|table|tbody|td|textarea|tfoot|th|thead|tr|tt|var)( [^>]*)?/?>))""") - - val safeTagMarker = '\u000E' - val endOfLine = '\u000A' - val endOfText = '\u0003' - - /** A Scaladoc tag not linked to a symbol and not followed by text */ - val SingleTagRegex = - new Regex("""\s*@(\S+)\s*""") - - /** A Scaladoc tag not linked to a symbol. Returns the name of the tag, and the rest of the line. */ - val SimpleTagRegex = - new Regex("""\s*@(\S+)\s+(.*)""") - - /** A Scaladoc tag linked to a symbol. Returns the name of the tag, the name - * of the symbol, and the rest of the line. */ - val SymbolTagRegex = - new Regex("""\s*@(param|tparam|throws|groupdesc|groupname|groupprio)\s+(\S*)\s*(.*)""") - - /** The start of a Scaladoc code block */ - val CodeBlockStartRegex = - new Regex("""(.*?)((?:\{\{\{)|(?:\u000E<pre(?: [^>]*)?>\u000E))(.*)""") - - /** The end of a Scaladoc code block */ - val CodeBlockEndRegex = - new Regex("""(.*?)((?:\}\}\})|(?:\u000E</pre>\u000E))(.*)""") -} diff --git a/doc-tool/src/dotty/tools/dottydoc/model/comment/HtmlParsers.scala b/doc-tool/src/dotty/tools/dottydoc/model/comment/HtmlParsers.scala deleted file mode 100644 index f23b16fa1528..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/comment/HtmlParsers.scala +++ /dev/null @@ -1,154 +0,0 @@ -package dotty.tools -package dottydoc -package model -package comment - -import dotc.core.Contexts.{Context, ctx} -import dotc.util.Spans._ -import dotty.tools.dottydoc.util.syntax._ -import util.MemberLookup - -import com.vladsch.flexmark.util.ast.{ Node => MarkdownNode} -import com.vladsch.flexmark.html.HtmlRenderer -import com.vladsch.flexmark.parser.Parser -import com.vladsch.flexmark.util.sequence.CharSubSequence - -object HtmlParsers { - - implicit class StringToMarkdown(val text: String) extends AnyVal { - def toMarkdown(origin: Entity)(using Context): MarkdownNode = { - import com.vladsch.flexmark.ast.Link - import com.vladsch.flexmark.util.ast.{Visitor, VisitHandler, NodeVisitor } - - - val inlineToHtml = InlineToHtml(origin) - - val node = Parser.builder(staticsite.Site.markdownOptions) - .build.parse(text) - - def isOuter(url: String) = - url.startsWith("http://") || - url.startsWith("https://") || - url.startsWith("ftp://") || - url.startsWith("ftps://") - - def isRelative(url: String) = - url.startsWith("../") || - url.startsWith("./") - - val linkVisitor = new NodeVisitor( - new VisitHandler(classOf[Link], new Visitor[Link] with MemberLookup { - def queryToUrl(title: String, link: String) = makeEntityLink(origin, ctx.docbase.packages, Text(title), link).link match { - case Tooltip(_) => "#" - case LinkToExternal(_, url) => url - case LinkToEntity(t: Entity) => t match { - case e: Entity with Members => inlineToHtml.relativePath(t) - case x => x.parent.fold("#") { xpar => inlineToHtml.relativePath(xpar) } - } - } - - override def visit(link: Link) = { - val linkUrl = link.getUrl.toString - if (!isOuter(linkUrl) && !isRelative(linkUrl)) - link.setUrl(CharSubSequence.of(queryToUrl(link.getTitle.toString, linkUrl))) - } - }) - ) - - linkVisitor.visit(node) - node - } - - def toMarkdownString(origin: Entity)(using Context): String = - toMarkdown(origin).show - } - - implicit class MarkdownToHtml(val markdown: MarkdownNode) extends AnyVal { - def show(using Context): String = - HtmlRenderer.builder(staticsite.Site.markdownOptions).build().render(markdown) - - def shortenAndShow(using Context): String = - (new MarkdownShortener).shorten(markdown).show - } - - implicit class StringToWiki(val text: String) extends AnyVal { - def toWiki(origin: Entity, packages: Map[String, Package], span: Span): Body = - new WikiParser(origin, packages, text, span, origin.symbol).document() - } - - implicit class BodyToHtml(val body: Body) extends AnyVal { - def show(origin: Entity): String = { - val inlineToHtml = InlineToHtml(origin) - - def bodyToHtml(body: Body): String = - (body.blocks map blockToHtml).mkString - - def blockToHtml(block: Block): String = block match { - case Title(in, 1) => s"<h1>${inlineToHtml(in)}</h1>" - case Title(in, 2) => s"<h2>${inlineToHtml(in)}</h2>" - case Title(in, 3) => s"<h3>${inlineToHtml(in)}</h3>" - case Title(in, _) => s"<h4>${inlineToHtml(in)}</h4>" - case Paragraph(in) => s"<p>${inlineToHtml(in)}</p>" - case Code(data) => s"""<pre><code class="scala">$data</code></pre>""" - case UnorderedList(items) => - s"<ul>${listItemsToHtml(items)}</ul>" - case OrderedList(items, listStyle) => - s"<ol class=${listStyle}>${listItemsToHtml(items)}</ol>" - case DefinitionList(items) => - s"<dl>${items map { case (t, d) => s"<dt>${inlineToHtml(t)}</dt><dd>${blockToHtml(d)}</dd>" } }</dl>" - case HorizontalRule() => - "<hr/>" - } - - def listItemsToHtml(items: Seq[Block]) = - items.foldLeft(""){ (list, item) => - item match { - case OrderedList(_, _) | UnorderedList(_) => // html requires sub ULs to be put into the last LI - list + s"<li>${blockToHtml(item)}</li>" - case Paragraph(inl) => - list + s"<li>${inlineToHtml(inl)}</li>" // LIs are blocks, no need to use Ps - case block => - list + s"<li>${blockToHtml(block)}</li>" - } - } - - bodyToHtml(body) - } - } - - case class InlineToHtml(origin: Entity) { - def apply(inl: Inline) = toHtml(inl) - - def relativePath(target: Entity) = - util.traversing.relativePath(origin, target) - - def toHtml(inl: Inline): String = inl match { - case Chain(items) => (items map toHtml).mkString - case Italic(in) => s"<i>${toHtml(in)}</i>" - case Bold(in) => s"<b>${toHtml(in)}</b>" - case Underline(in) => s"<u>${toHtml(in)}</u>" - case Superscript(in) => s"<sup>${toHtml(in)}</sup>" - case Subscript(in) => s"<sub>${toHtml(in) }</sub>" - case Link(raw, title) => s"""<a href=$raw target="_blank">${toHtml(title)}</a>""" - case Monospace(in) => s"<code>${toHtml(in)}</code>" - case Text(text) => text - case Summary(in) => toHtml(in) - case HtmlTag(tag) => tag - case EntityLink(target, link) => enityLinkToHtml(target, link) - } - - def enityLinkToHtml(target: Inline, link: LinkTo) = link match { - case Tooltip(_) => toHtml(target) - case LinkToExternal(n, url) => s"""<a href="$url">$n</a>""" - case LinkToEntity(t: Entity) => t match { - // Entity is a package member - case e: Entity with Members => - s"""<a href="${relativePath(t)}">${toHtml(target)}</a>""" - // Entity is a Val / Def - case x => x.parent.fold(toHtml(target)) { xpar => - s"""<a href="${relativePath(xpar)}#${x.name}">${toHtml(target)}</a>""" - } - } - } - } -} \ No newline at end of file diff --git a/doc-tool/src/dotty/tools/dottydoc/model/comment/MarkdownShortener.scala b/doc-tool/src/dotty/tools/dottydoc/model/comment/MarkdownShortener.scala deleted file mode 100644 index a38454178f75..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/comment/MarkdownShortener.scala +++ /dev/null @@ -1,84 +0,0 @@ -package dotty.tools -package dottydoc -package model -package comment - -/** The `MarkdownShortener` takes a node and *mutates* it and all children so - * that the displayed length of the generated HTML doesn't exceeed `maxLen`. - * This number defaults to 150 characters. - * - * @note calling `shorten` **will** mutate the Markdown AST node. - */ -class MarkdownShortener { - import com.vladsch.flexmark.util.ast._ - import com.vladsch.flexmark.ast._ - - def shorten(node: Node, maxLen: Int = 150): Node = { - var len = 0 - var didUnlink = false - - def count(node: Node, length: => Int, shortenOrUnlink: Int => Unit) = { - val remaining = math.max(maxLen - len, 0) - if (didUnlink || remaining == 0) node.unlink() - else { - if (length <= remaining) len += length - else { - shortenOrUnlink(remaining) - len = maxLen - } - } - } - - val nodeVisitor = new NodeVisitor( - new VisitHandler(classOf[Text], new Visitor[Text] { - override def visit(node: Text) = count( - node, - node.getChars.length, - remaining => node.setChars( - node.getChars.subSequence(0, remaining).trimEnd.append("...") - ) - ) - }), - new VisitHandler(classOf[Code], new Visitor[Code] { - override def visit(node: Code) = count( - node, - node.getText.length, - remaining => node.setText( - node.getText.subSequence(0, remaining).trimEnd.append("...") - ) - ) - }), - new VisitHandler(classOf[Image], new Visitor[Image] { - override def visit(node: Image) = count(node, maxLen, _ => node.unlink()) - }), - new VisitHandler(classOf[FencedCodeBlock], new Visitor[FencedCodeBlock] { - override def visit(node: FencedCodeBlock) = count(node, maxLen, _ => node.unlink()) - }), - new VisitHandler(classOf[BulletListItem], new Visitor[BulletListItem] { - override def visit(node: BulletListItem) = count( - node, - if (didUnlink) maxLen - else node.getSegments.map(_.length).reduceLeft(_ + _), - _ => { - node.unlink() - didUnlink = true // unlink all following bullets - } - ) - }), - new VisitHandler(classOf[OrderedListItem], new Visitor[OrderedListItem] { - override def visit(node: OrderedListItem) = count( - node, - if (didUnlink) maxLen - else node.getSegments.map(_.length).reduceLeft(_ + _), - _ => { - node.unlink() - didUnlink = true // unlink all following bullets - } - ) - }) - ) - - nodeVisitor.visit(node) - node - } -} \ No newline at end of file diff --git a/doc-tool/src/dotty/tools/dottydoc/model/comment/WikiParser.scala b/doc-tool/src/dotty/tools/dottydoc/model/comment/WikiParser.scala deleted file mode 100644 index b0cd50b5db4d..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/comment/WikiParser.scala +++ /dev/null @@ -1,550 +0,0 @@ -package dotty.tools.dottydoc -package model -package comment - -import dotty.tools.dotc.core.Contexts.{Context, ctx} -import dotty.tools.dotc.util.Spans._ -import dotty.tools.dotc.core.Symbols._ -import dotty.tools.dotc.config.Printers.dottydoc -import util.MemberLookup -import scala.collection.mutable - -import Regexes._ -import model.internal._ - -/** Original wikiparser from NSC - * @author Ingo Maier - * @author Manohar Jonnalagedda - * @author Gilles Dubochet - */ -private[comment] final class WikiParser( - entity: Entity, - packages: Map[String, Package], - val buffer: String, - span: Span, - site: Symbol -) extends CharReader(buffer) with MemberLookup { wiki => - var summaryParsed = false - - def document(): Body = { - val blocks = new mutable.ListBuffer[Block] - while (char != endOfText) - blocks += block() - Body(blocks.toList) - } - - /* BLOCKS */ - - /** {{{ block ::= code | title | hrule | listBlock | para }}} */ - def block(): Block = { - if (checkSkipInitWhitespace("{{{")) - code() - else if (checkSkipInitWhitespace('=')) - title() - else if (checkSkipInitWhitespace("----")) - hrule() - else if (checkList) - listBlock() - else { - para() - } - } - - /** listStyle ::= '-' spc | '1.' spc | 'I.' spc | 'i.' spc | 'A.' spc | 'a.' spc - * Characters used to build lists and their constructors */ - protected val listStyles = Map[String, (Seq[Block] => Block)]( - "- " -> ( UnorderedList(_) ), - "1. " -> ( OrderedList(_,"decimal") ), - "I. " -> ( OrderedList(_,"upperRoman") ), - "i. " -> ( OrderedList(_,"lowerRoman") ), - "A. " -> ( OrderedList(_,"upperAlpha") ), - "a. " -> ( OrderedList(_,"lowerAlpha") ) - ) - - /** Checks if the current line is formed with more than one space and one the listStyles */ - def checkList = - (countWhitespace > 0) && (listStyles.keys exists { checkSkipInitWhitespace(_) }) - - /** {{{ - * nListBlock ::= nLine { mListBlock } - * nLine ::= nSpc listStyle para '\n' - * }}} - * Where n and m stand for the number of spaces. When `m > n`, a new list is nested. */ - def listBlock(): Block = { - - /** Consumes one list item block and returns it, or None if the block is - * not a list or a different list. */ - def listLine(indent: Int, style: String): Option[Block] = - if (countWhitespace > indent && checkList) - Some(listBlock()) - else if (countWhitespace != indent || !checkSkipInitWhitespace(style)) - None - else { - jumpWhitespace() - jump(style) - val p = Paragraph(getInline(isInlineEnd = false)) - blockEnded("end of list line ") - Some(p) - } - - /** Consumes all list item blocks (possibly with nested lists) of the - * same list and returns the list block. */ - def listLevel(indent: Int, style: String): Block = { - val lines = mutable.ListBuffer.empty[Block] - var line: Option[Block] = listLine(indent, style) - while (line.isDefined) { - lines += line.get - line = listLine(indent, style) - } - val constructor = listStyles(style) - constructor(lines.toList) - } - - val indent = countWhitespace - val style = (listStyles.keys find { checkSkipInitWhitespace(_) }).getOrElse(listStyles.keys.head) - listLevel(indent, style) - } - - def code(): Block = { - jumpWhitespace() - jump("{{{") - val str = readUntil("}}}") - if (char == endOfText) - reportError(span, "unclosed code block") - else - jump("}}}") - blockEnded("code block") - Code(normalizeIndentation(str)) - } - - /** {{{ title ::= ('=' inline '=' | "==" inline "==" | ...) '\n' }}} */ - def title(): Block = { - jumpWhitespace() - val inLevel = repeatJump('=') - val text = getInline(check("=" * inLevel)) - val outLevel = repeatJump('=', inLevel) - if (inLevel != outLevel) - reportError(span, "unbalanced or unclosed heading") - blockEnded("heading") - Title(text, inLevel) - } - - /** {{{ hrule ::= "----" { '-' } '\n' }}} */ - def hrule(): Block = { - jumpWhitespace() - repeatJump('-') - blockEnded("horizontal rule") - HorizontalRule() - } - - /** {{{ para ::= inline '\n' }}} */ - def para(): Block = { - val p = - if (summaryParsed) - Paragraph(getInline(isInlineEnd = false)) - else { - val s = summary() - val r = - if (checkParaEnded()) List(s) else List(s, getInline(isInlineEnd = false)) - summaryParsed = true - Paragraph(Chain(r)) - } - while (char == endOfLine && char != endOfText) - nextChar() - p - } - - /* INLINES */ - - val OPEN_TAG = "^<([A-Za-z]+)( [^>]*)?(/?)>$".r - val CLOSE_TAG = "^</([A-Za-z]+)>$".r - private def readHTMLFrom(begin: HtmlTag): String = { - val list = mutable.ListBuffer.empty[String] - val stack = mutable.ListBuffer.empty[String] - - begin.close match { - case Some(HtmlTag(CLOSE_TAG(s))) => - stack += s - case _ => - return "" - } - - while { - val str = readUntil { char == safeTagMarker || char == endOfText } - nextChar() - - list += str - - str match { - case OPEN_TAG(s, _, standalone) => { - if (standalone != "/") { - stack += s - } - } - case CLOSE_TAG(s) => { - if (s == stack.last) { - stack.remove(stack.length-1) - } - } - case _ => ; - } - stack.length > 0 && char != endOfText - } do () - - list mkString "" - } - - def getInline(isInlineEnd: => Boolean): Inline = { - - def inline0(): Inline = { - if (char == safeTagMarker) { - val tag = htmlTag() - HtmlTag(tag.data + readHTMLFrom(tag)) - } - else if (check("'''")) bold() - else if (check("''")) italic() - else if (check("`")) monospace() - else if (check("__")) underline() - else if (check("^")) superscript() - else if (check(",,")) subscript() - else if (check("[[")) link() - else { - val str = readUntil { - char == safeTagMarker || - check("''") || - char == '`' || - check("__") || - char == '^' || - check(",,") || - check("[[") || - isInlineEnd || - checkParaEnded() || - char == endOfLine - } - Text(str) - } - } - - val inlines: List[Inline] = { - val iss = mutable.ListBuffer.empty[Inline] - iss += inline0() - while (!isInlineEnd && !checkParaEnded()) { - val skipEndOfLine = if (char == endOfLine) { - nextChar() - true - } else { - false - } - - val current = inline0() - (iss.last, current) match { - case (Text(t1), Text(t2)) if skipEndOfLine => - iss.update(iss.length - 1, Text(t1 + endOfLine + t2)) - case (i1, i2) if skipEndOfLine => - iss ++= List(Text(endOfLine.toString), i2) - case _ => iss += current - } - } - iss.toList - } - - inlines match { - case Nil => Text("") - case i :: Nil => i - case is => Chain(is) - } - - } - - def htmlTag(): HtmlTag = { - jump(safeTagMarker) - val read = readUntil(safeTagMarker) - if (char != endOfText) jump(safeTagMarker) - HtmlTag(read) - } - - def bold(): Inline = { - jump("'''") - val i = getInline(check("'''")) - jump("'''") - Bold(i) - } - - def italic(): Inline = { - jump("''") - val i = getInline(check("''")) - jump("''") - Italic(i) - } - - def monospace(): Inline = { - jump("`") - val i = getInline(check("`")) - jump("`") - Monospace(i) - } - - def underline(): Inline = { - jump("__") - val i = getInline(check("__")) - jump("__") - Underline(i) - } - - def superscript(): Inline = { - jump("^") - val i = getInline(check("^")) - if (jump("^")) { - Superscript(i) - } else { - Chain(Seq(Text("^"), i)) - } - } - - def subscript(): Inline = { - jump(",,") - val i = getInline(check(",,")) - jump(",,") - Subscript(i) - } - - def summary(): Inline = { - val i = getInline(checkSentenceEnded()) - Summary( - if (jump(".")) - Chain(List(i, Text("."))) - else - i - ) - } - - def link(): Inline = { - val SchemeUri = """([a-z]+:.*)""".r - jump("[[") - val parens = 2 + repeatJump('[') - val stop = "]" * parens - val target = readUntil { check(stop) || isWhitespaceOrNewLine(char) } - val title = - if (!check(stop)) Some({ - jumpWhitespaceOrNewLine() - getInline(check(stop)) - }) - else None - jump(stop) - - (target, title) match { - case (SchemeUri(uri), optTitle) => - Link(uri, optTitle getOrElse Text(uri)) - case (qualName, optTitle) => - makeEntityLink(entity, packages, optTitle getOrElse Text(target), target) - } - } - - /* UTILITY */ - - /** {{{ eol ::= { whitespace } '\n' }}} */ - def blockEnded(blockType: String): Unit = { - if (char != endOfLine && char != endOfText) { - reportError(span, "no additional content on same line after " + blockType) - jumpUntil(endOfLine) - } - while (char == endOfLine) - nextChar() - } - - /** - * Eliminates the (common) leading spaces in all lines, based on the first line - * For indented pieces of code, it reduces the indent to the least whitespace prefix: - * {{{ - * indented example - * another indented line - * if (condition) - * then do something; - * ^ this is the least whitespace prefix - * }}} - */ - def normalizeIndentation(_code: String): String = { - - val code = _code.replaceAll("\\s+$", "").dropWhile(_ == '\n') // right-trim + remove all leading '\n' - val lines = code.split("\n") - - // maxSkip - size of the longest common whitespace prefix of non-empty lines - val nonEmptyLines = lines.filter(_.trim.nonEmpty) - val maxSkip = if (nonEmptyLines.isEmpty) 0 else nonEmptyLines.map(line => line.takeWhile(_ == ' ').length).min - - // remove common whitespace prefix - lines.map(line => if (line.trim.nonEmpty) line.substring(maxSkip) else line).mkString("\n") - } - - def checkParaEnded(): Boolean = { - (char == endOfText) || - ((char == endOfLine) && { - val poff = offset - nextChar() // read EOL - val ok = { - checkSkipInitWhitespace(endOfLine) || - checkSkipInitWhitespace('=') || - checkSkipInitWhitespace("{{{") || - checkList || - checkSkipInitWhitespace('\u003D') - } - offset = poff - ok - }) - } - - def checkSentenceEnded(): Boolean = { - (char == '.') && { - val poff = offset - nextChar() // read '.' - val ok = char == endOfText || char == endOfLine || isWhitespace(char) - offset = poff - ok - } - } - - def reportError(span: Span, message: String) = - dottydoc.println(s"$span: $message") -} - -sealed class CharReader(buffer: String) { reader => - - var offset: Int = 0 - def char: Char = - if (offset >= buffer.length) endOfText else buffer charAt offset - - final def nextChar() = - offset += 1 - - final def check(chars: String): Boolean = { - val poff = offset - val ok = jump(chars) - offset = poff - ok - } - - def checkSkipInitWhitespace(c: Char): Boolean = { - val poff = offset - jumpWhitespace() - val ok = jump(c) - offset = poff - ok - } - - def checkSkipInitWhitespace(chars: String): Boolean = { - val poff = offset - jumpWhitespace() - val (ok0, chars0) = - if (chars.charAt(0) == ' ') - (offset > poff, chars substring 1) - else - (true, chars) - val ok = ok0 && jump(chars0) - offset = poff - ok - } - - def countWhitespace: Int = { - var count = 0 - val poff = offset - while (isWhitespace(char) && char != endOfText) { - nextChar() - count += 1 - } - offset = poff - count - } - - /* Jumpers */ - - /** Jumps a character and consumes it - * @return true only if the correct character has been jumped */ - final def jump(ch: Char): Boolean = { - if (char == ch) { - nextChar() - true - } - else false - } - - /** Jumps all the characters in chars, consuming them in the process. - * @return true only if the correct characters have been jumped - */ - final def jump(chars: String): Boolean = { - var index = 0 - while (index < chars.length && char == chars.charAt(index) && char != endOfText) { - nextChar() - index += 1 - } - index == chars.length - } - - final def repeatJump(c: Char, max: Int = Int.MaxValue): Int = { - var count = 0 - while (jump(c) && count < max) - count += 1 - count - } - - final def jumpUntil(ch: Char): Int = { - var count = 0 - while (char != ch && char != endOfText) { - nextChar() - count += 1 - } - count - } - - final def jumpUntil(pred: => Boolean): Int = { - var count = 0 - while (!pred && char != endOfText) { - nextChar() - count += 1 - } - count - } - - def jumpWhitespace() = jumpUntil(!isWhitespace(char)) - - def jumpWhitespaceOrNewLine() = jumpUntil(!isWhitespaceOrNewLine(char)) - - /* Readers */ - final def readUntil(c: Char): String = { - withRead { - while (char != c && char != endOfText) { - nextChar() - } - } - } - - final def readUntil(chars: String): String = { - assert(chars.length > 0) - withRead { - val c = chars.charAt(0) - while (!check(chars) && char != endOfText) { - nextChar() - while (char != c && char != endOfText) - nextChar() - } - } - } - - final def readUntil(pred: => Boolean): String = { - withRead { - while (char != endOfText && !pred) { - nextChar() - } - } - } - - private def withRead(read: => Unit): String = { - val start = offset - read - buffer.substring(start, offset) - } - - /* Chars classes */ - def isWhitespace(c: Char) = c == ' ' || c == '\t' - - def isWhitespaceOrNewLine(c: Char) = isWhitespace(c) || c == '\n' -} diff --git a/doc-tool/src/dotty/tools/dottydoc/model/entities.scala b/doc-tool/src/dotty/tools/dottydoc/model/entities.scala deleted file mode 100644 index 71e96ca165c3..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/entities.scala +++ /dev/null @@ -1,127 +0,0 @@ -package dotty.tools.dottydoc -package model - -import comment._ -import references._ -import dotty.tools.dotc.core.Symbols.Symbol - -trait Entity { entity => - def symbol: Symbol - - def name: String - - /** Path from root, i.e. `scala.Option$` */ - def path: List[String] - - def comment: Option[Comment] - - def kind: String - - def parent: Option[Entity] - - def annotations: List[String] - - def signature: String = - entity.name + (entity match { - case o: Object => "$" - case d: Def => d.paramLists.mkString - case _ => "" - }) - - def children: List[Entity with Members] = entity match { - case e: Entity with Members => - e.members.collect { case e: Entity with Members if e.kind != "package" => e } - case _ => Nil - } - - /** All parents from package level i.e. Package to Object to Member etc */ - def parents: List[Entity] = this :: this.parents -} - -trait SuperTypes { - def superTypes: List[MaterializableLink] -} - -trait Members { - def members: List[Entity] - - def hasVisibleMembers: Boolean = members.exists { - case e: Entity with Modifiers => !(e.isPrivate || e.isProtected) - case e => true - } -} - -trait Modifiers { - def modifiers: List[String] - - def isPrivate: Boolean = - modifiers.contains("private") - - def isProtected: Boolean = - modifiers.contains("protected") -} - -trait TypeParams { - def typeParams: List[String] -} - -trait ReturnValue { - def returnValue: Reference -} - -trait ParamList { - def list: List[NamedReference] - def isImplicit: Boolean - - override def toString = list.map(_.title).mkString("(", ",", ")") -} - -trait Constructors { - def constructors: List[List[ParamList]] -} - -trait Companion extends Entity { - def hasCompanion: Boolean = companionPath ne Nil - - def companionPath: List[String] - - def companionPath_=(xs: List[String]): Unit -} - -trait ImplicitlyAddedEntity extends Entity { - def implicitlyAddedFrom: Option[Reference] -} - -trait Package extends Entity with Members with SuperTypes { - val kind = "package" -} - -trait TypeAlias extends Entity with Modifiers with TypeParams { - val kind = "type" - def alias: Option[Reference] - def isAbstract: Boolean = !alias.isDefined -} - -trait Class extends Entity with Modifiers with TypeParams with Constructors with SuperTypes with Members with Companion { - val kind = "class" -} - -trait CaseClass extends Entity with Modifiers with TypeParams with Constructors with SuperTypes with Members with Companion { - override val kind = "case class" -} - -trait Trait extends Entity with Modifiers with TypeParams with SuperTypes with Members with Companion { - def traitParams: List[ParamList] - override val kind = "trait" -} - -trait Object extends Entity with Modifiers with SuperTypes with Members with Companion { - override val kind = "object" -} - -trait Def extends Entity with Modifiers with TypeParams with ReturnValue with ImplicitlyAddedEntity { - val kind = "def" - def paramLists: List[ParamList] -} - -trait Val extends Entity with Modifiers with ReturnValue with ImplicitlyAddedEntity diff --git a/doc-tool/src/dotty/tools/dottydoc/model/factories.scala b/doc-tool/src/dotty/tools/dottydoc/model/factories.scala deleted file mode 100644 index ef35cd440a7c..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/factories.scala +++ /dev/null @@ -1,218 +0,0 @@ -package dotty.tools.dottydoc -package model - -import references._ -import dotty.tools.dotc -import dotc.core.Types -import Types._ -import dotc.core.Contexts.{Context, ctx} -import dotc.core.Symbols.{ Symbol, ClassSymbol } -import dotty.tools.dotc.core.SymDenotations._ - -import scala.annotation.tailrec - - -object factories { - import dotty.tools.dotc.ast.tpd._ - import dotty.tools.dottydoc.model.internal.ParamListImpl - import dotc.core.Flags._ - - type TypeTree = dotty.tools.dotc.ast.Trees.Tree[Type] - - def flags(t: Tree)(using Context): List[String] = { - val pw = t.symbol.privateWithin - val pwStr = if (pw.exists) pw.name.show else "" - (t.symbol.flags & (if (t.symbol.isType) TypeSourceModifierFlags else TermSourceModifierFlags)) - .flagStrings(pwStr).toList - .filter(_ != "<trait>") - .filter(_ != "interface") - .filter(_ != "case") - } - - def path(sym: Symbol)(using Context): List[String] = { - @tailrec def go(sym: Symbol, acc: List[String]): List[String] = - if (sym.isRoot) - acc - else - go(sym.owner, sym.name.mangledString :: acc) - go(sym, Nil) - } - - def annotations(sym: Symbol)(using Context): List[String] = - sym.annotations.collect { - case ann if ann.symbol != ctx.definitions.SourceFileAnnot => ann.symbol.showFullName - } - - private val product = """Product[1-9][0-9]*""".r - - def alias(t: Type)(using Context): Option[Reference] = { - val defn = ctx.definitions - t match { - case TypeBounds(low, high) if (low eq defn.NothingType) && (high eq defn.AnyType) => - None - case t => Some(returnType(t)) - } - } - - def returnType(t: Type)(using Context): Reference = { - val defn = ctx.definitions - - def typeRef(name: String, query: String = "", params: List[Reference] = Nil) = { - val realQuery = if (query != "") query else name - TypeReference(name, UnsetLink(name, realQuery), params) - } - - def expandTpe(t: Type, params: List[Reference] = Nil): Reference = t match { - case AppliedType(tycon, args) => { - val cls = tycon.typeSymbol - - if (defn.isFunctionClass(cls)) - FunctionReference(args.init.map(expandTpe(_, Nil)), expandTpe(args.last), defn.isContextFunctionClass(cls)) - else if (defn.isTupleClass(cls)) - TupleReference(args.map(expandTpe(_, Nil))) - else { - val query = cls.showFullName - val name = cls.name.show - typeRef(name, query, params = args.map(expandTpe(_, Nil))) - } - } - - case t: TypeRef => { - val cls = t.typeSymbol - typeRef(cls.name.show.split("\\$\\$").last, query = cls.showFullName, params = params) - } - - case TypeBounds(lo, hi) => - BoundsReference(expandTpe(lo), expandTpe(hi)) - - case t: TypeParamRef => - typeRef(t.paramName.show, params = params) - - case ExprType(tpe) => - expandTpe(tpe) - - case t: ThisType => - expandTpe(t.underlying) - - case AnnotatedType(t, _) => - expandTpe(t) - - case t: MethodType => - expandTpe(t.finalResultType) - - case t: TermRef => { - /** A `TermRef` appears in the return type in e.g: - * ``` - * def id[T](t: T): t.type = t - * ``` - */ - typeRef(t.name.show + ".type", params = params) - } - - case ci: ClassInfo => - typeRef(ci.cls.name.show, query = ci.typeSymbol.showFullName) - - case tl: TypeLambda => - expandTpe(tl.resType) - - case OrType(left, right) => - OrTypeReference(expandTpe(left), expandTpe(right)) - - case AndType(left, right) => - AndTypeReference(expandTpe(left), expandTpe(right)) - - case c: ConstantType => - ConstantReference(c.value.show) - - case ref @ RefinedType(parent, rn, info) => - expandTpe(parent) //FIXME: will be a refined HK, aka class Foo[X] { def bar: List[X] } or similar - - case tp: LazyRef => - expandTpe(tp.ref) - - case MatchType(bound, scrutinee, cases) => - // See #6295 - ConstantReference("FIXME: MatchType support") - } - - expandTpe(t) - } - - def typeParams(sym: Symbol)(using Context): List[String] = - sym.info match { - case pt: TypeLambda => // TODO: not sure if this case is needed anymore - pt.paramNames.map(_.show.split("\\$").last) - case ClassInfo(_, _, _, decls, _) => - decls.iterator - .filter(_.flags is TypeParam) - .map { tp => - val prefix = - if (tp.flags is Covariant) "+" - else if (tp.flags is Contravariant) "-" - else "" - prefix + tp.name.show.split("\\$").last - } - .toList - case tp: Types.TypeAlias => - typeParams(tp.alias.typeSymbol) - case _ => - Nil - } - - def constructors(sym: Symbol)(using Context): List[List[ParamList]] = sym match { - case sym: ClassSymbol => - paramLists(sym.primaryConstructor.info) :: Nil - case _ => Nil - } - - def traitParameters(sym: Symbol)(using Context): List[ParamList] = - constructors(sym).head - - def paramLists(tpe: Type)(using Context): List[ParamList] = tpe match { - case pt: TypeLambda => - paramLists(pt.resultType) - - case mt: MethodType => - ParamListImpl(mt.paramNames.zip(mt.paramInfos).map { case (name, tpe) => - NamedReference( - name.decode.toString, - returnType(tpe), - isByName = tpe.isInstanceOf[ExprType], - isRepeated = tpe.isRepeatedParam - ) - }, mt.isImplicitMethod) :: paramLists(mt.resultType) - - case mp: TermParamRef => - paramLists(mp.underlying) - - case annot: AnnotatedType => - paramLists(annot.parent) - - case _ => - Nil // return types should not be in the paramlist - } - - def superTypes(t: Tree)(using Context): List[MaterializableLink] = t.symbol.denot match { - case cd: ClassDenotation => - def isJavaLangObject(prefix: Type): Boolean = - prefix match { - case TypeRef(ThisType(TypeRef(NoPrefix, outerName)), innerName) => - outerName.toString == "lang" && innerName.toString == "Object" - case _ => false - } - - def isProductWithArity(prefix: Type): Boolean = prefix match { - case TypeRef(TermRef(TermRef(NoPrefix, root), scala), prod) => - root.toString == "_root_" && - scala.toString == "scala" && - product.findFirstIn(prod.toString).isDefined - case _ => false - } - - cd.classParents.map(_.typeConstructor).collect { - case t: TypeRef if !isJavaLangObject(t) && !isProductWithArity(t) => - UnsetLink(t.name.toString, path(t.symbol).mkString(".")) - } - case _ => Nil - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/model/internal.scala b/doc-tool/src/dotty/tools/dottydoc/model/internal.scala deleted file mode 100644 index ebf9ce057b18..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/internal.scala +++ /dev/null @@ -1,130 +0,0 @@ -package dotty.tools.dottydoc -package model - -import comment.Comment -import references._ -import dotty.tools.dotc.core.Symbols.{ Symbol, NoSymbol } - -object internal { - - final case class PackageImpl( - var symbol: Symbol, - var annotations: List[String], - var name: String, - var members: List[Entity], - var path: List[String], - var superTypes: List[MaterializableLink] = Nil, - var comment: Option[Comment] = None, - var parent: Option[Entity] = None - ) extends Package - - object EmptyPackage { - def apply(path: List[String], name: String): PackageImpl = { - PackageImpl(NoSymbol, Nil, name, Nil, path) - } - } - - final case class TypeAliasImpl ( - symbol: Symbol, - annotations: List[String], - modifiers: List[String], - name: String, - path: List[String], - alias: Option[Reference], - typeParams: List[String] = Nil, - var comment: Option[Comment] = None, - var parent: Option[Entity] = None - ) extends TypeAlias - - final case class ClassImpl( - symbol: Symbol, - annotations: List[String], - name: String, - members: List[Entity], - modifiers: List[String], - path: List[String], - typeParams: List[String] = Nil, - constructors: List[List[ParamList]] = Nil, - superTypes: List[MaterializableLink] = Nil, - var comment: Option[Comment] = None, - var companionPath: List[String] = Nil, - var parent: Option[Entity] = None - ) extends Class - - final case class CaseClassImpl( - symbol: Symbol, - annotations: List[String], - name: String, - members: List[Entity], - modifiers: List[String], - path: List[String], - typeParams: List[String] = Nil, - constructors: List[List[ParamList]] = Nil, - superTypes: List[MaterializableLink] = Nil, - var comment: Option[Comment] = None, - var companionPath: List[String] = Nil, - var parent: Option[Entity] = None - ) extends CaseClass - - final case class TraitImpl( - symbol: Symbol, - annotations: List[String], - name: String, - members: List[Entity], - modifiers: List[String], - path: List[String], - typeParams: List[String] = Nil, - traitParams: List[ParamList] = Nil, - superTypes: List[MaterializableLink] = Nil, - var comment: Option[Comment] = None, - var companionPath: List[String] = Nil, - var parent: Option[Entity] = None - ) extends Trait - - final case class ObjectImpl( - symbol: Symbol, - annotations: List[String], - name: String, - members: List[Entity], - private val mods: List[String], - path: List[String], - superTypes: List[MaterializableLink] = Nil, - var comment: Option[Comment] = None, - var companionPath: List[String] = Nil, - var parent: Option[Entity] = None - ) extends Object { - def modifiers: List[String] = mods.filterNot(_ == "final") - } - - final case class DefImpl( - symbol: Symbol, - annotations: List[String], - name: String, - modifiers: List[String], - path: List[String], - returnValue: Reference, - typeParams: List[String] = Nil, - paramLists: List[ParamList] = Nil, - var comment: Option[Comment] = None, - implicitlyAddedFrom: Option[Reference] = None, - var parent: Option[Entity] = None - ) extends Def - - final case class ValImpl( - symbol: Symbol, - annotations: List[String], - name: String, - modifiers: List[String], - path: List[String], - returnValue: Reference, - kind: String, - var comment: Option[Comment] = None, - implicitlyAddedFrom: Option[Reference] = None, - var parent: Option[Entity] = None - ) extends Val - - final case class ParamListImpl( - list: List[NamedReference], - isImplicit: Boolean - ) extends ParamList -} diff --git a/doc-tool/src/dotty/tools/dottydoc/model/references.scala b/doc-tool/src/dotty/tools/dottydoc/model/references.scala deleted file mode 100644 index d34b09490bc0..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/model/references.scala +++ /dev/null @@ -1,30 +0,0 @@ -package dotty.tools.dottydoc -package model - -object references { - sealed trait Reference - final case class TypeReference(title: String, tpeLink: MaterializableLink, paramLinks: List[Reference]) extends Reference - final case class OrTypeReference(left: Reference, right: Reference) extends Reference - final case class AndTypeReference(left: Reference, right: Reference) extends Reference - final case class FunctionReference(args: List[Reference], returnValue: Reference, isImplicit: Boolean) extends Reference - final case class TupleReference(args: List[Reference]) extends Reference - final case class BoundsReference(low: Reference, high: Reference) extends Reference - final case class NamedReference(title: String, ref: Reference, isByName: Boolean = false, isRepeated: Boolean = false) extends Reference - final case class ConstantReference(title: String) extends Reference - case object EmptyReference extends Reference - - /** Use MaterializableLink for entities that need be picklable */ - sealed trait MaterializableLink { def title: String } - final case class UnsetLink(title: String, query: String) extends MaterializableLink - final case class MaterializedLink(title: String, target: String) extends MaterializableLink { - def this(title: String, target: Entity) = this(title, target match { - case target: Package => - target.path.mkString("/") + "/index.html" - case _: TypeAlias | _: Def | _: Val => - target.parent.map(_.path.mkString("/")).getOrElse("") + ".html#" + target.signature - case _ => - target.path.mkString("/") + ".html" - }) - } - final case class NoLink(title: String, target: String) extends MaterializableLink -} diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/BlogPost.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/BlogPost.scala deleted file mode 100644 index deadb7825241..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/BlogPost.scala +++ /dev/null @@ -1,64 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import java.io.{ File => JFile } -import java.util.{ List => JList, Map => JMap } - -import dotc.core.Contexts.{Context, ctx} -import util.syntax._ - -import MapOperations._ - -/** - * A `BlogPost` represents the parsed posts from `./blog/_posts/` - * each post must be named according to the format - * `YYYY-MM-DD-title.{md,html}` - */ -class BlogPost( - val title: String, - val url: String, - val date: String, - val content: String, - firstParagraph: String, - val excerpt_separator: Option[String], - val categories: JList[String] -) { - import scala.collection.JavaConverters._ - lazy val excerpt: String = excerpt_separator match { - case Some(str) => content.split(str).head - case _ => firstParagraph - } - - lazy val toMap: JMap[String, AnyRef] = Map( - "title" -> title, - "date" -> date, - "url" -> url, - "excerpt" -> excerpt, - "excerpt_separator" -> excerpt_separator.getOrElse(""), - "content" -> content, - "categories" -> categories - ).asJava -} - -object BlogPost { - val extract = """(\d\d\d\d)-(\d\d)-(\d\d)-(.*)\.(md|html)""".r - def apply(file: JFile, page: Page)(using Context): Option[BlogPost] = { - def report(key: String, fallback: String = "") = { - ctx.docbase.error(s"couldn't find page.$key in ${file.getName}") - fallback - } - - // Relying on the person using this class to pass a valid `file` - val extract(year, month, day, name, _) = file.getName - val title = page.yaml.getString("title").getOrElse(report("title", name)) - val url = page.yaml.getString("url").getOrElse(report("url")) - val date = page.yaml.getString("date").getOrElse(s"$year-$month-$day 00:00:00") - val excerptSep = page.yaml.getString("excerpt_separator") - val categories = page.yaml.list("categories") - - page.html.map { html => - new BlogPost(title, url, date, html, page.firstParagraph, excerptSep, categories) - } - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala deleted file mode 100644 index c88997c42c58..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala +++ /dev/null @@ -1,132 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import model.{Entity, Package} - -import java.util.{HashMap, List => JList, Map => JMap} -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter -import scala.collection.JavaConverters._ - -case class DefaultParams( - docs: JList[_], - docsFlattened: JList[_], - originalDocs: Map[String, Package], - page: PageInfo, - site: SiteInfo, - sidebar: Sidebar, - entity: Option[Entity] = None -) { - import model.JavaConverters._ - - def toMap: Map[String, AnyRef] = { - val base = Map( - "docs" -> docs, - - "searchableDocs" -> docsFlattened, - - "originalDocs" -> originalDocs, - - "page" -> Map( - "url" -> page.url, - "date" -> page.date, - "path" -> page.path - ), - - "site" -> Map( - "baseurl" -> site.baseurl, - "posts" -> site.posts.map(_.toMap), - "project" -> site.projectTitle, - "version" -> site.projectVersion, - "projectUrl" -> site.projectUrl.orNull, - "logo" -> site.projectLogo.orNull, - "root" -> site.root - ).asJava, - - "sidebar" -> sidebar.toMap - ) - val entityMap = entity match { - case None => Map.empty - case Some(entity) => Map( - "entity" -> entity.asJava - ) - } - base ++ entityMap - } - - def withPosts(posts: Array[BlogPost]): DefaultParams = - copy(site = SiteInfo( - site.baseurl, site.projectTitle, site.projectVersion, site.projectUrl, site.projectLogo, - posts, site.root)) - - def withUrl(url: String): DefaultParams = - copy(page = PageInfo(url)) - - def withEntity(e: Option[model.Entity]) = copy(entity = e) - - def withDate(d: String) = copy(page = PageInfo(page.url, d)) -} - -case class PageInfo(url: String, date: String = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")).toString ) { - val path: Array[String] = url.split('/').drop(1) -} - -case class SiteInfo( - baseurl: String, - projectTitle: String, - projectVersion: String, - projectUrl: Option[String], - projectLogo: Option[String], - posts: Array[BlogPost], - root: String -) - -case class Sidebar(titles: List[Title]) { - import model.JavaConverters._ - def toMap: JMap[String, _] = - Map("titles" -> titles.map(_.toMap).asJava).asJava -} - -object Sidebar { - def apply(map: HashMap[String, AnyRef]): Option[Sidebar] = Option(map.get("sidebar")).map { - case list: JList[JMap[String, AnyRef]] @unchecked if !list.isEmpty => - new Sidebar(list.asScala.map(Title.apply).flatten.toList) - case _ => Sidebar.empty - } - - def empty: Sidebar = Sidebar(Nil) -} - -case class Title(title: String, url: Option[String], subsection: List[Title], description: Option[String]) { - def toMap: JMap[String, _] = Map( - "title" -> title, - "url" -> url.orNull, // ugh, Java - "subsection" -> subsection.map(_.toMap).asJava, - "description" -> description.orNull - ).asJava -} - -object Title { - def apply(map: JMap[String, AnyRef]): Option[Title] = { - val title = Option(map.get("title")).collect { - case s: String => s - } - val url = Option(map.get("url")).collect { - case s: String => s - } - - val description = Option(map.get("description")).collect { - case s: String => s - } - - val subsection = Option(map.get("subsection")).collect { - case xs: JList[JMap[String, AnyRef]] @unchecked => - xs.asScala.map(Title.apply).toList.flatten - }.getOrElse(Nil) - - title.map { - case title: String => Title(title, url, subsection, description) - } - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/MapOperations.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/MapOperations.scala deleted file mode 100644 index 9dd88cb67508..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/MapOperations.scala +++ /dev/null @@ -1,25 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import java.util.{ List => JList, Map => JMap } - -/** A simple wrapper for Maps to impose a certain degree of typesafety */ -object MapOperations { - implicit class SaferMap(val map: Map[String, AnyRef]) extends AnyVal { - // `AnyRef` is actually `String | JList[String]` - def getString(str: String): Option[String] = map.get(str).flatMap { - case res: String => Some(res) - case _ => None - } - - def getList(str: String): Option[JList[String]] = map.get(str).flatMap { - case res: JList[String] @unchecked => Some(res) - case _ => None - } - - def string(str: String): String = getString(str).getOrElse("") - def list(str: String): JList[String] = getList(str).getOrElse(new java.util.ArrayList[String]) - } -} - diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/MarkdownCodeBlockVisitor.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/MarkdownCodeBlockVisitor.scala deleted file mode 100644 index 04995a8ec8d4..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/MarkdownCodeBlockVisitor.scala +++ /dev/null @@ -1,20 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import com.vladsch.flexmark.util.ast._ -import com.vladsch.flexmark.ast._ -import com.vladsch.flexmark.util.sequence.CharSubSequence - -object MarkdownCodeBlockVisitor { - def apply(node: Node): Unit = - new NodeVisitor( - new VisitHandler(classOf[FencedCodeBlock], new Visitor[FencedCodeBlock] { - override def visit(node: FencedCodeBlock): Unit = { - if (node.getOpeningMarker.length == 3) - node.setOpeningMarker(CharSubSequence.of("```scala")) - } - }) - ) - .visit(node) -} \ No newline at end of file diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/MarkdownLinkVisitor.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/MarkdownLinkVisitor.scala deleted file mode 100644 index dc6d7d075eeb..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/MarkdownLinkVisitor.scala +++ /dev/null @@ -1,46 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import com.vladsch.flexmark.ast._ -import com.vladsch.flexmark.util.ast._ -import com.vladsch.flexmark.util.sequence.{BasedSequence, CharSubSequence} -import model.{Def, Package, TypeAlias, Val} -import dottydoc.util.MemberLookup - -object MarkdownLinkVisitor { - private val EntityLink = """([^\.]+)(\.[^\.]+)*""".r - def apply(node: Node, docs: Map[String, Package], params: Map[String, AnyRef]): Unit = - new NodeVisitor( - new VisitHandler(classOf[Link], new Visitor[Link] with MemberLookup { - override def visit(node: Link): Unit = { - def isExternal(url: BasedSequence) = - url.startsWith("http") || url.startsWith("https") - - val url = node.getUrl - if (url.endsWith(".md") && !isExternal(url)) node.setUrl { - url.subSequence(0, url.lastIndexOf('.')).append(".html") - } - else if (EntityLink.unapplySeq(url.toString).isDefined) { - lookup(None, docs, url.toString).foreach { ent => - val (path, suffix) = ent match { - case ent: Val => (ent.path.dropRight(1), ".html#" + ent.signature) - case ent: Def => (ent.path.dropRight(1), ".html#" + ent.signature) - case ent: TypeAlias => (ent.path.dropRight(1), ".html#" + ent.signature) - case ent: Package => (ent.path, "/index.html") - case ent => (ent.path, ".html") - } - - params("site") match { - case map: java.util.Map[String, String] @unchecked => node.setUrl { - CharSubSequence.of(path.mkString(map.get("baseurl") + "/api/", "/", suffix)) - } - case _ => () - } - } - } - } - }) - ) - .visit(node) -} \ No newline at end of file diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/Page.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/Page.scala deleted file mode 100644 index 78871c888a3b..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/Page.scala +++ /dev/null @@ -1,180 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import model.Package - -import dotc.util.SourceFile -import dotc.core.Contexts.{Context, ctx} -import io.VirtualFile - -import com.vladsch.flexmark.html.HtmlRenderer -import com.vladsch.flexmark.parser.Parser -import com.vladsch.flexmark.ext.yaml.front.matter.AbstractYamlFrontMatterVisitor - -import java.util.{ Map => JMap, List => JList } -import java.io.{ OutputStreamWriter, BufferedWriter } -import java.nio.charset.StandardCharsets - -import scala.io.Codec - -/** When the YAML front matter cannot be parsed, this exception is thrown */ -case class IllegalFrontMatter(message: String) extends Exception(message) - -trait Page { - import scala.collection.JavaConverters._ - - /** Full map of includes, from name to contents */ - def includes: Map[String, Include] - - /** `SourceFile` with contents of page */ - def sourceFile: SourceFile - - /** String containing full unexpanded content of page */ - final lazy val content: String = new String(sourceFile.content) - - /** Parameters to page */ - def params: Map[String, AnyRef] - - /** Path to template */ - def path: String - - /** YAML front matter from the top of the file */ - def yaml(using Context): Map[String, AnyRef] = { - if (_yaml eq null) initFields - _yaml - } - - /** HTML generated from page */ - def html(using Context): Option[String] = { - if (_html eq null) initFields - _html - } - - /** First paragraph of page extracted from rendered HTML */ - def firstParagraph(using Context): String = { - if (_html eq null) initFields - - _html.map { _html => - val sb = new StringBuilder - var pos = 0 - // to handle nested paragraphs in non markdown code - var open = 0 - - while (pos < _html.length - 4) { - val str = _html.substring(pos, pos + 4) - val lstr = str.toLowerCase - sb append str.head - - pos += 1 - if (lstr.contains("<p>")) - open += 1 - else if (lstr == "</p>") { - open -= 1 - if (open == 0) { - pos = Int.MaxValue - sb append "/p>" - } - } - } - - sb.toString - } - .getOrElse("") - } - - protected def virtualFile(subSource: String): SourceFile = { - val virtualFile = new VirtualFile(path, path) - val writer = new BufferedWriter(new OutputStreamWriter(virtualFile.output, StandardCharsets.UTF_8.name)) - writer.write(subSource) - writer.close() - - new SourceFile(virtualFile, Codec.UTF8) - } - - protected[this] var _yaml: Map[String, AnyRef /* String | JList[String] */] = _ - protected[this] var _html: Option[String] = _ - protected[this] def initFields(using Context) = { - val md = Parser.builder(Site.markdownOptions).build.parse(content) - val yamlCollector = new AbstractYamlFrontMatterVisitor() - yamlCollector.visit(md) - - _yaml = updatedYaml { - yamlCollector - .getData().asScala - .toMap - .transform { - case (_, xs) if xs.size == 1 => - val str = xs.get(0) - if (str.length > 0 && str.head == '"' && str.last == '"') - str.substring(1, str.length - 1) - else str - case (_, xs) => xs - } - } - - // YAML must start with "---" and end in either "---" or "..." - val withoutYaml = virtualFile( - if (content.startsWith("---\n")) { - val str = - content.linesIterator - .drop(1) - .dropWhile(line => line != "---" && line != "...") - .drop(1).mkString("\n") - - if (str.isEmpty) throw IllegalFrontMatter(content) - else str - } - else content - ) - - // make accessible via "{{ page.title }}" in templates - val page = Map("page" -> _yaml.asJava) - _html = LiquidTemplate(path, withoutYaml).render(params ++ page, includes) - } - - /** Takes "page" from `params` map in case this is a second expansion, and - * removes "layout" from the parameters if it exists. We don't want to - * preserve the layout from the previously expanded template - */ - private def updatedYaml(newYaml: Map[String, AnyRef]): Map[String, AnyRef] = - params - .get("page") - .flatMap { - case page: Map[String, AnyRef] @unchecked => - Some(page - "layout" ++ newYaml) - case _ => None - } - .getOrElse(newYaml) -} - -class HtmlPage( - val path: String, - val sourceFile: SourceFile, - val params: Map[String, AnyRef], - val includes: Map[String, Include] -) extends Page - -class MarkdownPage( - val path: String, - val sourceFile: SourceFile, - val params: Map[String, AnyRef], - val includes: Map[String, Include], - docs: Map[String, Package] -) extends Page { - - override protected[this] def initFields(using Context) = { - super.initFields - _html = _html.map { _html => - val md = Parser.builder(Site.markdownOptions).build.parse(_html) - // fix markdown linking - MarkdownLinkVisitor(md, docs, params) - MarkdownCodeBlockVisitor(md) - HtmlRenderer - .builder(Site.markdownOptions) - .escapeHtml(false) - .build() - .render(md) - } - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/ResourceFinder.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/ResourceFinder.scala deleted file mode 100644 index 630b26e61dcc..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/ResourceFinder.scala +++ /dev/null @@ -1,16 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -trait ResourceFinder { - /** If, for some reason, the supplied default files cannot be found - this - * exception will be thrown in `layouts`. - */ - /*final*/ case class ResourceNotFoundException(message: String) extends Exception(message) - - protected def getResource(r: String): String = - Option(getClass.getResourceAsStream(r)) - .map(scala.io.Source.fromInputStream(_)(scala.io.Codec.UTF8)) - .map(_.mkString) - .getOrElse(throw ResourceNotFoundException(r)) -} diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala deleted file mode 100644 index 5be2a3621c57..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala +++ /dev/null @@ -1,456 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import java.nio.file.{ Files, FileSystems } -import java.nio.file.StandardCopyOption.REPLACE_EXISTING -import java.io.{ File => JFile, OutputStreamWriter, BufferedWriter, ByteArrayInputStream } -import java.util.{ List => JList, Arrays } -import java.nio.file.Path -import java.nio.charset.StandardCharsets -import java.io.File.{ separator => sep } - -import com.vladsch.flexmark.parser.{ Parser, ParserEmulationProfile } -import com.vladsch.flexmark.ext.gfm.tables.TablesExtension -import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension -import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension -import com.vladsch.flexmark.ext.emoji.EmojiExtension -import com.vladsch.flexmark.ext.autolink.AutolinkExtension -import com.vladsch.flexmark.ext.anchorlink.AnchorLinkExtension -import com.vladsch.flexmark.ext.yaml.front.matter.YamlFrontMatterExtension -import com.vladsch.flexmark.html.HtmlRenderer -import com.vladsch.flexmark.util.options.{ DataHolder, MutableDataSet } - -import dotc.core.Contexts.{Context, ctx} -import dotc.util.SourceFile -import model.Package -import scala.io.{ Codec, Source } -import scala.util.Using -import io.{ AbstractFile, VirtualFile, File } -import scala.collection.mutable.ArrayBuffer -import util.syntax._ - -case class Site( - root: JFile, - outDir: JFile, - projectTitle: String, - projectVersion: String, - projectUrl: Option[String], - projectLogo: Option[String], - documentation: Map[String, Package], - baseUrl: String -) extends ResourceFinder { - /** Documentation serialized to java maps */ - private val docs: JList[_] = { - import model.JavaConverters._ - documentation.toJavaList - } - - private val docsFlattened: JList[_] = { - import model.JavaConverters._ - documentation.flattened - } - - /** All files that are considered static in this context, this can be - * anything from CSS, JS to images and other files. - * - * @note files that are *not* considered static are files ending in a compilable - * extension. - */ - def staticAssets(using Context): Array[JFile] = { - if (_staticAssets eq null) initFiles - _staticAssets - } - - /** All files that are considered compilable assets in this context. This - * is mainly markdown and html files, but could include other files in the - * future. - * - * @note files that are considered compilable end in `.md` or `.html` - */ - def compilableFiles(using Context): Array[JFile] = { - if (_compilableFiles eq null) initFiles - _compilableFiles - } - - /** All files that are considered blogposts, currently this means that files have been placed in: - * - * ``` - * ./blog/_posts/year-month-day-title.ext - * ``` - * - * where `ext` is either markdown or html. - */ - def blogposts(using Context): Array[JFile] = { - if (_blogposts eq null) initFiles - _blogposts - } - - /** Sidebar created from `sidebar.yml` file in site root */ - val sidebar: Sidebar = - root - .listFiles - .find(_.getName == "sidebar.yml") - .map(f => "---\n" + Using(Source.fromFile(f))(_.mkString).get + "\n---") - .map(Yaml.apply) - .flatMap(Sidebar.apply) - .getOrElse(Sidebar.empty) - - private[this] var _blogInfo: Array[BlogPost] = _ - protected def blogInfo(using Context): Array[BlogPost] = { - if (_blogInfo eq null) { - _blogInfo = - blogposts - .flatMap { file => - val BlogPost.extract(year, month, day, name, ext) = file.getName - val sourceFile = toSourceFile(file) - val params = defaultParams(file).withUrl(s"/blog/$year/$month/$day/$name.html").toMap - val page = - if (ext == "md") - new MarkdownPage(file.getPath, sourceFile, params, includes, documentation) - else new HtmlPage(file.getPath, sourceFile, params, includes) - BlogPost(file, page) - } - .sortBy(_.date) - .reverse - } - - _blogInfo - } - - // FileSystem getter - private[this] val fs = FileSystems.getDefault - - /** Create virtual file from string `sourceCode` */ - private def stringToSourceFile(name: String, path: String, sourceCode: String): SourceFile = { - val virtualFile = new VirtualFile(name, path) - val writer = new BufferedWriter(new OutputStreamWriter(virtualFile.output, StandardCharsets.UTF_8.name)) - writer.write(sourceCode) - writer.close() - - new SourceFile(virtualFile, Codec.UTF8) - } - - def copyStaticFiles()(using Context): this.type = - createOutput { - // Copy user-defined static assets - staticAssets.foreach { asset => - val target = mkdirs(fs.getPath(outDir.getAbsolutePath, stripRoot(asset))) - val source = mkdirs(fs.getPath(asset.getAbsolutePath)) - Files.copy(source, target, REPLACE_EXISTING) - } - - // Copy statics included in resources - Map( - "css/toolbar.css" -> "/css/toolbar.css", - "css/search.css" -> "/css/search.css", - "css/sidebar.css" -> "/css/sidebar.css", - "css/dottydoc.css" -> "/css/dottydoc.css", - "css/color-brewer.css" -> "/css/color-brewer.css", - "css/bootstrap.min.css" -> "/css/bootstrap.min.css", - "js/toolbar.js" -> "/js/toolbar.js", - "js/sidebar.js" -> "/js/sidebar.js", - "js/dottydoc.js" -> "/js/dottydoc.js", - "js/api-search.js" -> "/js/api-search.js", - "js/bootstrap.min.js" -> "/js/bootstrap.min.js", - "js/jquery.min.js" -> "/js/jquery.min.js", - "js/highlight.pack.js" -> "/js/highlight.pack.js", - "images/scala3-logo.svg" -> "/images/scala3-logo.svg", - "images/scala-logo.svg" -> "/images/scala-logo.svg", - "images/scala3-logo-white.svg" -> "/images/scala3-logo-white.svg", - "images/scala-logo-white.svg" -> "/images/scala-logo-white.svg" - ) - .transform((_, v) => getResource(v)) - .foreach { case (path, resource) => - val source = new ByteArrayInputStream(resource.getBytes(StandardCharsets.UTF_8)) - val target = mkdirs(fs.getPath(outDir.getAbsolutePath, path)) - Files.copy(source, target, REPLACE_EXISTING) - } - } - - /** Generate default params included in each page */ - private def defaultParams(pageLocation: JFile): DefaultParams = - val pathFromRoot = stripRoot(pageLocation) - DefaultParams( - docs, docsFlattened, documentation, PageInfo(pathFromRoot), - SiteInfo( - baseUrl, projectTitle, projectVersion, projectUrl, projectLogo, Array(), - root.toString - ), - sidebar - ) - - /* Creates output directories if allowed */ - private def createOutput(op: => Unit)(using Context): this.type = { - if (!outDir.isDirectory) outDir.mkdirs() - if (!outDir.isDirectory) ctx.docbase.error(s"couldn't create output folder: $outDir") - else op - this - } - - /** Generate HTML for the API documentation */ - def generateApiDocs()(using Context): this.type = - createOutput { - def genDoc(e: model.Entity): Unit = { - ctx.docbase.echo(s"Generating doc page for: ${e.path.mkString(".")}") - // Suffix is index.html for packages and therefore the additional depth - // is increased by 1 - val (suffix, offset) = - if (e.kind == "package") (sep + "index.html", -1) - else (".html", 0) - - val path = if (scala.util.Properties.isWin) - e.path.map(_.replace("<", "_").replace(">", "_")) - else - e.path - val target = mkdirs(fs.getPath(outDir.getAbsolutePath + sep + "api" + sep + path.mkString(sep) + suffix)) - val params = defaultParams(target.toFile).withPosts(blogInfo).withEntity(Some(e)).toMap - val page = new HtmlPage("_layouts" + sep + "api-page.html", layouts("api-page").content, params, includes) - - render(page).foreach { rendered => - val source = new ByteArrayInputStream(rendered.getBytes(StandardCharsets.UTF_8)) - Files.copy(source, target, REPLACE_EXISTING) - } - - // Generate docs for nested objects/classes: - e.children.foreach(genDoc) - } - - documentation.values.foreach { pkg => - genDoc(pkg) - pkg.children.foreach(genDoc) - } - - // generate search page: - val target = mkdirs(fs.getPath(outDir.getAbsolutePath + sep + "api" + sep + "search.html")) - val searchPageParams = defaultParams(target.toFile).withPosts(blogInfo).toMap - val searchPage = new HtmlPage("_layouts" + sep + "search.html", layouts("search").content, searchPageParams, includes) - render(searchPage).foreach { rendered => - Files.copy( - new ByteArrayInputStream(rendered.getBytes(StandardCharsets.UTF_8)), - target, - REPLACE_EXISTING - ) - } - } - - /** Generate HTML files from markdown and .html sources */ - def generateHtmlFiles()(using Context): this.type = - createOutput { - compilableFiles.foreach { asset => - val pathFromRoot = stripRoot(asset) - val sourceFile = toSourceFile(asset) - val params = defaultParams(asset).withPosts(blogInfo).toMap - val page = - if (asset.getName.endsWith(".md")) new MarkdownPage(pathFromRoot, sourceFile, params, includes, documentation) - else new HtmlPage(pathFromRoot, sourceFile, params, includes) - - render(page).foreach { renderedPage => - val source = new ByteArrayInputStream(renderedPage.getBytes(StandardCharsets.UTF_8)) - val target = pathFromRoot.splitAt(pathFromRoot.lastIndexOf('.'))._1 + ".html" - val htmlTarget = mkdirs(fs.getPath(outDir.getAbsolutePath, target)) - Files.copy(source, htmlTarget, REPLACE_EXISTING) - } - } - } - - /** Generate blog from files in `blog/_posts` and output in `outDir` */ - def generateBlog()(using Context): this.type = - createOutput { - blogposts.foreach { file => - val BlogPost.extract(year, month, day, name, ext) = file.getName - val sourceFile = toSourceFile(file) - val date = s"$year-$month-$day 00:00:00" - val params = defaultParams(file).withPosts(blogInfo).withDate(date).toMap - - // Output target - val target = mkdirs(fs.getPath(outDir.getAbsolutePath, "blog", year, month, day, name + ".html")) - - val page = - if (ext == "md") - new MarkdownPage(target.toString, sourceFile, params, includes, documentation) - else - new HtmlPage(target.toString, sourceFile, params, includes) - - render(page).map { rendered => - val source = new ByteArrayInputStream(rendered.getBytes(StandardCharsets.UTF_8)) - Files.copy(source, target, REPLACE_EXISTING) - } - } - } - - /** Create directories and issue an error if could not */ - private def mkdirs(path: Path)(using Context): path.type = { - val parent = path.getParent.toFile - - if (!parent.isDirectory && !parent.mkdirs()) - ctx.docbase.error(s"couldn't create directory: $parent") - - path - } - - /** This function allows the stripping of the path that leads up to root. - * - * ```scala - * stripRoot(new JFile("/some/root/dir/css/index.css")) - * // returns: dir/css/index.css - * // given that root is: /some/root - * ``` - */ - def stripRoot(f: JFile, root: JFile = root): String = { - val rootLen = root.getAbsolutePath.length + 1 - f.getAbsolutePath.drop(rootLen) - } - - // Initialization of `staticAssets` and `compilableAssets`, and `blogPosts`: - private[this] var _staticAssets: Array[JFile] = _ - private[this] var _compilableFiles: Array[JFile] = _ - private[this] var _blogposts: Array[JFile] = _ - - private[this] def initFiles(using Context) = { - // Split files between compilable and static assets - def splitFiles(f: JFile, assets: ArrayBuffer[JFile], comp: ArrayBuffer[JFile]): Unit = { - val name = f.getName - if (f.isDirectory) { - val name = f.getName - if (!name.startsWith("_") && name != "api") f.listFiles.foreach(splitFiles(_, assets, comp)) - if (f.getName == "api") ctx.docbase.warn { - "the specified `/api` directory will not be used since it is needed for the api documentation" - } - } - else if (name.endsWith(".md") || name.endsWith(".html")) comp.append(f) - else assets.append(f) - } - - // Collect posts from ./blog/_posts - def collectPosts(file: JFile): Option[JFile] = file.getName match { - case BlogPost.extract(year, month, day, name, ext) => Some(file) - case _ => None - } - - val assets = new ArrayBuffer[JFile] - val comp = new ArrayBuffer[JFile] - splitFiles(root, assets, comp) - _staticAssets = assets.toArray - _compilableFiles = comp.toArray - - _blogposts = - root - .listFiles - .find(dir => dir.getName == "blog" && dir.isDirectory) - .map(_.listFiles).getOrElse(Array.empty[JFile]) //FIXME: remove [JFile] once #1907 is fixed - .find(dir => dir.getName == "_posts" && dir.isDirectory) - .map(_.listFiles).getOrElse(Array.empty[JFile]) //FIXME: remove [JFile] once #1907 is fixed - .flatMap(collectPosts) - } - - /** Files that define a layout then referred to by `layout: filename-no-ext` - * in yaml front-matter. - * - * The compiler will look in two locations, `<root>/_layouts/` and - * in the bundled jar file's resources `/_layouts`. - * - * If the user supplies a layout that has the same name as one of the - * defaults, the user-defined one will take precedence. - */ - val layouts: Map[String, Layout] = { - val userDefinedLayouts = - root - .listFiles.find(d => d.getName == "_layouts" && d.isDirectory) - .map(collectFiles(_, f => f.endsWith(".md") || f.endsWith(".html"))) - .getOrElse(Array.empty[JFile]) - .map(f => (f.getName.substring(0, f.getName.lastIndexOf('.')), Layout(f.getPath, toSourceFile(f)))) - .toMap - - val defaultLayouts: Map[String, Layout] = Map( - "base" -> "/_layouts/base.html", - "main" -> "/_layouts/main.html", - "search" -> "/_layouts/search.html", - "doc-page" -> "/_layouts/doc-page.html", - "api-page" -> "/_layouts/api-page.html", - "blog-page" -> "/_layouts/blog-page.html", - "index" -> "/_layouts/index.html" - ).map { - case (name, path) => - (name, Layout(path, stringToSourceFile(name, path, getResource(path)))) - } - - defaultLayouts ++ userDefinedLayouts - } - - /** Include files are allowed under the directory `_includes`. These files - * have to be compilable files and can be used with liquid includes: - * - * ``` - * {% include "some-file" %} - * ``` - * - * You can also use the `with` statement: - * - * ``` - * {% include "some-file" with { key: value } %} - * ``` - */ - val includes: Map[String, Include] = { - val userDefinedIncludes = - root - .listFiles.find(d => d.getName == "_includes" && d.isDirectory) - .map(collectFiles(_, f => f.endsWith(".md") || f.endsWith(".html"))) - .getOrElse(Array.empty[JFile]) - .map(f => (f.getName, Include(f.getPath, toSourceFile(f)))) - .toMap - - val defaultIncludes: Map[String, Include] = Map( - "header.html" -> "/_includes/header.html", - "toolbar.html" -> "/_includes/toolbar.html", - "sidebar.html" -> "/_includes/sidebar.html" - ).map { - case (name, path) => - (name, Include(path, stringToSourceFile(name, path, getResource(path)))) - } - - defaultIncludes ++ userDefinedIncludes - } - - private def toSourceFile(f: JFile): SourceFile = - new SourceFile(AbstractFile.getFile(new File(f.toPath)), Using(Source.fromFile(f, StandardCharsets.UTF_8.name))(_.toArray).get) - - private def collectFiles(dir: JFile, includes: String => Boolean): Array[JFile] = - dir - .listFiles - .filter(f => includes(f.getName)) - - /** Render a page to html, the resulting string is the result of the complete - * expansion of the template with all its layouts and includes. - */ - def render(page: Page, params: Map[String, AnyRef] = Map.empty)(using Context): Option[String] = - page.yaml.get("layout").flatMap(xs => layouts.get(xs.toString)) match { - case Some(layout) if page.html.isDefined => - val newParams = page.params ++ params ++ Map("page" -> page.yaml) ++ Map("content" -> page.html.get) - val expandedTemplate = new HtmlPage(layout.path, layout.content, newParams, includes) - render(expandedTemplate, params) - case _ => - page.html - } -} - -object Site { - val markdownOptions: DataHolder = - new MutableDataSet() - .setFrom(ParserEmulationProfile.KRAMDOWN.getOptions) - .set(Parser.INDENTED_CODE_BLOCK_PARSER, false) - .set(HtmlRenderer.FENCED_CODE_LANGUAGE_CLASS_PREFIX, "") - .set(HtmlRenderer.FENCED_CODE_NO_LANGUAGE_CLASS, "nohighlight") - .set(AnchorLinkExtension.ANCHORLINKS_WRAP_TEXT, false) - .set(AnchorLinkExtension.ANCHORLINKS_ANCHOR_CLASS, "anchor") - .set(EmojiExtension.ROOT_IMAGE_PATH, "https://github.global.ssl.fastly.net/images/icons/emoji/") - .set(Parser.EXTENSIONS, Arrays.asList( - TablesExtension.create(), - TaskListExtension.create(), - AutolinkExtension.create(), - AnchorLinkExtension.create(), - EmojiExtension.create(), - YamlFrontMatterExtension.create(), - StrikethroughExtension.create() - )) -} diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/Template.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/Template.scala deleted file mode 100644 index 21175cc3a3b2..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/Template.scala +++ /dev/null @@ -1,135 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import scala.util.control.NonFatal - -import dotc.util.SourceFile -import dotc.core.Contexts.{Context, ctx} -import dotc.util.Spans.Span -import dotc.report -import util.syntax._ - -trait Template { - def path: String - def content: SourceFile - def show: String = new String(content.content) -} - -case class TemplateRenderingError(path: String, ex: Throwable) -extends Exception(s"error rendering $path, $ex") - -case class Layout(path: String, content: SourceFile) extends Template - -case class Include(path: String, content: SourceFile) extends Template - -case class LiquidTemplate(path: String, content: SourceFile) extends Template with ResourceFinder { - import scala.collection.JavaConverters._ - import dotc.printing.Highlighting._ - import liqp.Template - import liqp.filters.Filter - import liqp.parser.Flavor.JEKYLL - import java.util.{ HashMap, Map => JMap } - import filters._ - import tags._ - - /** Register filters to static container */ - Filter.registerFilter(new Reverse) - Filter.registerFilter(new First) - Filter.registerFilter(new Json) - Filter.registerFilter(new EscapeCSS) - - // For some reason, liqp rejects a straight conversion using `.asJava` - private def toJavaMap(map: Map[String, AnyRef]): HashMap[String, Object] = - map.foldLeft(new HashMap[String, Object]()) { case (map, (k, v)) => - map.put(k, v) - map - } - - private def protectedRender(op: => String)(using Context) = try { - Some(op) - } catch { - case NonFatal(ex) => { - // TODO: when we reimplement the liquid parser, this can go away. For now - // this is an OK approximation of what went wrong. - if ((ex.getCause eq null) || ex.getMessage.contains("exceeded the max amount of time")) { - ctx.docbase.error( - "unknown error occurred in " + - Blue(path).toString + - ", most likely incorrect usage of tag" - ) - None - } - else ex.getCause match { - case mm: org.antlr.runtime.MismatchedTokenException => { - val unexpected = LiquidTemplate.token(mm.getUnexpectedType) - val expected = LiquidTemplate.token(mm.expecting) - - // mm.index is incorrect, let's compute the index manually - // mm.line starts at 1, not 0 - val index = content.lineToOffset(mm.line-1) + mm.charPositionInLine - report.error( - if (unexpected == "EOF") - s"unexpected end of file, expected $expected" - else - s"unexpected $unexpected, expected $expected", - content atSpan Span(index) - ) - - None - } - case _ => { - throw ex - } - } - } - } - - def render(params: Map[String, AnyRef], includes: Map[String, Include])(using Context): Option[String] = - protectedRender { - Template.parse(show, JEKYLL) - .`with`(ResourceInclude(params, includes)) - .`with`(RenderReference(params)) - .`with`(RenderLink(params)) - .`with`(RenderTitle(params)) - .`with`(Docstring(params)) - .render(toJavaMap(params)) - } -} - -object LiquidTemplate { - import liqp.parser.LiquidParser - import scala.collection.mutable.HashMap - - final val TokenSymbols = HashMap( - "TagStart" -> "{%", - "TagEnd" -> "%}", - "OutStart" -> "{{", - "OutEnd" -> "}}", - "Pipe" -> "|", - "DotDot" -> "..", - "Dot" -> ".", - "Eq" -> "==", - "EqSign" -> "=", - "Gt" -> ">", - "GtEq" -> ">=", - "Lt" -> "<", - "LtEq" -> "<=", - "Minus" -> "-", - "Col" -> ":", - "Comma" -> ",", - "OPar" -> "(", - "CPar" -> ")", - "OBr" -> "[", - "CBr" -> "]", - "QMark" -> "?" - ).mapValuesInPlace((k,v) => s"'$v' ($k)") - - def token(i: Int): String = - if (i == -1) "EOF" - else if (i >= LiquidParser.tokenNames.length) "non-existing token" - else { - val name = LiquidParser.tokenNames(i) - TokenSymbols.getOrElse(name, name) - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/Yaml.java b/doc-tool/src/dotty/tools/dottydoc/staticsite/Yaml.java deleted file mode 100644 index 23f0c11be0d1..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/Yaml.java +++ /dev/null @@ -1,23 +0,0 @@ -package dotty.tools.dottydoc.staticsite; - -import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.core.type.TypeReference; - -import java.util.HashMap; -import java.io.ByteArrayInputStream; -import java.nio.charset.StandardCharsets; - -public class Yaml { - - public static HashMap<String, Object> apply(String input) - throws java.io.UnsupportedEncodingException, java.io.IOException { - ByteArrayInputStream is = new ByteArrayInputStream(input.getBytes(StandardCharsets.UTF_8)); - ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); - - TypeReference<HashMap<String, Object>> typeRef = - new TypeReference<HashMap<String, Object>>() {}; - - return mapper.readValue(is, typeRef); - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/filters.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/filters.scala deleted file mode 100644 index 0a0ab4db6fcf..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/filters.scala +++ /dev/null @@ -1,79 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import java.util.{ Map => JMap, List => JList } - -import com.fasterxml.jackson.databind.ObjectMapper -import liqp.filters.Filter - -/** Custom liquid template filters */ -object filters { - - /** Used to reverse arrays: - * - * ```html - * {% assign array = "1,2,3,4,5" | split: "," %} - * {{ array | reverse }} - * ``` - */ - final class Reverse extends Filter("reverse") { - override def apply(value: Any, params: AnyRef*): AnyRef = { - val array = super.asArray(value) - if (array.length == 0) null - else array.reverse - } - } - - /** Used to get the first element of arrays and strings: - * - * ```html - * {% assign array = "1,2,3,4,5" | split: "," %} - * {{ array | first }} - * ``` - * The above snippet will render "1" - */ - final class First extends Filter("first") { - override def apply(value: Any, params: AnyRef*): AnyRef = value match { - case str: String if str.nonEmpty => str.charAt(0).toString - case xs: Array[String] if xs.nonEmpty => xs.head - case _ => null - } - } - - /** Used to transform java representation to valid JSON - * - * This can be used on things like the docs (`java.util.List[Map[String,_]]`) - * which are available globally: - * - * ```html - * {{ docs | json }} - * ``` - */ - final class Json extends Filter("json") { - override def apply(value: Any, params: AnyRef*): AnyRef = value match { - case map: JList[_] => new ObjectMapper().writeValueAsString(map) - case _ => null - } - } - - /** Escapes characters forbidden in CSS selectors - * - * ```html - * {{ scalaSignature | escapeCSS }} - * ``` - * - */ - final class EscapeCSS extends Filter("escapeCSS") { - private def isValid(c: Char): Boolean = - (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c == '_' || c == '-') - - override def apply(value: Any, params: AnyRef*): AnyRef = value match { - case str: String => str.map(c => { - if (c == ',') '_' // make commas and parentheses different - else if (isValid(c)) c else '-' - }) - case _ => null - } - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/tags.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/tags.scala deleted file mode 100644 index 084233c3bc4c..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/tags.scala +++ /dev/null @@ -1,242 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import model.references._ -import dotc.core.Contexts.{Context, ctx} - -import liqp.tags.Tag -import liqp.TemplateContext -import liqp.nodes.LNode - -import java.util.{ Map => JMap, List => JList } -import model._ -import util.syntax._ - -object tags { - - sealed trait ParamConverter { - def params: Map[String, AnyRef] - - private[this] var _baseurl: String = _ - def baseurl(using Context): String = { - if (_baseurl eq null) { - _baseurl = - params.get("site").flatMap { - case map: JMap[String, String] @unchecked => - Some(map.get("baseurl")) - case _ => - None - } - .getOrElse { - ctx.docbase.warn(s"missing `baseurl` in: $params") - "" - } - } - _baseurl - } - } - - /** Renders a `MaterializableLink` into a HTML anchor tag. If the link is - * `NoLink` it will just return a string with the link's title. - */ - final case class RenderLink(params: Map[String, AnyRef])(using Context) - extends Tag("renderLink") with ParamConverter { - override def render(tctx: TemplateContext, nodes: LNode*): AnyRef = nodes(0).render(tctx) match { - case map: JMap[String, AnyRef] @unchecked => - val link = map.get("scala") - if (link.isInstanceOf[MaterializableLink] && (link ne null)) - renderLink(baseurl, link.asInstanceOf[MaterializableLink]) - else if (link eq null) - null // Option[Reference] was None - else { - ctx.docbase.error(s"illegal argument: $link, to `renderLink` function") - null - } - case _ => null - } - } - - - private[this] def renderLink(baseurl: String, link: MaterializableLink)(using Context): String = - link match { - case MaterializedLink(title, target) => - s"""<a href="$baseurl/api/$target">$title</a>""" - case _ => link.title - } - - final case class RenderReference(params: Map[String, AnyRef])(using Context) - extends Tag("renderRef") with ParamConverter { - - private def renderReference(ref: Reference): String = ref match { - case TypeReference(_, tpeLink, paramLinks) => { - if (paramLinks.nonEmpty) { - val link = renderLink(baseurl, tpeLink); - val typeParamsLinks = paramLinks.map(renderReference).mkString("[", ",", "]"); - s"""$link<span class="type-params">$typeParamsLinks</span>""" - } - else renderLink(baseurl, tpeLink) - } - - case OrTypeReference(left, right) => - s"""${renderReference(left)}<span class="and-or-separator"> | </span>${renderReference(right)}""" - - case AndTypeReference(left, right) => - s"""${renderReference(left)}<span class="and-or-separator"> & </span>${renderReference(right)}""" - - case FunctionReference(args, returnValue, isImplicit) => { - val implicitPrefix = if (isImplicit) "implicit " else "" - val params = - if (args.isEmpty) "<span>() => </span>" - else if (args.tail.isEmpty) renderReference(args.head) + """<span class="right-arrow"> => </span>""" - else args.map(renderReference).mkString("<span>(</span>", "<span>, </span>", "<span>) => </span>") - - implicitPrefix + params + renderReference(returnValue) - } - - case TupleReference(args) => - s"""|<span class="no-right">(</span> - |${ args.map(renderReference).mkString("<span>, </span>") } - |<span class="no-left">)</span>""".stripMargin - - case BoundsReference(low, high) => - s"""${ renderReference(low) }<span class="bounds"> <: </span>${ renderReference(high) }""" - - case NamedReference(title, _, _, _) => - ctx.docbase.error(s"received illegal named reference in rendering: $ref") - title - - case ConstantReference(title) => title - - case _ => // EmptyReference - ctx.docbase.error(s"invalid reference: $ref") - null - } - override def render(tctx: TemplateContext, nodes: LNode*): AnyRef = nodes(0).render(tctx) match { - case map: JMap[String, AnyRef] @unchecked => - val ref = map.get("scala") - if (ref.isInstanceOf[Reference] && (ref ne null)) renderReference(ref.asInstanceOf[Reference]) - else if (ref eq null) null // Option[Reference] was None - else { - ctx.docbase.error(s"illegal argument: $ref, to `renderRef` function") - null - } - case _ => null - } - } - - case class ResourceInclude(params: Map[String, AnyRef], includes: Map[String, Include])(using Context) - extends Tag("include") { - import scala.collection.JavaConverters._ - val DefaultExtension = ".html" - - override def render(tctx: TemplateContext, nodes: LNode*): AnyRef = { - val origInclude = asString(nodes(0).render(tctx)) - val incResource = origInclude match { - case fileWithExt if fileWithExt.indexOf('.') > 0 => fileWithExt - case file => file + DefaultExtension - } - - includes - .get(incResource) - .map { template => - if (nodes.length > 1) tctx.put(origInclude, nodes(1).render(tctx)) - - LiquidTemplate(template.path, template.content) - .render(tctx.getVariables.asScala.toMap, includes) - .getOrElse("") - } - .getOrElse { - ctx.docbase.error(s"couldn't find include file '$origInclude'") - "" - } - } - } - - /** Can be used to render the `sidebar.yml` entries, represented here as - * `Title`. - * - * ```html - * {% renderTitle title, page.url %} - * ``` - */ - case class RenderTitle(params: Map[String, AnyRef])(using Context) - extends Tag("renderTitle") with ParamConverter { - private def isParent(t: Title, htmlPath: String): Boolean = { - t.url match { - case Some(url) => url == htmlPath - case None => t.subsection.exists(isParent(_, htmlPath)) - } - } - private def replaceSuffix(url: String, suffixes: Iterable[String]): String = { - suffixes.find(url.endsWith(_)).map(url.replace(_, ".html")).getOrElse(url) - } - private def renderTitle(t: Title, pageUrl: String): String = { - val htmlPath = replaceSuffix(pageUrl, Seq("-spec.md", "-details.md", "-new.md", ".md")) - val marker = if (isParent(t, htmlPath)) "class=\"toggled\"" else "" - if (!t.url.isDefined && t.subsection.nonEmpty) { - s"""|<li class="section"> - | <a onclick='toggleSection(this);'>${t.title}</a> - | <ul $marker> - | ${ t.subsection.map(renderTitle(_, htmlPath)).mkString("\n") } - | </ul> - |</li> - |""".stripMargin - } - else if (t.url.isDefined) { - val url = t.url.get - s"""<li class="leaf"><a href="$baseurl/$url" $marker>${t.title}</a></li>""" - } - else { - ctx.docbase.error( - s"url was defined for subsection with title: ${t.title}, remove url to get toggleable entries" - ) - t.title - } - } - - override def render(ctx: TemplateContext, nodes: LNode*): AnyRef = - ((nodes(0).render(ctx), nodes(1).render(ctx)) match { - case (map: JMap[String, AnyRef] @unchecked, url: String) => - Title(map).map(renderTitle(_, url)) - case (map: JMap[String, AnyRef] @unchecked, _) => - Title(map).map(renderTitle(_, "./")) // file is in top dir - case _ => None - }).orNull - } - - /** Allows the extraction of docstrings from the given path. E.g: - * - * ```html - * {% docstring "scala.collection.Seq" %} - * ``` - * - * In Scaladoc, objects are denoted by a name ending in '$'. This means that - * a path that goes through, or targets an object need to appropriately - * intersperse these, e.g: - * - * ```html - * {% docstring "scala.collection.Seq$" %} - * ``` - */ - case class Docstring(params: Map[String, AnyRef]) extends Tag("docstring") { - private def find(xs: List[String], ent: Entity with Members): Option[Entity] = xs match { - case Nil => None - case x :: Nil => - ent.members collect { case e: Entity with Members => e } find (_.path.last == x) - case x :: xs => - ent.members collect { case e: Entity with Members => e } find (_.path.last == x) flatMap (find(xs, _)) - } - - override def render(ctx: TemplateContext, nodes: LNode*): AnyRef = nodes(0).render(ctx) match { - case query: String => - params.get("originalDocs").collect { - case docs: Map[String, Package] @unchecked => - val search = query.split("\\.") - if (search.isEmpty || !docs.contains(search.head)) null - else find(search.tail.toList, docs(search.head)).flatMap(_.comment.map(_.body)).getOrElse(null) - }.getOrElse(null) - case _ => null - } - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/util/MemberLookup.scala b/doc-tool/src/dotty/tools/dottydoc/util/MemberLookup.scala deleted file mode 100644 index ea2faac5fdc2..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/util/MemberLookup.scala +++ /dev/null @@ -1,89 +0,0 @@ -package dotty.tools -package dottydoc -package util - -import model.comment._ -import model._ - -trait MemberLookup { - /** Performs a lookup based on the provided (pruned) query string - * - * Will return a `Tooltip` if unsuccessful, otherwise a LinkToEntity or - * LinkToExternal - */ - def lookup(entity: Option[Entity], packages: Map[String, Package], query: String): Option[Entity] = { - val notFound: Option[Entity] = None - val querys = query.split("\\.").toList - - /** Looks for the specified entity among `ent`'s members */ - def localLookup(ent: Entity with Members, searchStr: String): Option[Entity] = - ent - .members - .collect { case x if x.name == searchStr => x } - .sortBy(_.path.last) - .headOption - - /** Looks for an entity down in the structure, if the search list is Nil, - * the search stops - */ - def downwardLookup(ent: Entity with Members, search: List[String]): Option[Entity] = - search match { - case Nil => notFound - case x :: Nil => - localLookup(ent, x) - case x :: xs => - ent - .members - .collectFirst { - case e: Entity with Members if e.name == x => e - case e: Entity with Members if e.name == x.init && x.last == '$' => e - } - .fold(notFound)(e => downwardLookup(e, xs)) - } - - /** Finds package with longest matching name, then does downwardLookup in - * the package - */ - def globalLookup: Option[Entity] = { - def longestMatch(list: List[String]): List[String] = - if (list eq Nil) Nil - else - packages - .get(list.mkString(".")) - .map(_ => list) - .getOrElse(longestMatch(list.dropRight(1))) - - longestMatch(querys) match { - case Nil => notFound - case xs => downwardLookup(packages(xs.mkString(".")), querys diff xs) - } - } - - (querys, entity) match { - case (xs, None) => globalLookup - case (x :: Nil, Some(e: Entity with Members)) => - localLookup(e, x) - case (x :: _, Some(e: Entity with Members)) if x == e.name => - downwardLookup(e, querys) - case (x :: xs, _) => - if (xs.nonEmpty) globalLookup - else lookup(entity, packages, "scala." + query) - case (Nil, _) => - throw new IllegalArgumentException("`query` cannot be empty") - } - } - - def makeEntityLink( - entity: Entity, - packages: Map[String, Package], - title: Inline, - query: String - ): EntityLink = { - val link = - lookup(Some(entity), packages, query) - .map(LinkToEntity.apply) - .getOrElse(Tooltip(query)) - - EntityLink(title, link) - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/util/internal/mutate.scala b/doc-tool/src/dotty/tools/dottydoc/util/internal/mutate.scala deleted file mode 100644 index 2f4a255dccf8..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/util/internal/mutate.scala +++ /dev/null @@ -1,70 +0,0 @@ -package dotty.tools.dottydoc -package util -package internal - -object setters { - import model._ - import comment.Comment - import internal._ - - def setComment(ent: Entity, to: Option[Comment]) = ent match { - case x: PackageImpl => x.comment = to - case x: ClassImpl => x.comment = to - case x: CaseClassImpl => x.comment = to - case x: TraitImpl => x.comment = to - case x: ObjectImpl => x.comment = to - case x: DefImpl => x.comment = to - case x: ValImpl => x.comment = to - case x: TypeAliasImpl => x.comment = to - } - - def setParent(ent: Entity, to: Entity): Unit = ent match { - case e: PackageImpl => - e.parent = Some(to) - e.members.foreach(setParent(_, e)) - case e: ClassImpl => - e.parent = Some(to) - e.members.foreach(setParent(_, e)) - case e: CaseClassImpl => - e.parent = Some(to) - e.members.foreach(setParent(_, e)) - case e: ObjectImpl => - e.parent = Some(to) - e.members.foreach(setParent(_, e)) - case e: TraitImpl => - e.parent = Some(to) - e.members.foreach(setParent(_, e)) - case e: ValImpl => - e.parent = Some(to) - case e: DefImpl => - e.parent = Some(to) - case e: TypeAliasImpl => - e.parent = Some(to) - case _ => () - } - - implicit class FlattenedEntity(val ent: Entity) extends AnyVal { - /** Returns a flat copy if anything was changed (Entity with Members) else - * the identity - */ - def flat: Entity = { - def flattenMember: Entity => Entity = { - case e: PackageImpl => e.copy(members = Nil) - case e: ObjectImpl => e.copy(members = Nil) - case e: CaseClassImpl => e.copy(members = Nil) - case e: ClassImpl => e.copy(members = Nil) - case e: TraitImpl => e.copy(members = Nil) - case other => other - } - - ent match { - case e: PackageImpl => e.copy(members = e.members.map(flattenMember)) - case e: ObjectImpl => e.copy(members = e.members.map(flattenMember)) - case e: CaseClassImpl => e.copy(members = e.members.map(flattenMember)) - case e: ClassImpl => e.copy(members = e.members.map(flattenMember)) - case e: TraitImpl => e.copy(members = e.members.map(flattenMember)) - case other => other - } - } - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/util/syntax.scala b/doc-tool/src/dotty/tools/dottydoc/util/syntax.scala deleted file mode 100644 index 486cdff6d8fa..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/util/syntax.scala +++ /dev/null @@ -1,26 +0,0 @@ -package dotty.tools -package dottydoc -package util - -import dotc.core.Contexts.{Context, ctx} -import dotc.core.Comments.{_, given} -import model.Package -import core.ContextDottydoc -import dotc.core.Symbols._ - -import dotc.util.{ SourcePosition, SourceFile } -import dotc.util.Spans.Span -import scala.io.Codec - -object syntax { - implicit class ContextWithContextDottydoc(val ctx: Context) extends AnyVal { - def docbase: ContextDottydoc = ctx.docCtx.getOrElse { - throw new IllegalStateException("DocBase must be set before running dottydoc phases") - }.asInstanceOf[ContextDottydoc] - } - - implicit class SymbolExtensions(val sym: Symbol) extends AnyVal { - def sourcePosition(span: Span)(using Context): SourcePosition = - sym.source.atSpan(span) - } -} diff --git a/doc-tool/src/dotty/tools/dottydoc/util/traversing.scala b/doc-tool/src/dotty/tools/dottydoc/util/traversing.scala deleted file mode 100644 index 956cb9291499..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/util/traversing.scala +++ /dev/null @@ -1,43 +0,0 @@ -package dotty.tools.dottydoc -package util - -object traversing { - import model._ - - def mutateEntities(e: Entity)(trans: Entity => Unit): Unit = e match { - case e: Entity with Members => - trans(e) - e.members.map(mutateEntities(_)(trans)) - case e: Entity => trans(e) - } - - def relativePath(from: Entity, to: Entity) = { - val offset = from match { - case v: Val if v.implicitlyAddedFrom.isDefined => 3 - case d: Def if d.implicitlyAddedFrom.isDefined => 3 - case _: Val | _: Def => 2 - case _ => 1 - } - - "../" * (from.path.length - offset) + - to.path.mkString("", "/", ".html") - } - - - def rootPackages(pkgs: Map[String, Package]): List[Package] = { - var currentDepth = Int.MaxValue - var packs = List.empty[String] - - for (key <- pkgs.keys) { - val keyDepth = key.split("\\.").length - packs = - if (keyDepth < currentDepth) { - currentDepth = keyDepth - key :: Nil - } else if (keyDepth == currentDepth) { - key :: packs - } else packs - } - packs.map(pkgs.apply) - } -} diff --git a/doc-tool/test/dotty/tools/dottydoc/CommentCleanerTest.scala b/doc-tool/test/dotty/tools/dottydoc/CommentCleanerTest.scala deleted file mode 100644 index 5cf5614c4cfe..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/CommentCleanerTest.scala +++ /dev/null @@ -1,83 +0,0 @@ -package dotty.tools -package dottydoc - -import org.junit.Test -import org.junit.Assert._ - -import model.comment.CommentCleaner - -class CommentCleanerTest extends CommentCleaner { - @Test def simpleOneliner = { - assertEquals(List("lol"), clean("/** lol */")) - } - - @Test def multiline = { - val docstring = clean { - """|/** First - | * Second - | */ - |""".stripMargin - } - - assertEquals(List("First", "Second", ""), docstring) - } - - @Test def multilineBad = { - val docstring = clean { - """|/** First - | * Second - | */ - |""".stripMargin - } - - assertEquals(List("First", " Second", ""), docstring) - } - - @Test def multilineWorse = { - val docstring = clean { - """|/** First - | * Second - | * Third - | */ - |""".stripMargin - } - - assertEquals(List("First", " Second", "Third", ""), docstring) - } - - @Test def multilineFirstNoSpace = { - val docstring = clean { - """|/**First - | * Second - | * Third - | */ - |""".stripMargin - } - - assertEquals(List("First", " Second", "Third", ""), docstring) - } - - @Test def multilineFirstTwoSpaces = { - val docstring = clean { - """|/** First - | * Second - | * Third - | */ - |""".stripMargin - } - - assertEquals(List("First", " Second", "Third", ""), docstring) - } - - @Test def multilineFirstThreeSpaces = { - val docstring = clean { - """|/** First - | * Second - | * Third - | */ - |""".stripMargin - } - - assertEquals(List(" First", " Second", "Third", ""), docstring) - } -} diff --git a/doc-tool/test/dotty/tools/dottydoc/ConstructorTest.scala b/doc-tool/test/dotty/tools/dottydoc/ConstructorTest.scala deleted file mode 100644 index e3ff3652b8ef..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/ConstructorTest.scala +++ /dev/null @@ -1,196 +0,0 @@ -package dotty.tools -package dottydoc - -import org.junit.Test -import org.junit.Assert._ - -import dotc.util.SourceFile -import model._ -import model.internal._ -import model.references._ - -class ConstructorsFromSourceTest extends ConstructorsBase with CheckFromSource -class ConstructorsFromTastyTest extends ConstructorsBase with CheckFromTasty - -abstract class ConstructorsBase extends DottyDocTest { - @Test def singleClassConstructor = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |class Class(val str: String) - """.stripMargin - ) - - val tastyFile = "scala/Class.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(cls: Class), _, _, _, _) => - cls.constructors.headOption match { - case Some(ParamListImpl(NamedReference("str", _, false, false) :: Nil, false) :: Nil) => - // success! - case _ => assert(false, s"Incorrect constructor found: ${cls.constructors}") - } - } - } - } - - @Test def constructorPlusImplicitArgList = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |class Class(val str1: String)(implicit str2: String) - """.stripMargin - ) - - val tastyFile = "scala/Class.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(cls: Class), _, _, _, _) => - cls.constructors match { - case ( - ParamListImpl(NamedReference("str1", _, false, false) :: Nil, false) :: - ParamListImpl(NamedReference("str2", _, false, false) :: Nil, true) :: Nil - ) :: Nil => - // success! - case _ => assert(false, s"Incorrect constructor found: ${cls.constructors}") - } - } - } - } - - @Test def multipleArgumentListsForConstructor = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |class Class(val str1: String)(val str2: String)(implicit str3: String) - """.stripMargin - ) - - val tastyFile = "scala/Class.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(cls: Class), _, _, _, _) => - cls.constructors match { - case ( - ParamListImpl(NamedReference("str1", _, false, false) :: Nil, false) :: - ParamListImpl(NamedReference("str2", _, false, false) :: Nil, false) :: - ParamListImpl(NamedReference("str3", _, false, false) :: Nil, true) :: Nil - ) :: Nil => - // success! - case _ => assert(false, s"Incorrect constructor found: ${cls.constructors}") - } - } - } - } - - @Test def multipleConstructors = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |class Class(val main: String) { - | def this(alt1: Int) = - | this("String") - | - | def this(alt2: List[String]) = - | this(alt2.head) - |} - """.stripMargin - ) - - val tastyFile = "scala/Class.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(cls: Class), _, _, _, _) => - cls.constructors match { - case ( - ParamListImpl(NamedReference("main", _, false, false) :: Nil, false) :: Nil - ) :: ( - ParamListImpl(NamedReference("alt1", _, false, false) :: Nil, false) :: Nil - ) :: ( - ParamListImpl(NamedReference("alt2", _, false, false) :: Nil, false) :: Nil - ) :: Nil => - // success! - case _ => - assert( - false, - s"""Incorrect constructor found:\n${cls.constructors.mkString("\n")}""" - ) - } - } - } - } - - @Test def multipleConstructorsCC = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |case class Class(val main: String) { - | def this(alt1: Int) = - | this("String") - | - | def this(alt2: List[String]) = - | this(alt2.head) - |} - """.stripMargin - ) - - val tastyFile = "scala/Class.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(cls: CaseClass, obj: Object), _, _, _, _) => - cls.constructors match { - case ( - ParamListImpl(NamedReference("main", _, false, false) :: Nil, false) :: Nil - ) :: ( - ParamListImpl(NamedReference("alt1", _, false, false) :: Nil, false) :: Nil - ) :: ( - ParamListImpl(NamedReference("alt2", _, false, false) :: Nil, false) :: Nil - ) :: Nil => - // success! - case _ => - println(obj.members.map(x => x.kind + " " + x.name)) - assert( - false, - s"""Incorrect constructor found:\n${cls.constructors.mkString("\n")}""" - ) - } - } - } - } - - @Test def traitParameters = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |trait Trait(val main: String) - """.stripMargin - ) - - val tastyFile = "scala/Trait.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(trt: Trait), _, _, _, _) => - trt.traitParams match { - case ParamListImpl(NamedReference("main", _, false, false) :: Nil, false) :: Nil => - case _ => - assert( - false, - s"""Incorrect constructor found:\n${trt.traitParams.mkString("\n")}""" - ) - } - } - } - } -} diff --git a/doc-tool/test/dotty/tools/dottydoc/DottyDocTest.scala b/doc-tool/test/dotty/tools/dottydoc/DottyDocTest.scala deleted file mode 100644 index 26ae91070581..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/DottyDocTest.scala +++ /dev/null @@ -1,151 +0,0 @@ -package dotty.tools -package dottydoc - -import vulpix.TestConfiguration - -import dotc.Compiler -import dotc.core.Contexts.{ Context, ContextBase, FreshContext } -import dotc.core.Comments.{ ContextDoc, ContextDocstrings } -import dotc.util.SourceFile -import dotc.core.Phases.Phase -import dotty.tools.io.AbstractFile -import dotc.typer.FrontEnd -import dottydoc.core.{ DocASTPhase, ContextDottydoc } -import model.Package -import dotty.tools.dottydoc.util.syntax._ -import dotty.tools.io.AbstractFile -import dotc.reporting.{ StoreReporter, MessageRendering } -import dotc.interfaces.Diagnostic.ERROR -import io.{Directory, PlainFile, Path, PlainDirectory} -import org.junit.Assert.fail - -import java.io.{ BufferedWriter, OutputStreamWriter } -import java.nio.charset.StandardCharsets - -trait DottyDocTest extends MessageRendering { - dotty.tools.dotc.parsing.Scanners // initialize keywords - - private def freshCtx(extraClasspath: List[String]): FreshContext = { - val base = new ContextBase - import base.settings._ - val ctx = base.initialCtx.fresh - ctx.setSetting(ctx.settings.language, List("Scala2")) - ctx.setSetting(ctx.settings.YcookComments, true) - ctx.setSetting(ctx.settings.Ycheck, "all" :: Nil) - ctx.setSetting(ctx.settings.wikiSyntax, true) - ctx.setProperty(ContextDoc, new ContextDottydoc) - ctx.setSetting( - ctx.settings.classpath, - (TestConfiguration.basicClasspath :: extraClasspath).mkString(java.io.File.pathSeparator) - ) - ctx.setReporter(new StoreReporter(ctx.reporter)) - base.initialize()(using ctx) - ctx - } - implicit val ctx: FreshContext = freshCtx(Nil) - - private def compilerWithChecker(assertion: (Context, Map[String, Package]) => Unit) = new DocCompiler { - override def phases = { - val assertionPhase = new Phase { - def phaseName = "assertionPhase" - override def run(implicit ctx: Context): Unit = { - assertion(ctx, ctx.docbase.packages) - if (ctx.reporter.hasErrors) { - System.err.println("reporter had errors:") - ctx.reporter.removeBufferedMessages.foreach { msg => - System.err.println { - messageAndPos(msg.msg, msg.pos, diagnosticLevel(msg)) - } - } - } - } - } - super.phases :+ List(assertionPhase) - } - } - - private def callingMethod: String = - Thread.currentThread.getStackTrace.find { - _.getMethodName match { - case "checkSource" | "callingMethod" | "getStackTrace" | "currentThread" => - false - case _ => - true - } - } - .map(_.getMethodName) - .getOrElse { - throw new IllegalStateException("couldn't get calling method via reflection") - } - - private def sourceFileFromString(name: String, contents: String): SourceFile = { - val virtualFile = new dotty.tools.io.VirtualFile(name) - val writer = new BufferedWriter(new OutputStreamWriter(virtualFile.output, StandardCharsets.UTF_8)) - writer.write(contents) - writer.close() - new SourceFile(virtualFile, scala.io.Codec.UTF8) - } - - def checkSource(source: String)(assertion: (Context, Map[String, Package]) => Unit): Unit = { - val c = compilerWithChecker(assertion) - val run = c.newRun - run.compileSources(sourceFileFromString(callingMethod, source) :: Nil) - } - - def checkFiles(sources: List[String])(assertion: (Context, Map[String, Package]) => Unit): Unit = { - val c = compilerWithChecker(assertion) - val run = c.newRun - val files = sources.map(path => new PlainFile(Path(path))) - run.compile(files) - } - - def checkFromSource(sourceFiles: List[SourceFile])(assertion: (Context, Map[String, Package]) => Unit): Unit = { - val c = compilerWithChecker(assertion) - val run = c.newRun - run.compileSources(sourceFiles) - } - - def checkFromTasty(tastyFiles: List[String], sources: List[SourceFile])(assertion: (Context, Map[String, Package]) => Unit): Unit = { - Directory.inTempDirectory { tmp => - val ctx = "shadow ctx" - val out = tmp./(Directory("out")) - out.createDirectory() - - val dotcCtx = { - val ctx = freshCtx(out.toString :: Nil) - ctx.setSetting(ctx.settings.outputDir, AbstractFile.getDirectory(out)) - } - val dotc = new Compiler - val run = dotc.newRun(using dotcCtx) - run.compileSources(sources) - assert(!dotcCtx.reporter.hasErrors) - - val fromTastyCtx = { - val ctx = freshCtx(out.toString :: Nil) - ctx.setSetting(ctx.settings.fromTasty, true) - } - val fromTastyCompiler = compilerWithChecker(assertion) - val fromTastyRun = fromTastyCompiler.newRun(using fromTastyCtx) - val outDir = new PlainDirectory(out) - val files = tastyFiles.map(outDir.fileNamed) - fromTastyRun.compile(files) - fromTastyCtx.reporter.allErrors.foreach(println) - assert(!fromTastyCtx.reporter.hasErrors) - } - } - - def check(tastyFiles: List[String], sources: List[SourceFile])(assertion: (Context, Map[String, Package]) => Unit): Unit - -} - -trait CheckFromSource extends DottyDocTest { - override def check(tastyFiles: List[String], sources: List[SourceFile])(assertion: (Context, Map[String, Package]) => Unit): Unit = { - checkFromSource(sources)(assertion) - } -} - -trait CheckFromTasty extends DottyDocTest { - override def check(tastyFiles: List[String], sources: List[SourceFile])(assertion: (Context, Map[String, Package]) => Unit): Unit = { - checkFromTasty(tastyFiles, sources)(assertion) - } -} diff --git a/doc-tool/test/dotty/tools/dottydoc/GenDocs.scala b/doc-tool/test/dotty/tools/dottydoc/GenDocs.scala deleted file mode 100644 index 95dcefbf16e9..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/GenDocs.scala +++ /dev/null @@ -1,37 +0,0 @@ -package dotty.tools -package dottydoc - -import vulpix.TestConfiguration - -object Files { - type JFile = java.io.File - - implicit class ToUrl(val f: JFile) extends AnyVal { - def getUrl = f.toURI.toURL - } -} - -trait LocalResources extends DocDriver { - import Files._ - - def getFiles(file: JFile): Array[JFile] = - if (file.isDirectory) file.listFiles.flatMap(getFiles) - else if (file.getAbsolutePath.endsWith(".scala")) Array(file) - else Array() - - def withClasspath(files: Array[String]) = - "-siteroot" +: "../docs" - +: "-project" +: "Dotty" - +: "-source" +: "3.0-migration" - +: "-classpath" +: TestConfiguration.basicClasspath - +: files -} - -object GenDottyDocs extends LocalResources { - import Files._ - - val dottyFiles = new JFile("../compiler/src/dotty").listFiles.flatMap(getFiles).map(_.getAbsolutePath) - - override def main(args: Array[String]): Unit = - super.main(withClasspath(dottyFiles)) -} diff --git a/doc-tool/test/dotty/tools/dottydoc/JavaConverterTest.scala b/doc-tool/test/dotty/tools/dottydoc/JavaConverterTest.scala deleted file mode 100644 index 795a9c08e0a3..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/JavaConverterTest.scala +++ /dev/null @@ -1,319 +0,0 @@ -package dotty.tools -package dottydoc - -import org.junit.Test -import org.junit.Assert._ - -import model.{ - Val, - Object => EObject, - CaseClass, - Entity, - Members, - SuperTypes, - Modifiers, - TypeParams, - Constructors => EConstructors, - Class, - Companion, - ReturnValue, - ImplicitlyAddedEntity, - TypeAlias, - Trait, - Package, - Def, - ParamList -} -import model.references._ -import model.internal.ParamListImpl -import dotty.tools.dotc.core.Symbols.NoSymbol -import java.util.{Map => JMap, List => JList} - -class JavaConverterTest { - import model.JavaConverters._ - import scala.collection.JavaConverters._ - - @Test def entityConversions = { - val paramList = new ParamListImpl(new NamedReference("x", new TypeReference("Int", new NoLink("title", "target"), List())) :: Nil, false) - val df = new Def { - def symbol = NoSymbol - def name = "test" - def path = "path" :: "to" :: "def" :: Nil - def comment = None - def annotations = List("test") - def parent = None - def modifiers = "private" :: Nil - def typeParams = "String" :: "String" :: Nil - def implicitlyAddedFrom = Some( - new TypeReference("String", new NoLink("title", "target"), List())) - def returnValue = new TypeReference("String", new NoLink("title", "target"), List()) - def paramLists = List(paramList) - } - assertSerializedCorrectly(df, df.asJava) - val trt = new Trait { - def symbol = NoSymbol - def name = "someTrait" - def path = "path" :: "to" :: "trait" :: Nil - def comment = None - def annotations = List("test") - def parent = None - def modifiers = "protected" :: Nil - def typeParams = "String" :: "String" :: Nil - def superTypes = new NoLink("title", "query") :: Nil - def members = df :: Nil - def traitParams = List(paramList) - def companionPath = "path" :: "to" :: "companion" :: Nil - def companionPath_=(xs: List[String]) = {} - } - assertSerializedCorrectly(trt, trt.asJava) - val cls = new Class { - def symbol = NoSymbol - def name = "test" - def path = "path" :: "to" :: "test" :: Nil - def comment = None - def annotations = List("test") - def parent = None - def modifiers = "private" :: Nil - def typeParams = "String" :: "String" :: Nil - def superTypes = new NoLink("title", "query") :: Nil - def members = Nil - def companionPath = "path" :: "to" :: "companion" :: Nil - def companionPath_=(xs: List[String]) = {} - def constructors = List(List(paramList)) - } - assertSerializedCorrectly(cls, cls.asJava) - val caseClass = new CaseClass { - def symbol = NoSymbol - def name = "test" - def path = "path" :: "to" :: "test" :: Nil - def comment = None - def annotations = List("test") - def parent = None - def modifiers = "private" :: Nil - def typeParams = "String" :: "String" :: Nil - def constructors = List(List(paramList)) - def superTypes = new NoLink("title", "query") :: Nil - def members = Nil - def companionPath = "path" :: "to" :: "companion" :: Nil - def companionPath_=(xs: List[String]) = {} - } - assertSerializedCorrectly(caseClass, caseClass.asJava) - val obj = new EObject { - def symbol = NoSymbol - def name = "someObject" - def path = "path" :: "to" :: "object" :: Nil - def comment = None - def annotations = List("test") - def parent = None - def modifiers = "protected" :: Nil - def typeParams = "String" :: "String" :: Nil - def superTypes = new NoLink("title", "query") :: Nil - def members = df :: Nil - def companionPath = "path" :: "to" :: "companion" :: Nil - def companionPath_=(xs: List[String]) = {} - } - assertSerializedCorrectly(obj, obj.asJava) - val typeAlias = new TypeAlias { - def symbol = NoSymbol - def name = "typeAlias" - def path = "path" :: "to" :: "typeAlias" :: Nil - def comment = None - def annotations = List("test") - def parent = None - def modifiers = "private" :: Nil - def typeParams = "String" :: "String" :: Nil - def alias = Some(new TypeReference("String", new NoLink("title", "target"), List())) - } - assertSerializedCorrectly(typeAlias, typeAlias.asJava) - val vl = new Val { - val kind = "val" - def symbol = NoSymbol - def name = "val" - def path = "path" :: "to" :: "val" :: Nil - def comment = None - def annotations = List("test") - def parent = None - def modifiers = "private" :: Nil - def returnValue = new TypeReference("String", new NoLink("title", "target"), List()) - def implicitlyAddedFrom = Some( - new TypeReference("String", new NoLink("title", "target"), List())) - } - assertSerializedCorrectly(vl, vl.asJava) - val pkg = new Package { - def symbol = NoSymbol - def name = "test" - def path = "path" :: "to" :: "test" :: Nil - def comment = None - def annotations = List("test") - def parent = None - def members = trt :: typeAlias :: Nil - def superTypes = new NoLink("title", "query") :: Nil - } - assertSerializedCorrectly(pkg, pkg.asJava) - } - - def assertEach[E, C[E] <: Seq[E]](expected: C[E], serialized: Any)(pairwiseAssertion: (E, Any) => Unit): Unit = { - val s = serialized.asInstanceOf[JList[_]] - val actual = s.asScala.toList - assertEquals(expected.length, actual.length) - for ((exp, act) <- expected zip actual) { - pairwiseAssertion(exp, act) - } - } - def assertSameSeq[T, C[T] <: Seq[T]](expected: C[T], serialized: Any): Unit = { - val actual = serialized.asInstanceOf[java.util.List[T]].asScala.toList - assertEquals(expected, actual); - } - def assertSerializedCorrectly(expected: ParamList, serialized: Any): Unit = { - val actual = serialized.asInstanceOf[JMap[String, _]] - assertEach(expected.list, actual.get("list")) {(exp, act) => - assertSerializedCorrectly(exp, act) - } - assertEquals(expected.isImplicit, actual.get("isImplicit")) - } - def assertSerializedCorrectly(expected: Reference, serialized: Any): Unit = { - val actual = serialized.asInstanceOf[JMap[String, _]] - expected match { - case TypeReference(title, tpeLink, paramLinks) => - assertEquals(title, actual.get("title")) - assertSerializedCorrectly(tpeLink, actual.get("tpeLink")) - assertEach(paramLinks, actual.get("paramLinks")) { (exp, act) => - assertSerializedCorrectly(exp, act) - } - case OrTypeReference(left, right) => - assertSerializedCorrectly(left, actual.get("left")) - assertSerializedCorrectly(right, actual.get("right")) - case AndTypeReference(left, right) => - assertSerializedCorrectly(left, actual.get("left")) - assertSerializedCorrectly(right, actual.get("right")) - case FunctionReference(args, returnValue, isImplicit) => - assertEquals(isImplicit, actual.get("isImplicit")) - assertEach(args, actual.get("args")) { (exp, act) => - assertSerializedCorrectly(exp, act) - } - assertSerializedCorrectly(returnValue, actual.get("returnValue")) - case TupleReference(args) => - assertEach(args, actual.get("args")) { (exp, act) => - assertSerializedCorrectly(exp, act) - } - case BoundsReference(low, high) => - assertSerializedCorrectly(low, actual.get("low")) - assertSerializedCorrectly(high, actual.get("high")) - case NamedReference(title, ref, isByName, isRepeated) => - assertEquals(title, actual.get("title")) - assertSerializedCorrectly(ref, actual.get("ref")) - assertEquals(isByName, actual.get("isByName")) - assertEquals(isRepeated, actual.get("isRepeated")) - case ConstantReference(title) => - assertEquals(title, actual.get("title")) - case EmptyReference => - } - } - def assertSerializedCorrectly(expected: MaterializableLink, serialized: Any): Unit = { - val actual = serialized.asInstanceOf[JMap[String, _]] - expected match { - case UnsetLink(title, query) => - assertEquals(title, actual.get("title")) - assertEquals(query, actual.get("query")) - case MaterializedLink(title, target) => - assertEquals(title, actual.get("title")) - assertEquals(target, actual.get("target")) - case NoLink(title, target) => - assertEquals(title, actual.get("title")) - assertEquals(target, actual.get("target")) - } - } - def assertSerializedCorrectly(expected: Entity, serialized: Any): Unit = { - val actual = serialized.asInstanceOf[JMap[String, _]] - assertEquals(expected.name, actual.get("name")) - assertEquals(expected.kind, actual.get("kind")) - assertSameSeq(expected.annotations, actual.get("annotations")) - assertSameSeq(expected.path, actual.get("path")) - // Only test if a comment is present - expected.comment match { - case Some(c) => assertNotEquals(null, actual.get("comment")) - case _ => - } - expected match { - case e: Members => { - assertEach(e.members, actual.get("members")) { (exp, act) => - assertSerializedCorrectly(exp, act) - } - } - case _ => - } - expected match { - case e: SuperTypes => { - assertEach(e.superTypes, actual.get("superTypes")) { (exp, act) => - assertSerializedCorrectly(exp, act) - } - } - case _ => - } - expected match { - case e: Modifiers => { - assertSameSeq(e.modifiers, actual.get("modifiers")) - assertEquals(e.isPrivate, actual.get("isPrivate")) - assertEquals(e.isProtected, actual.get("isProtected")) - } - case _ => - } - expected match { - case e: TypeParams => { - assertSameSeq(e.typeParams, actual.get("typeParams")) - } - case _ => - } - expected match { - case e: EConstructors => { - // constructors is of type List[List[ParamList]], so we need to apply assertEach twice - assertEach(e.constructors, actual.get("constructors")) { (exp, act) => - assertEach(exp, act) { (exp, act) => - assertSerializedCorrectly(exp, act) - } - } - } - case _ => - } - expected match { - case e: Companion => { - assertSameSeq(e.companionPath, actual.get("companionPath")) - } - case _ => - } - expected match { - case e: ReturnValue => { - assertSerializedCorrectly(e.returnValue, actual.get("returnValue")) - } - case _ => - } - expected match { - case e: ImplicitlyAddedEntity => { - e.implicitlyAddedFrom.map(assertSerializedCorrectly(_, actual.get("implicitlyAddedFrom"))) - } - case _ => - } - expected match { - case e: TypeAlias => { - e.alias.map(assertSerializedCorrectly(_, actual.get("alias"))) - } - case _ => - } - expected match { - case e: Def => { - assertEach(e.paramLists, actual.get("paramLists")) { (exp, act) => - assertSerializedCorrectly(exp, act) - } - } - case _ => - } - expected match { - case e: Trait => { - assertEach(e.traitParams, actual.get("traitParams")) { (exp, act) => - assertSerializedCorrectly(exp, act) - } - } - case _ => - } - } -} diff --git a/doc-tool/test/dotty/tools/dottydoc/MarkdownTests.scala b/doc-tool/test/dotty/tools/dottydoc/MarkdownTests.scala deleted file mode 100644 index 1fb506ce5a25..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/MarkdownTests.scala +++ /dev/null @@ -1,311 +0,0 @@ -package dotty.tools -package dottydoc - -import vulpix.TestConfiguration - -import org.junit.Test -import org.junit.Assert._ - -import dotc.core.Contexts.{ Context, ContextBase, FreshContext } -import dotc.core.Comments.{ ContextDoc, ContextDocstrings } -import dottydoc.core.ContextDottydoc - -class MarkdownTests extends DottyDocTest with CheckFromSource { - override implicit val ctx: FreshContext = { - // TODO: check if can reuse parent instead of copy-paste - val base = new ContextBase - import base.settings._ - val ctx = base.initialCtx.fresh - ctx.setSetting(ctx.settings.language, List("Scala2")) - ctx.setSetting(ctx.settings.YcookComments, true) - ctx.setSetting(ctx.settings.Ycheck, "all" :: Nil) - // No wiki syntax! - ctx.setSetting(ctx.settings.wikiSyntax, false) - ctx.setProperty(ContextDoc, new ContextDottydoc) - ctx.setSetting( - ctx.settings.classpath, - TestConfiguration.basicClasspath - ) - base.initialize()(using ctx) - ctx - } - - @Test def simpleMarkdown = { - val source = - """ - |package scala - | - |/** *Hello*, world! */ - |trait HelloWorld - """.stripMargin - - checkSource(source) { (ctx, packages) => - val traitCmt = - packages("scala") - .children.find(_.path.mkString(".") == "scala.HelloWorld") - .flatMap(_.comment.map(_.body)) - .get - .trim - - assertEquals("<p><em>Hello</em>, world!</p>", traitCmt) - } - } - - @Test def outerLink = { - val source = - """ - |package scala - | - |/** [out](http://www.google.com) */ - |trait HelloWorld - """.stripMargin - - checkSource(source) { (ctx, packages) => - val traitCmt = - packages("scala") - .children.find(_.path.mkString(".") == "scala.HelloWorld") - .flatMap(_.comment.map(_.body)) - .get - .trim - - assertEquals("""<p><a href="http://www.google.com">out</a></p>""", traitCmt) - } - } - - @Test def relativeLink = { - val source = - """ - |package scala - | - |/** [None](./None.html) */ - |trait HelloWorld - | - |trait None - """.stripMargin - - checkSource(source) { (ctx, packages) => - val traitCmt = - packages("scala") - .children.find(_.path.mkString(".") == "scala.HelloWorld") - .flatMap(_.comment.map(_.body)) - .get - .trim - - assertEquals("""<p><a href="./None.html">None</a></p>""", traitCmt) - } - } - - @Test def absoluteLink = { - val source = - """ - |package scala - | - |/** [None](scala.None) */ - |trait HelloWorld - | - |trait None - """.stripMargin - - checkSource(source) { (ctx, packages) => - val traitCmt = - packages("scala") - .children.find(_.path.mkString(".") == "scala.HelloWorld") - .flatMap(_.comment.map(_.body)) - .get - .trim - - assertEquals("""<p><a href="../scala/None.html">None</a></p>""", traitCmt) - } - } - - @Test def handleLists = { - val source = - """ - |package scala - | - |/** - Item1 - | * - Item2 - | * - Item3 - | */ - |trait HelloWorld - | - |trait None - """.stripMargin - - checkSource(source) { (ctx, packages) => - val traitCmt = - packages("scala") - .children.find(_.path.mkString(".") == "scala.HelloWorld") - .flatMap(_.comment.map(_.body)) - .get - .trim - - assertEquals( - """|<ul> - |<li>Item1</li> - |<li>Item2</li> - |<li>Item3</li> - |</ul>""".stripMargin, traitCmt) - } - } - - @Test def handleNestedLists = { - val source = - """ - |package scala - | - |/** - Item1 - | * - Item1a - | * - Item1b - | * - Item2 - | * - Item3 - | */ - |trait HelloWorld - | - |trait None - """.stripMargin - - checkSource(source) { (ctx, packages) => - val traitCmt = - packages("scala") - .children.find(_.path.mkString(".") == "scala.HelloWorld") - .flatMap(_.comment.map(_.body)) - .get - .trim - - assertEquals( - """|<ul> - |<li>Item1 - |<ul> - |<li>Item1a</li> - |<li>Item1b</li> - |</ul> - |</li> - |<li>Item2</li> - |<li>Item3</li> - |</ul>""".stripMargin, traitCmt) - } - } - - @Test def handleCodeBlock = { - val source = - """ - |package scala - | - |/** ```scala - | * val x = 1 + 5 - | * ``` - | */ - |trait HelloWorld - | - |trait None - """.stripMargin - - checkSource(source) { (ctx, packages) => - val traitCmt = - packages("scala") - .children.find(_.path.mkString(".") == "scala.HelloWorld") - .flatMap(_.comment.map(_.body)) - .get - .trim - - assertEquals( - """|<pre><code class="scala">val x = 1 + 5 - |</code></pre>""".stripMargin, traitCmt) - } - } - - @Test def handleCodeBlockJavaDocstring = { - // the following works, but not when the start of the codeblock is on the - // first line - val source = - """ - |package scala - | - |/** - | * ```scala - | * val x = 1 + 5 - | * ``` - | */ - |trait HelloWorld - | - |trait None - """.stripMargin - - checkSource(source) { (ctx, packages) => - val traitCmt = - packages("scala") - .children.find(_.path.mkString(".") == "scala.HelloWorld") - .flatMap(_.comment.map(_.body)) - .get - .trim - - assertEquals( - """|<pre><code class="scala">val x = 1 + 5 - |</code></pre>""".stripMargin, traitCmt) - } - } - - @Test def docstringSummary = { - val source = - """ - |package scala - | - |/** This - | * ==== - | * is a short text [that](http://google.com) should not be more than a - | * `few` lines long. This text *should* be shortened somewhere that is - | * appropriate for the **ui**. Might be here, or there or somewhere - | * else. - | */ - |trait HelloWorld - """.stripMargin - - checkSource(source) { (ctx, packages) => - val traitCmt = - packages("scala") - .children.find(_.path.mkString(".") == "scala.HelloWorld") - .flatMap(_.comment.map(_.short)) - .get - .trim - - assert( - traitCmt.endsWith("Might be here...\n</p>"), - s"""|docstring summary should strip the following docstring so that it ends in "Might be here..." - | - |$traitCmt""".stripMargin - ) - } - } - - @Test def docstringSummaryWithImage = { - val source = - """ - |package scala - | - |/** This - | * ==== - | * should quit before ![alt text](https://whatever.com/1.png "Img Text"), - | * I shouldn't be visible. - | */ - |trait HelloWorld - """.stripMargin - - checkSource(source) { (ctx, packages) => - val traitCmt = - packages("scala") - .children.find(_.path.mkString(".") == "scala.HelloWorld") - .flatMap(_.comment.map(_.short)) - .get - .trim - - assert( - !traitCmt.contains("<img") && - !traitCmt.contains("I shouldn't be visible."), - s"""|docstring summary shouldn't contain image, error in `MarkdownShortener.scala` - | - |$traitCmt""".stripMargin) - } - - } -} diff --git a/doc-tool/test/dotty/tools/dottydoc/PackageStructure.scala b/doc-tool/test/dotty/tools/dottydoc/PackageStructure.scala deleted file mode 100644 index 152ef13ca29e..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/PackageStructure.scala +++ /dev/null @@ -1,108 +0,0 @@ -package dotty.tools -package dottydoc - -import org.junit.Test -import org.junit.Assert._ -import dotc.util.SourceFile -import model.Trait -import model.internal._ - -class PackageStructureFromSourceTest extends PackageStructureBase with CheckFromSource -class PackageStructureFromTastyTest extends PackageStructureBase with CheckFromTasty - -abstract class PackageStructureBase extends DottyDocTest { - - @Test def sourceFileAnnotIsStripped = { - val source = SourceUtil.makeTemp( - """package scala - | - |/** Some doc */ - |trait A - """.stripMargin - ) - - val tastyFile = "scala/A.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(trt: Trait), _, _, _, _) => - assert(trt.annotations.isEmpty) - } - } - } - - @Test def multipleCompilationUnits = { - val source1 = SourceUtil.makeTemp( - """ - |package scala - | - |trait A - """.stripMargin - ) - - val source2 = SourceUtil.makeTemp( - """ - |package scala - | - |trait B - """.stripMargin - ) - - val tastyFiles = "scala/A.tasty" :: "scala/B.tasty" :: Nil - - check(tastyFiles, source1 :: source2 :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(tA, tB), _, _, _, _) => - assert( - tA.name == "A" && tB.name == "B", - s"trait A had name '${tA.name}' and trait B had name '${tB.name}'" - ) - case _ => fail("Incorrect package structure after run") - } - } - } - - - @Test def multiplePackages = { - val source1 = SourceUtil.makeTemp( - """ - |package scala - |package collection - | - |trait A - """.stripMargin) - - val source2 = SourceUtil.makeTemp( - """ - |package scala - |package collection - | - |trait B - """.stripMargin) - - val tastyFiles = "scala/collection/A.tasty" :: "scala/collection/B.tasty" :: Nil - - check(tastyFiles, source1 :: source2 :: Nil) { (ctx, packages) => - packages("scala.collection") match { - case PackageImpl(_, _, "scala.collection", List(tA, tB), _, _, _, _) => - assert( - tA.name == "A" && tB.name == "B", - s"trait A had name '${tA.name}' and trait B had name '${tB.name}'" - ) - - case _ => - fail(s"""Incorrect package structure for 'scala' package: ${packages("scala")}""") - } - - packages("scala.collection") match { - case PackageImpl(_, _, "scala.collection", List(tA, tB), _, _, _, _) => - assert( - tA.name == "A" && tB.name == "B", - s"trait A had name '${tA.name}' and trait B had name '${tB.name}'" - ) - - case _ => fail("Incorrect package structure for 'scala.collection' package") - } - } - } -} diff --git a/doc-tool/test/dotty/tools/dottydoc/SettingsTests.scala b/doc-tool/test/dotty/tools/dottydoc/SettingsTests.scala deleted file mode 100644 index 2ee945953a80..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/SettingsTests.scala +++ /dev/null @@ -1,18 +0,0 @@ -package dotty.tools -package dottydoc - -import org.junit.Test -import org.junit.Assert._ - -class SettingsTests { - - @Test def t8124: Unit = { - val source = "tests/pos/Foo.scala" - val url = "https://github.com/lampepfl/dotty/tree/master/tests" - val options = Array("-project", "-project-url", url, source) - val reporter = Main.process(options) - assertEquals(2, reporter.errorCount) - assertEquals("missing argument for option -project", reporter.allErrors.last.message) - } - -} diff --git a/doc-tool/test/dotty/tools/dottydoc/SimpleComments.scala b/doc-tool/test/dotty/tools/dottydoc/SimpleComments.scala deleted file mode 100644 index 56c35b0738a1..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/SimpleComments.scala +++ /dev/null @@ -1,74 +0,0 @@ -package dotty.tools -package dottydoc - -import model.internal._ -import dotc.util.SourceFile -import dotty.tools.io._ - -import org.junit.Test -import org.junit.Assert._ - -class SimpleCommentsFromSourceTest extends SimpleCommentsBase with CheckFromSource -class SimpleCommentsFromTastyTest extends SimpleCommentsBase with CheckFromTasty - -abstract class SimpleCommentsBase extends DottyDocTest { - - @Test def cookCommentEmptyClass = { - val source = - """ - |package scala - | - |/** - | * An empty trait: $Variable - | * - | * @define Variable foobar - | */ - |trait Test""".stripMargin - - checkSource(source) { (_, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(trt), _, _, _, _) => - assert(trt.comment.isDefined, "Lost comment in transformations") - assert(trt.comment.get.body.contains("An empty trait: foobar")) - assert(trt.name == "Test", s"Incorrect name after transform: ${trt.name}") - } - } - } - - @Test def simpleComment = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |/** Hello, world! */ - |trait HelloWorld - """.stripMargin - ) - - - val tastyFile = "scala/HelloWorld.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - val traitCmt = - packages("scala") - .children.find(_.path.mkString(".") == "scala.HelloWorld") - .flatMap(_.comment.map(_.body)) - .get - - assertEquals(traitCmt, "<p>Hello, world!</p>") - } - } - - @Test def commentOnPackageObject = { - val source = - """ - |/** Hello, world! */ - |package object foobar { class A } - """.stripMargin - - checkSource(source) { (_, packages) => - val packageCmt = packages("foobar").comment.get.body - assertEquals("<p>Hello, world!</p>", packageCmt) - } - } -} diff --git a/doc-tool/test/dotty/tools/dottydoc/SourceUtil.scala b/doc-tool/test/dotty/tools/dottydoc/SourceUtil.scala deleted file mode 100644 index eef86f5da9d2..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/SourceUtil.scala +++ /dev/null @@ -1,18 +0,0 @@ -package dotty.tools.dottydoc - -import dotty.tools.dotc.util.SourceFile -import dotty.tools.io.{Path, PlainFile} - -object SourceUtil { - - /** Create a temporary `.scala` source file with the given content */ - def makeTemp(content: String): SourceFile = { - val tempFile = java.io.File.createTempFile("dottydoc-test-", ".scala") - tempFile.deleteOnExit() - val file = new PlainFile(Path(tempFile.toPath)) - val out = file.output - out.write(content.getBytes) - new SourceFile(file, scala.io.Codec.UTF8) - } - -} diff --git a/doc-tool/test/dotty/tools/dottydoc/TypeRendering.scala b/doc-tool/test/dotty/tools/dottydoc/TypeRendering.scala deleted file mode 100644 index 5e4d50274ac3..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/TypeRendering.scala +++ /dev/null @@ -1,51 +0,0 @@ -package dotty.tools -package dottydoc - -import dotty.tools.dotc.util.SourceFile -import dotty.tools.dottydoc.model._ -import dotty.tools.dottydoc.model.internal._ -import dotty.tools.dottydoc.model.references._ - -import org.junit.Test -import org.junit.Assert.{assertTrue, fail} - -class TypeRenderingTestFromTasty extends TypeRenderingTest with CheckFromTasty -class TypeRenderingTestFromSource extends TypeRenderingTest with CheckFromSource -abstract class TypeRenderingTest extends DottyDocTest { - @Test def renderImplicitFunctionType = { - val source = SourceFile.virtual( - "ImplicitFunctionType.scala", - """ - |package scala - | - |trait Test { - | def a: implicit Int => Int = ??? - | def b(x: implicit Int => Int) = ??? - | type c = implicit Int => Int - |} - """.stripMargin - ) - - def checkImplicitFunctionType(ref: Reference) = ref match { - case FunctionReference(_, _, isImplicit) => - assertTrue("Should be an implicit function type", isImplicit) - case _ => - fail("Unexpected: " + ref) - } - - checkFromSource(source :: Nil) { case (_, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(trt: Trait), _, _, _, _) => - val List(a: Def, b: Def, c: TypeAlias) = trt.members.sortBy(_.name) - checkImplicitFunctionType(a.returnValue) - b.paramLists.head.list.head match { - case NamedReference("x", ref, _, _) => - checkImplicitFunctionType(ref) - case _ => - fail("Unexpected: " + b.paramLists.head.list.head) - } - checkImplicitFunctionType(c.alias.get) - } - } - } -} diff --git a/doc-tool/test/dotty/tools/dottydoc/UsecaseTest.scala b/doc-tool/test/dotty/tools/dottydoc/UsecaseTest.scala deleted file mode 100644 index 681c0773e6f0..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/UsecaseTest.scala +++ /dev/null @@ -1,269 +0,0 @@ -package dotty.tools -package dottydoc - -import org.junit.Test -import org.junit.Assert._ - -import dotc.util.SourceFile -import model._ -import model.internal._ -import model.references._ -import util.syntax._ - -class UsecaseFromSourceTest extends UsecaseBase with CheckFromSource -class UsecaseFromTastyTest extends UsecaseBase with CheckFromTasty - -abstract class UsecaseBase extends DottyDocTest { - @Test def simpleUsecase = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |trait Test[A] { - | /** Definition with a "disturbing" signature - | * - | * @usecase def foo: A - | */ - | def foo[B]: A => B - |} - """.stripMargin - ) - - val tastyFile = "scala/Test.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(trt: Trait), _, _, _, _) => - val List(foo: Def) = trt.members - - assert(foo.comment.isDefined, "Lost comment in transformations") - - val returnValue = foo.returnValue match { - case ref: TypeReference => ref.title - case _ => - assert( - false, - "Incorrect return value after usecase transformation" - ) - "" - } - - assert( - foo.typeParams.isEmpty, - "Type parameters were not stripped by usecase" - ) - assert(returnValue == "A", "Incorrect return type after usecase") - - assert(foo.name == "foo", s"Incorrect name after transform: ${foo.name}") - } - } - } - - @Test def simpleUsecaseAddedArg = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |trait Test[A] { - | /** Definition with a "disturbing" signature - | * - | * @usecase def foo(a: A): A - | */ - | def foo[B]: A => B - |} - """.stripMargin - ) - - val tastyFile = "scala/Test.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(trt: Trait), _, _, _, _) => - val List(foo: Def) = trt.members - - val returnValue = foo.returnValue match { - case ref: TypeReference => ref.title - case _ => - assert( - false, - "Incorrect return value after usecase transformation" - ) - "" - } - - assert( - foo.typeParams.isEmpty, - "Type parameters were not stripped by usecase" - ) - assert(returnValue == "A", "Incorrect return type after usecase") - assert( - foo.paramLists.head.list.head.title == "a", - "Incorrect parameter to function after usecase transformation" - ) - assert(foo.name == "foo", s"Incorrect name after transform: ${foo.name}") - } - } - } - - @Test def simpleTparamUsecase = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |trait Test[A] { - | /** Definition with a "disturbing" signature - | * - | * @usecase def foo[C]: A - | */ - | def foo[B]: A => B - |} - """.stripMargin - ) - - val tastyFile = "scala/Test.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(trt: Trait), _, _, _, _) => - val List(foo: Def) = trt.members - - val returnValue = foo.returnValue match { - case ref: TypeReference => ref.title - case _ => - assert( - false, - "Incorrect return value after usecase transformation" - ) - "" - } - - assert( - foo.typeParams.nonEmpty, - "Type parameters were incorrectly stripped by usecase" - ) - - assert(foo.typeParams.head == "C", "Incorrectly switched tparam") - assert(returnValue == "A", "Incorrect return type after usecase") - - assert(foo.name == "foo", s"Incorrect name after transform: ${foo.name}") - } - } - } - - @Test def expandColl = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |/** The trait $Coll - | * - | * @define Coll Iterable - | */ - |trait Iterable[A] { - | /** Definition with a "disturbing" signature - | * - | * @usecase def map[B](f: A => B): $Coll[B] - | */ - | def map[B, M[B]](f: A => B): M[B] = ??? - |} - """.stripMargin - ) - - val tastyFile = "scala/Iterable.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(trt: Trait), _, _, _, _) => - val List(map: Def) = trt.members - - val returnValue = map.returnValue match { - case ref: TypeReference => ref.title - case _ => - assert( - false, - "Incorrect return value after usecase transformation" - ) - "" - } - - assert( - returnValue == "Iterable", - "Incorrect return type after usecase transformation" - ) - } - } - } - - @Test def checkStripping = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |/** The trait $Coll - | * - | * @define Coll Iterable - | */ - |trait Iterable[A] { - | /** Definition with a "disturbing" signature - | * - | * @usecase def map[B](f: A => B): $Coll[B] - | */ - | def map[B, M[B]](f: A => B): M[B] = ??? - |} - """.stripMargin - ) - - val tastyFile = "scala/Iterable.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(trt: Trait), _, _, _, _) => - val List(map: Def) = trt.members - assert(map.comment.isDefined, "Lost comment in transformations") - - val docstr = ctx.docbase.docstring(map.symbol).get.expandedBody.get - assert( - !docstr.contains("@usecase"), - s"Comment should not contain usecase after stripping, but was:\n$docstr" - ) - } - } - } - - @Test def multipleUseCases: Unit = { - val source = SourceUtil.makeTemp( - """ - |package scala - | - |trait Test { - | /** A first method - | * @usecase def foo(x: Int): Int - | * @usecase def foo(x: Double): Double - | */ - | def foo(x: String): Unit - |} - """.stripMargin - ) - - val tastyFile = "scala/Test.tasty" - - check(tastyFile :: Nil, source :: Nil) { (ctx, packages) => - packages("scala") match { - case PackageImpl(_, _, _, List(trt: Trait), _, _, _, _) => - val List(foo0: Def, foo1: Def) = trt.members - assertEquals(TypeReference("Int", NoLink("Int", "scala.Int"), Nil), foo0.returnValue) - assertEquals(TypeReference("Double", NoLink("Double", "scala.Double"), Nil), foo1.returnValue) - } - } - } - - @Test def checkIterator = - checkFiles("../tests/scala2-library/src/library/scala/collection/Iterator.scala" :: Nil) { case _ => - // success if typer throws no errors! :) - } - - @Test def checkIterableLike = - checkFiles("../tests/scala2-library/src/library/scala/collection/IterableLike.scala" :: Nil) { case _ => - // success if typer throws no errors! :) - } -} diff --git a/doc-tool/test/dotty/tools/dottydoc/staticsite/PageTests.scala b/doc-tool/test/dotty/tools/dottydoc/staticsite/PageTests.scala deleted file mode 100644 index 7ef28ba7ad7c..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/staticsite/PageTests.scala +++ /dev/null @@ -1,102 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import org.junit.Test -import org.junit.Assert._ - -class PageTests extends DottyDocTest with SourceFileOps with CheckFromSource { - import scala.collection.JavaConverters._ - - @Test def mdHas1Key = { - val page = markdownPage( - """|--- - |key: - |--- - | - |great""".stripMargin - ) - - assert( - page.yaml == Map("key" -> List.empty.asJava), - s"""incorrect yaml, expected "key:" without key in: ${page.yaml}""" - ) - - assertEquals("<p>great</p>\n", page.html.get) - } - - @Test def yamlPreservesLiquidTags = { - val page1 = markdownPage( - """|--- - |key: - |--- - | - |{{ content }}""".stripMargin, - params = Map("content" -> "Hello, world!") - ) - - assert( - page1.yaml == Map("key" -> List.empty.asJava), - s"""incorrect yaml, expected "key:" without key in: ${page1.yaml}""" - ) - - assertEquals("<p>Hello, world!</p>\n", page1.html.get) - - val page2 = markdownPage( - """|{{ content }}""".stripMargin, - params = Map("content" -> "hello") - ) - assert( - page2.yaml == Map(), - s"""incorrect yaml, expected "key:" without key in: ${page2.yaml}""" - ) - assertEquals("<p>hello</p>\n", page2.html.get) - - val page3 = markdownPage( - """|{% if product.title == "Awesome Shoes" %} - |These shoes are awesome! - |{% endif %}""".stripMargin, - params = Map("product" -> Map("title" -> "Awesome Shoes").asJava) - ) - - assertEquals( - "<p>These shoes are awesome!</p>\n", - page3.html.get - ) - } - - @Test def simpleHtmlPage = { - val p1 = htmlPage("""<h1>{{ "hello, world!" }}</h1>""") - assert(p1.yaml == Map(), "non-empty yaml found") - assertEquals("<h1>hello, world!</h1>", p1.html.get) - } - - @Test def htmlPageHasNoYaml = { - val page = htmlPage( - """|--- - |layout: main - |--- - | - |Hello, world!""".stripMargin - ) - - assert(!page.html.get.contains("---\nlayout: main\n---"), - s"page still contains yaml:\n${page.html.get}") - } - - @Test def illegalYamlFrontMatter = try { - val page = htmlPage( - """|--- - |layout: main - | - | - |Hello, world!""".stripMargin - ) - - page.html.get - fail("illegal front matter didn't throw exception") - } catch { - case IllegalFrontMatter(x) => // success! - case t: Throwable => throw t - } -} diff --git a/doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala b/doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala deleted file mode 100644 index b2c979d1d258..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala +++ /dev/null @@ -1,116 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import org.junit.Test -import org.junit.Assert._ - -class SiteTests extends DottyDocTest with SourceFileOps with CheckFromSource { - @Test def hasCorrectLayoutFiles = { - assert(site.root.exists && site.root.isDirectory, - s"'${site.root.getName}' is not a directory") - - val expectedLayouts = Set("base", "main", "index", "blog-page", "doc-page", "api-page", "search") - assert(site.layouts.keys == expectedLayouts, - s"Incorrect layouts in: ${site.layouts.keys}, expected: $expectedLayouts") - } - - @Test def renderHelloInMainLayout = { - val renderedPage = site.render(htmlPage( - """|--- - |layout: main - |--- - | - |Hello, world!""".stripMargin - ), Map.empty).get - - assert( - renderedPage.contains("Hello, world!") && - !renderedPage.contains("---\nlayout: main\n---\n") && - renderedPage.contains("<!DOCTYPE html>"), - "html page did not render properly" - ) - } - - @Test def renderMultipleTemplates = { - val renderedPage = site.render(htmlPage( - """|--- - |layout: index - |--- - |Hello, world!""".stripMargin - ), Map.empty).get - - assert( - renderedPage.contains("<h1>Hello, world!</h1>") && - !renderedPage.contains("---\nlayout: main\n---\n") && - !renderedPage.contains("---\nlayout: index\n---\n") && - renderedPage.contains("<!DOCTYPE html>"), - "html page did not render properly" - ) - } - - @Test def preservesPageYaml = { - val renderedPage = site.render(htmlPage( - """|--- - |title: Hello, world - |layout: index - |--- - |Hello, world!""".stripMargin - ), Map.empty).get - - assert( - renderedPage.contains("<h1>Hello, world!</h1>") && - !renderedPage.contains("---\nlayout: main\n---\n") && - !renderedPage.contains("---\nlayout: index\n---\n") && - renderedPage.contains("<title>Hello, world") && - renderedPage.contains(""), - "html page did not render properly:\n" + renderedPage - ) - } - - @Test def include = { - val renderedInclude = site.render( - htmlPage("""{% include "header.html" %}""", includes = site.includes), - Map.empty - ).get - - assertEquals("

Some header

\n", renderedInclude) - } - - @Test def siteStructure = { - val assets = site.staticAssets.map(site.stripRoot(_).replace('\\','/')).toSet - val compd = site.compilableFiles.map(site.stripRoot(_).replace('\\','/')).toSet - - val expectedAssets = Set( - "css/bootstrap.min.css", - "css/color-brewer.css", - "css/dottydoc.css", - "css/search.css", - "css/sidebar.css", - "css/toolbar.css", - "images/scala3-logo-white.svg", - "images/scala3-logo.svg", - "images/scala-logo-white.svg", - "images/scala-logo.svg", - "js/api-search.js", - "js/bootstrap.min.js", - "js/dottydoc.js", - "js/highlight.pack.js", - "js/jquery.min.js", - "js/sidebar.js", - "js/toolbar.js" - ) - val expectedCompd = Set( - // Directories starting in `_` are not included in compilable files - "index.md" - ) - - def printSet(xs: Set[String]): String = - xs.toList.sorted.mkString("\n{\n ", ",\n ", "\n}") - - assert(expectedAssets == assets, - s"assets incorrect, found: ${ printSet(assets) } - expected ${ printSet(expectedAssets) }") - assert(expectedCompd == compd, - s"compilable files incorrect, found: ${ printSet(compd) } - expected ${ printSet(expectedCompd) }") - } -} diff --git a/doc-tool/test/dotty/tools/dottydoc/staticsite/SourceFileOps.scala b/doc-tool/test/dotty/tools/dottydoc/staticsite/SourceFileOps.scala deleted file mode 100644 index 698c9ffc93ed..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/staticsite/SourceFileOps.scala +++ /dev/null @@ -1,59 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import dotc.util.SourceFile -import io.VirtualFile - -import model.Package - -import java.io.{ BufferedWriter, OutputStreamWriter } -import java.nio.charset.StandardCharsets - -import scala.io.Codec - - -trait SourceFileOps { - import scala.collection.JavaConverters._ - val siteRoot = new java.io.File("doc-tool/resources/") - val site = new Site( - siteRoot, new java.io.File(siteRoot, "_site"), - "test-site", "v0.1", Some("http://github.com/lampepfl/dotty"), None, Map.empty, "/" - ) - - def stringToSource(path: String, sourceCode: String): SourceFile = { - val virtualFile = new VirtualFile(path, path) - val writer = new BufferedWriter(new OutputStreamWriter(virtualFile.output, StandardCharsets.UTF_8.name)) - writer.write(sourceCode) - writer.close() - - new SourceFile(virtualFile, Codec.UTF8) - } - - def markdownPage( - sourceCode: String, - path: String = "test-page", - params: Map[String, AnyRef] = Map.empty, - includes: Map[String, Include] = Map.empty, - docs: Map[String, Package] = Map.empty - ) = new MarkdownPage( - path, - stringToSource(path, sourceCode), - params, - includes, - docs - ) - - def htmlPage( - sourceCode: String, - path: String = "test-page", - params: Map[String, AnyRef] = Map.empty, - includes: Map[String, Include] = Map.empty, - docs: Map[String, Package] = Map.empty - ) = new HtmlPage( - path, - stringToSource(path, sourceCode), - params, - includes - ) -} diff --git a/doc-tool/test/dotty/tools/dottydoc/staticsite/TemplateErrorTests.scala b/doc-tool/test/dotty/tools/dottydoc/staticsite/TemplateErrorTests.scala deleted file mode 100644 index 42518cae99ad..000000000000 --- a/doc-tool/test/dotty/tools/dottydoc/staticsite/TemplateErrorTests.scala +++ /dev/null @@ -1,32 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import org.junit.Test -import org.junit.Assert._ - -class TemplateErrorTests extends DottyDocTest with SourceFileOps with CheckFromSource { - @Test def unclosedTag: Unit = { - htmlPage( - """|Yo dawg: - |{% include "stuff" - |I heard you like to include stuff""".stripMargin - ).html - } - - @Test def missingEndif: Unit = { - htmlPage( - """|{% if someStuff %} - |Dude - |""".stripMargin - ).html - } - - @Test def nonExistingTag: Unit = { - htmlPage( - """|{% someStuff 'ofDude' %} - |Dude - |""".stripMargin - ).html - } -} diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index 6f8e43ce5ec4..000000000000 --- a/docs/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# Jekyll specific ignores -vendor/ -.bundle/ -Gemfile.lock -_site/ -.sass-cache/ diff --git a/docs/_includes/features.html b/docs/_includes/features.html deleted file mode 100644 index 0396d7278f0f..000000000000 --- a/docs/_includes/features.html +++ /dev/null @@ -1,123 +0,0 @@ -
-
-

So, features?

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Intersection TypesImplemented
Union TypesImplemented
Type lambdasImplemented
Context queryImplemented
Trait parametersImplemented
Implied InstancesImplemented
Inferable parametersImplemented
Extension MethodsImplemented
Opaque Type AliasesImplemented
Toplevel definitionsImplemented
Export clausesImplemented
Vararg patternsImplemented
Creator applicationsImplemented
@static methods and fieldsImplemented
SBT incremental buildImplemented
Option-less pattern matchingImplemented
Multiversal equalityImplemented
Erased TermsImplemented
Auto-SpecializationIn progress
Whole program optimizerIn progress
HList & HMaps/Record typesIn progress
EffectsConsidered
…and many more, check the overview page for a comprehensive list
-
-

Talks on Dotty?

- -

I have more questions!

-
-

That’s great! We have more details on the docs and please join our Gitter channel!

-
-
-
-
diff --git a/docs/_includes/getting-started.html b/docs/_includes/getting-started.html deleted file mode 100644 index c52c3e110203..000000000000 --- a/docs/_includes/getting-started.html +++ /dev/null @@ -1,28 +0,0 @@ -
-
- -

Try Dotty

-

If you are a Mac user, you can install Dotty with brew:

-
brew install lampepfl/brew/dotty
- -

If you are a Linux or Windows user, download the latest release. Optionally add path of the folder bin/ to the system environment variable PATH.

- -

Now you can compile Scala source code:

-
scalac hello.scala
- -

To start the REPL, run: scala.

- -

Or, you can try Dotty in your browser with Scastie.

- -

Create a Dotty Project

-

The fastest way to create a new project in Dotty is using sbt (1.1.4+).

- -

Create a Dotty project:

-
sbt new scala/scala3.g8
- -

Or a Dotty project that cross compiles with Scala 2:

-
sbt new scala/scala3-cross.g8
- -

For documentation see the Dotty Example Project.

-
-
diff --git a/docs/_includes/logo-page.html b/docs/_includes/logo-page.html deleted file mode 100644 index b580bea99843..000000000000 --- a/docs/_includes/logo-page.html +++ /dev/null @@ -1,43 +0,0 @@ -
-
- -
-
-
- logo -
-

Dotty

-

A next-generation compiler for Scala

-

(scroll down for more info)

-
-
-
-
diff --git a/docs/_includes/table-of-contents.html b/docs/_includes/table-of-contents.html deleted file mode 100644 index 4b2183bd3225..000000000000 --- a/docs/_includes/table-of-contents.html +++ /dev/null @@ -1,15 +0,0 @@ -
    - {% for item in titles %} -
  • - {% if item.url %} - {{ item.title }} - {% else %} - {{ item.title }} - {% endif %} - {% if item.subsection %} - {% assign titles = item.subsection %} - {% include "table-of-contents" %} - {% endif %} -
  • - {% endfor %} -
diff --git a/scaladoc/scala3-docs/_layouts/base.html b/docs/_layouts/base.html similarity index 100% rename from scaladoc/scala3-docs/_layouts/base.html rename to docs/_layouts/base.html diff --git a/doc-tool/resources/_layouts/blog-page.html b/docs/_layouts/blog-page.html similarity index 95% rename from doc-tool/resources/_layouts/blog-page.html rename to docs/_layouts/blog-page.html index 62724cd9c443..6baad3d40ed8 100644 --- a/doc-tool/resources/_layouts/blog-page.html +++ b/docs/_layouts/blog-page.html @@ -25,11 +25,11 @@

{{ page.title }}

{% if page.author and page.authorImg %}
-
+
{{ page.author }} -
+ {% endif %} diff --git a/scaladoc/scala3-docs/_layouts/doc-page.html b/docs/_layouts/doc-page.html similarity index 100% rename from scaladoc/scala3-docs/_layouts/doc-page.html rename to docs/_layouts/doc-page.html diff --git a/doc-tool/resources/_layouts/index.html b/docs/_layouts/index.html similarity index 100% rename from doc-tool/resources/_layouts/index.html rename to docs/_layouts/index.html diff --git a/scaladoc/scala3-docs/_layouts/main.html b/docs/_layouts/main.html similarity index 100% rename from scaladoc/scala3-docs/_layouts/main.html rename to docs/_layouts/main.html diff --git a/doc-tool/resources/_layouts/search.html b/docs/_layouts/search.html similarity index 100% rename from doc-tool/resources/_layouts/search.html rename to docs/_layouts/search.html diff --git a/doc-tool/resources/css/bootstrap.min.css b/docs/css/bootstrap.min.css similarity index 100% rename from doc-tool/resources/css/bootstrap.min.css rename to docs/css/bootstrap.min.css diff --git a/scaladoc/scala3-docs/css/color-brewer.css b/docs/css/color-brewer.css similarity index 100% rename from scaladoc/scala3-docs/css/color-brewer.css rename to docs/css/color-brewer.css diff --git a/scaladoc/scala3-docs/css/dottydoc.css b/docs/css/dottydoc.css similarity index 98% rename from scaladoc/scala3-docs/css/dottydoc.css rename to docs/css/dottydoc.css index f2ed9045f204..caeb967d6fd1 100644 --- a/scaladoc/scala3-docs/css/dottydoc.css +++ b/docs/css/dottydoc.css @@ -73,12 +73,12 @@ h5:hover a.anchor:hover { color: var(--secondary); } - -/* footer */ -footer { - color: grey; +/* blog footer */ +.blog-author { + color: gray; } -footer img#author-img { + +.blog-author img#author-img { width: auto; height: auto; max-width:100px; diff --git a/docs/css/frontpage.css b/docs/css/frontpage.css index ae9107f9a5c0..722d4ba09802 100644 --- a/docs/css/frontpage.css +++ b/docs/css/frontpage.css @@ -1,5 +1,5 @@ @import url('https://fonts.googleapis.com/css?family=Lobster&display=swap'); - + body { height: 100%; width: 100%; @@ -60,6 +60,12 @@ section.page { min-height: 100vh; width: 100%; padding: 0; + padding-bottom: 2em; +} + +section.page strong { + font-weight: bold; + color: rgba(255,255,255,0.6); } section .container { diff --git a/doc-tool/resources/css/search.css b/docs/css/search.css similarity index 100% rename from doc-tool/resources/css/search.css rename to docs/css/search.css diff --git a/doc-tool/resources/css/sidebar.css b/docs/css/sidebar.css similarity index 100% rename from doc-tool/resources/css/sidebar.css rename to docs/css/sidebar.css diff --git a/doc-tool/resources/css/toolbar.css b/docs/css/toolbar.css similarity index 100% rename from doc-tool/resources/css/toolbar.css rename to docs/css/toolbar.css diff --git a/docs/docs/contributing/workflow.md b/docs/docs/contributing/workflow.md index ee2853c6dfaf..4afab827bf55 100644 --- a/docs/docs/contributing/workflow.md +++ b/docs/docs/contributing/workflow.md @@ -45,7 +45,7 @@ type stealer: ```bash $ sbt > repl -scala> import dotty.tools.DottyTypeStealer._; import dotty.tools.dotc.core._; import Contexts._,Types._ +scala> import dotty.tools.DottyTypeStealer.*; import dotty.tools.dotc.core.*; import Contexts.*,Types.* ``` Now, you can define types and access their representation. For example: diff --git a/docs/docs/internals/syntax.md b/docs/docs/internals/syntax.md index 670d46ff0568..bebd6228cb18 100644 --- a/docs/docs/internals/syntax.md +++ b/docs/docs/internals/syntax.md @@ -120,7 +120,7 @@ type val var while with yield ### Soft keywords ``` -derives end extension infix inline opaque open transparent using | * + - +as derives end extension infix inline opaque open transparent using | * + - ``` See the [separate section on soft keywords](./soft-modifier.md) for additional @@ -258,8 +258,7 @@ ArgumentExprs ::= ParArgumentExprs BlockExpr ::= <<< (CaseClauses | Block) >>> Block ::= {BlockStat semi} [BlockResult] Block(stats, expr?) BlockStat ::= Import - | {Annotation {nl}} [‘implicit’ | ‘lazy’] Def - | {Annotation {nl}} {LocalModifier} TmplDef + | {Annotation {nl}} {LocalModifier} Def | Extension | Expr1 | EndMarker @@ -353,16 +352,16 @@ AccessQualifier ::= ‘[’ id ‘]’ Annotation ::= ‘@’ SimpleType1 {ParArgumentExprs} Apply(tpe, args) Import ::= ‘import’ ImportExpr {‘,’ ImportExpr} +Export ::= ‘export’ ImportExpr {‘,’ ImportExpr} ImportExpr ::= SimpleRef {‘.’ id} ‘.’ ImportSpec Import(expr, sels) -ImportSpec ::= id - | ‘_’ - | ‘given’ + | SimpleRef ‘as’ id Import(EmptyTree, ImportSelector(ref, id)) +ImportSpec ::= NamedSelector + | WildcardSelector | ‘{’ ImportSelectors) ‘}’ -ImportSelectors ::= id [‘=>’ id | ‘=>’ ‘_’] [‘,’ ImportSelectors] +NamedSelector ::= id [‘as’ (id | ‘_’)] +WildCardSelector ::= ‘*' | ‘given’ [InfixType] +ImportSelectors ::= NamedSelector [‘,’ ImportSelectors] | WildCardSelector {‘,’ WildCardSelector} -WildCardSelector ::= ‘given’ [InfixType] - | ‘_' -Export ::= ‘export’ ImportExpr {‘,’ ImportExpr} EndMarker ::= ‘end’ EndMarkerTag -- when followed by EOL EndMarkerTag ::= id | ‘if’ | ‘while’ | ‘for’ | ‘match’ | ‘try’ diff --git a/docs/docs/reference/changed-features/compiler-plugins.md b/docs/docs/reference/changed-features/compiler-plugins.md index 19f39ea759c4..debf369cc0c1 100644 --- a/docs/docs/reference/changed-features/compiler-plugins.md +++ b/docs/docs/reference/changed-features/compiler-plugins.md @@ -52,13 +52,13 @@ zero as errors. ```scala package dividezero -import dotty.tools.dotc.ast.Trees._ +import dotty.tools.dotc.ast.Trees.* import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Constants.Constant import dotty.tools.dotc.core.Contexts.Context -import dotty.tools.dotc.core.Decorators._ -import dotty.tools.dotc.core.StdNames._ -import dotty.tools.dotc.core.Symbols._ +import dotty.tools.dotc.core.Decorators.* +import dotty.tools.dotc.core.StdNames.* +import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.plugins.{PluginPhase, StandardPlugin} import dotty.tools.dotc.transform.{Pickler, Staging} @@ -70,7 +70,7 @@ class DivideZero extends StandardPlugin: (new DivideZeroPhase) :: Nil class DivideZeroPhase extends PluginPhase: - import tpd._ + import tpd.* val phaseName = "divideZero" diff --git a/docs/docs/reference/changed-features/imports.md b/docs/docs/reference/changed-features/imports.md new file mode 100644 index 000000000000..cdd24ae6382d --- /dev/null +++ b/docs/docs/reference/changed-features/imports.md @@ -0,0 +1,58 @@ +--- +layout: doc-page +title: "Imports" +--- + +The syntax of wildcard and renaming imports (and exports) has changed. + +## Wildcard Imports + +Wildcard imports are now expressed with `*` instead of underscore. Example: +```scala +import scala.annotation.* // imports everything in the annotation package +``` + +If you want to import a member named `*` specifically, you can use backticks around it. + +```scala +object A: + def * = ... + def min = ... + +object B: + import A.`*` // imports just `*` + +object C: + import A.* // imports everything in A +``` + +## Renaming Imports + +To rename or exclude an import, we now use `as` instead of `=>`. A single renaming import no longer needs to be enclosed in braces. Examples: + +```scala +import A.{min as minimum, `*` as multiply} +import Predef.{augmentString as _, *} // imports everything except augmentString +import scala.annotation as ann +import java as j +``` + +### Migration + +To support cross-building, Scala 3.0 supports the old import syntax with `_` for wildcards and `=>` for renamings in addition to the new one. The old syntax +will be dropped in a future versions. Automatic rewritings from old to new syntax +are offered under settings `-source 3.1-migration -rewrite`. + +### Syntax + +``` +Import ::= ‘import’ ImportExpr {‘,’ ImportExpr} +ImportExpr ::= SimpleRef {‘.’ id} ‘.’ ImportSpec +ImportSpec ::= NamedSelector + | WildcardSelector + | ‘{’ ImportSelectors) ‘}’ +NamedSelector ::= id [‘as’ (id | ‘_’)] +WildCardSelector ::= ‘*' | ‘given’ [InfixType] +ImportSelectors ::= NamedSelector [‘,’ ImportSelectors] + | WildCardSelector {‘,’ WildCardSelector} +``` diff --git a/docs/docs/reference/changed-features/main-functions.md b/docs/docs/reference/changed-features/main-functions.md index b6897762797b..926f0b20c223 100644 --- a/docs/docs/reference/changed-features/main-functions.md +++ b/docs/docs/reference/changed-features/main-functions.md @@ -62,7 +62,7 @@ For instance, the `happyBirthDay` method above would generate additional code eq ```scala final class happyBirthday: - import scala.util.{CommandLineParser => CLP} + import scala.util.CommandLineParser as CLP def main(args: Array[String]): Unit = try happyBirthday( diff --git a/docs/docs/reference/changed-features/operators.md b/docs/docs/reference/changed-features/operators.md index 7df48ac9898a..ff30c6c74bd9 100644 --- a/docs/docs/reference/changed-features/operators.md +++ b/docs/docs/reference/changed-features/operators.md @@ -92,7 +92,7 @@ The purpose of the `infix` modifier is to achieve consistency across a code base can be applied using infix syntax, i.e. `A op B`. 5. To smooth migration to Scala 3.0, alphanumeric operators will only be deprecated from Scala 3.1 onwards, -or if the `-source 3.1` option is given in Dotty/Scala 3. +or if the `-source future` option is given in Dotty/Scala 3. ## The `@targetName` Annotation diff --git a/docs/docs/reference/changed-features/pattern-bindings.md b/docs/docs/reference/changed-features/pattern-bindings.md index 51f4dba28d06..0c2871ae06b9 100644 --- a/docs/docs/reference/changed-features/pattern-bindings.md +++ b/docs/docs/reference/changed-features/pattern-bindings.md @@ -15,7 +15,7 @@ val xs: List[Any] = List(1, 2, 3) val (x: String) :: _ = xs // error: pattern's type String is more specialized // than the right-hand side expression's type Any ``` -This code gives a compile-time warning in Scala 3.1 (and also in Scala 3.0 under the `-source 3.1` setting) whereas it will fail at runtime with a `ClassCastException` in Scala 2. In Scala 3.1, a pattern binding is only allowed if the pattern is _irrefutable_, that is, if the right-hand side's type conforms to the pattern's type. For instance, the following is OK: +This code gives a compile-time warning in Scala 3.1 (and also in Scala 3.0 under the `-source future` setting) whereas it will fail at runtime with a `ClassCastException` in Scala 2. In Scala 3.1, a pattern binding is only allowed if the pattern is _irrefutable_, that is, if the right-hand side's type conforms to the pattern's type. For instance, the following is OK: ```scala val pair = (1, true) val (x, y) = pair @@ -56,4 +56,4 @@ Generator ::= [‘case’] Pattern1 ‘<-’ Expr ## Migration -The new syntax is supported in Scala 3.0. However, to enable smooth cross compilation between Scala 2 and Scala 3, the changed behavior and additional type checks are only enabled under the `-source 3.1` setting. They will be enabled by default in version 3.1 of the language. +The new syntax is supported in Scala 3.0. However, to enable smooth cross compilation between Scala 2 and Scala 3, the changed behavior and additional type checks are only enabled under the `-source future` setting. They will be enabled by default in version 3.1 of the language. diff --git a/docs/docs/reference/changed-features/vararg-splices.md b/docs/docs/reference/changed-features/vararg-splices.md index d49ff1175d3f..7667953112c0 100644 --- a/docs/docs/reference/changed-features/vararg-splices.md +++ b/docs/docs/reference/changed-features/vararg-splices.md @@ -34,9 +34,9 @@ ParArgumentExprs ::= ‘(’ [‘using’] ExprsInParens ‘)’ ## Compatibility considerations To enable cross compilation between Scala 2 and Scala 3, the compiler will -accept both the old and the new syntax. Under the `-source 3.1` setting, an error +accept both the old and the new syntax. Under the `-source future` setting, an error will be emitted when the old syntax is encountered. An automatic rewrite from old -to new syntax is offered under `-source 3.1-migration`. +to new syntax is offered under `-source future-migration`. diff --git a/docs/docs/reference/changed-features/wildcards.md b/docs/docs/reference/changed-features/wildcards.md index a17d283bc9af..45d436e2cb19 100644 --- a/docs/docs/reference/changed-features/wildcards.md +++ b/docs/docs/reference/changed-features/wildcards.md @@ -31,7 +31,7 @@ A step-by-step migration is made possible with the following measures: 2. In Scala 3.1, `_` is deprecated in favor of `?` as a name for a wildcard. A `-rewrite` option is available to rewrite one to the other. 3. In Scala 3.2, the meaning of `_` changes from wildcard to placeholder for type parameter. - 4. The Scala 3.1 behavior is already available today under the `-source 3.1` setting. + 4. The Scala 3.1 behavior is already available today under the `-source future` setting. To smooth the transition for codebases that use kind-projector, we adopt the following measures under the command line option `-Ykind-projector`: diff --git a/docs/docs/reference/contextual/context-bounds.md b/docs/docs/reference/contextual/context-bounds.md index 3c1e2e3b3aa7..e227ad8b0b8a 100644 --- a/docs/docs/reference/contextual/context-bounds.md +++ b/docs/docs/reference/contextual/context-bounds.md @@ -32,7 +32,7 @@ def g[T <: B : C](x: T): R = ... To ease migration, context bounds in Dotty map in Scala 3.0 to old-style implicit parameters for which arguments can be passed either with a `(using ...)` clause or with a normal application. From Scala 3.1 on, they will map to context parameters instead, as is described above. -If the source version is `3.1` and the `-migration` command-line option is set, any pairing of an evidence +If the source version is `future-migration`, any pairing of an evidence context parameter stemming from a context bound with a normal argument will give a migration warning. The warning indicates that a `(using ...)` clause is needed instead. The rewrite can be done automatically under `-rewrite`. diff --git a/docs/docs/reference/contextual/conversions.md b/docs/docs/reference/contextual/conversions.md index 5dae928c9620..f2f4249efb8d 100644 --- a/docs/docs/reference/contextual/conversions.md +++ b/docs/docs/reference/contextual/conversions.md @@ -63,7 +63,7 @@ conversion from `Int` to `java.lang.Integer` can be defined as follows: given fromFuture : Conversion[Future[HttpResponse], CompletionArg] = Response(_) given fromStatusCode: Conversion[Future[StatusCode], CompletionArg] = Status(_) end CompletionArg - import CompletionArg._ + import CompletionArg.* def complete[T](arg: CompletionArg) = arg match case Error(s) => ... diff --git a/docs/docs/reference/contextual/derivation-macro.md b/docs/docs/reference/contextual/derivation-macro.md index 012da07abfee..22b4d0663c7e 100644 --- a/docs/docs/reference/contextual/derivation-macro.md +++ b/docs/docs/reference/contextual/derivation-macro.md @@ -41,7 +41,7 @@ from the signature. The body of the `derived` method is shown below: ```scala given derived[T: Type](using Quotes): Expr[Eq[T]] = - import quotes.reflect._ + import quotes.reflect.* val ev: Expr[Mirror.Of[T]] = Expr.summon[Mirror.Of[T]].get @@ -135,8 +135,8 @@ enum Opt[+T]: The full code is shown below: ```scala -import scala.deriving._ -import scala.quoted._ +import scala.deriving.* +import scala.quoted.* trait Eq[T]: @@ -165,7 +165,7 @@ object Eq: case '[EmptyTuple] => Nil given derived[T: Type](using q: Quotes): Expr[Eq[T]] = - import quotes.reflect._ + import quotes.reflect.* val ev: Expr[Mirror.Of[T]] = Expr.summon[Mirror.Of[T]].get diff --git a/docs/docs/reference/contextual/derivation.md b/docs/docs/reference/contextual/derivation.md index c2fbb9ecda63..7f1b7750266b 100644 --- a/docs/docs/reference/contextual/derivation.md +++ b/docs/docs/reference/contextual/derivation.md @@ -231,7 +231,7 @@ def eqProduct[T](p: Mirror.ProductOf[T], elems: List[Eq[_]]): Eq[T] = Pulling this all together we have the following complete implementation, ```scala -import scala.deriving._ +import scala.deriving.* import scala.compiletime.{erasedValue, summonInline} inline def summonAll[T <: Tuple]: List[Eq[_]] = @@ -280,7 +280,7 @@ enum Opt[+T] derives Eq: case Nn @main def test = - import Opt._ + import Opt.* val eqoi = summon[Eq[Opt[Int]]] assert(eqoi.eqv(Sm(23), Sm(23))) assert(!eqoi.eqv(Sm(23), Sm(13))) diff --git a/docs/docs/reference/contextual/extension-methods.md b/docs/docs/reference/contextual/extension-methods.md index 93b688912a1b..01c70d578f56 100644 --- a/docs/docs/reference/contextual/extension-methods.md +++ b/docs/docs/reference/contextual/extension-methods.md @@ -189,7 +189,7 @@ object IntOpsEx extends IntOps: else Some(i / x) trait SafeDiv: - import IntOpsEx._ // brings safeDiv and safeMod into scope + import IntOpsEx.* // brings safeDiv and safeMod into scope extension (i: Int) def divide(d: Int): Option[(Int, Int)] = // extension methods imported and thus in scope diff --git a/docs/docs/reference/contextual/given-imports.md b/docs/docs/reference/contextual/given-imports.md index a6d813d06ee6..0ffbb44d643d 100644 --- a/docs/docs/reference/contextual/given-imports.md +++ b/docs/docs/reference/contextual/given-imports.md @@ -12,18 +12,18 @@ object A: def f(using TC) = ??? object B: - import A._ + import A.* import A.given ... ``` -In the code above, the `import A._` clause in object `B` imports all members +In the code above, the `import A.*` clause in object `B` imports all members of `A` _except_ the given instance `tc`. Conversely, the second import `import A.given` will import _only_ that given instance. The two import clauses can also be merged into one: ```scala object B: - import A.{given, _} + import A.{given, *} ... ``` @@ -44,7 +44,7 @@ There are two main benefits arising from these rules: Since givens can be anonymous it is not always practical to import them by their name, and wildcard imports are typically used instead. By-type imports provide a more specific alternative to wildcard imports, which makes it clearer what is imported. Example: ```scala -import A.{given TC} +import A.given TC ``` This imports any given in `A` that has a type which conforms to `TC`. Importing givens of several types `T1,...,Tn` @@ -104,14 +104,13 @@ given instances once their user base has migrated. ``` Import ::= ‘import’ ImportExpr {‘,’ ImportExpr} -ImportExpr ::= StableId ‘.’ ImportSpec -ImportSpec ::= id - | ‘_’ - | ‘given’ - | ‘{’ ImportSelectors) ‘}’ -ImportSelectors ::= id [‘=>’ id | ‘=>’ ‘_’] [‘,’ ImportSelectors] - | WildCardSelector {‘,’ WildCardSelector} -WildCardSelector ::= ‘_' - | ‘given’ [InfixType] Export ::= ‘export’ ImportExpr {‘,’ ImportExpr} +ImportExpr ::= SimpleRef {‘.’ id} ‘.’ ImportSpec +ImportSpec ::= NamedSelector + | WildcardSelector + | ‘{’ ImportSelectors) ‘}’ +NamedSelector ::= id [‘as’ (id | ‘_’)] +WildCardSelector ::= ‘*' | ‘given’ [InfixType] +ImportSelectors ::= NamedSelector [‘,’ ImportSelectors] + | WildCardSelector {‘,’ WildCardSelector} ``` diff --git a/docs/docs/reference/dropped-features/nonlocal-returns.md b/docs/docs/reference/dropped-features/nonlocal-returns.md index 9ef49c635c84..b9b2b37c866b 100644 --- a/docs/docs/reference/dropped-features/nonlocal-returns.md +++ b/docs/docs/reference/dropped-features/nonlocal-returns.md @@ -10,7 +10,7 @@ Nonlocal returns are implemented by throwing and catching `scala.runtime.NonLoca A drop-in library replacement is provided in [`scala.util.control.NonLocalReturns`](http://dotty.epfl.ch/api/scala/util/control/NonLocalReturns$.html). Example: ```scala -import scala.util.control.NonLocalReturns._ +import scala.util.control.NonLocalReturns.* extension [T](xs: List[T]) def has(elem: T): Boolean = returning { diff --git a/docs/docs/reference/metaprogramming/erased-terms.md b/docs/docs/reference/metaprogramming/erased-terms.md index dde296ebff83..944d357d6daf 100644 --- a/docs/docs/reference/metaprogramming/erased-terms.md +++ b/docs/docs/reference/metaprogramming/erased-terms.md @@ -157,7 +157,7 @@ matches. `erasedValue` is implemented with `erased`, so the state machine above can be encoded as follows: ```scala -import scala.compiletime._ +import scala.compiletime.* sealed trait State final class On extends State diff --git a/docs/docs/reference/metaprogramming/inline.md b/docs/docs/reference/metaprogramming/inline.md index ba18f55d76d8..412ca594b2b5 100644 --- a/docs/docs/reference/metaprogramming/inline.md +++ b/docs/docs/reference/metaprogramming/inline.md @@ -284,6 +284,23 @@ transparent inline def zero: Int = 0 val one: 1 = zero + 1 ``` +### Transparent vs. non-transparent inline +As we already discussed, transparent inline methods may influence type checking at call site. +Technically this implies that transparent inline methods must be expanded during type checking of the program. +Other inline methods are inlined later after the program is fully typed. + +For example, the following two functions will be typed the same way but will be inlined at different times. +```scala +inline def f1: T = ... +transparent inline def f2: T = (...): T +``` + +A noteworthy difference is the behavior of `transparent inline given`. +If there is an error reported when inlining that definition, it will be considered as an implicit search mismatch and the search will continue. +A `transparent inline given` can add a type ascription in its RHS (as in `f2` from the previous example) to avoid the precise type but keep the search behavior. +On the other hand, `inline given` be taken as the implicit and then inlined after typing. +Any error will be emitted as usual. + ## Inline Conditionals An if-then-else expression whose condition is a constant expression can be simplified to @@ -313,6 +330,8 @@ below: | This location is in code that was inlined at ... ``` +In a transparent inline, an `inline if` will force the inlining of any inline definition in its condition during type checking. + ## Inline Matches A `match` expression in the body of an `inline` method definition may be @@ -486,8 +505,8 @@ primitive operations on singleton types. For example, singleton types, the compiler can evaluate the result of the operation. ```scala -import scala.compiletime.ops.int._ -import scala.compiletime.ops.boolean._ +import scala.compiletime.ops.int.* +import scala.compiletime.ops.boolean.* val conjunction: true && true = true val multiplication: 3 * 5 = 15 @@ -499,7 +518,7 @@ Since type aliases have the same precedence rules as their term-level equivalents, the operations compose with the expected precedence rules: ```scala -import scala.compiletime.ops.int._ +import scala.compiletime.ops.int.* val x: 1 + 2 * 3 = 7 ``` @@ -510,7 +529,7 @@ concatenation. To use both and distinguish the two types from each other, a match type can dispatch to the correct implementation: ```scala -import scala.compiletime.ops._ +import scala.compiletime.ops.* import scala.annotation.infix diff --git a/docs/docs/reference/metaprogramming/macros-spec.md b/docs/docs/reference/metaprogramming/macros-spec.md index 8bdee4ba1eba..a90b2a7fbfb7 100644 --- a/docs/docs/reference/metaprogramming/macros-spec.md +++ b/docs/docs/reference/metaprogramming/macros-spec.md @@ -172,7 +172,7 @@ For instance, here is a version of `power` that generates the multiplications directly if the exponent is statically known and falls back to the dynamic implementation of `power` otherwise. ```scala -import scala.quoted._ +import scala.quoted.* inline def power(x: Double, n: Int): Double = ${ powerExpr('x, 'n) } diff --git a/docs/docs/reference/metaprogramming/macros.md b/docs/docs/reference/metaprogramming/macros.md index 997252176fc3..c439934ff384 100644 --- a/docs/docs/reference/metaprogramming/macros.md +++ b/docs/docs/reference/metaprogramming/macros.md @@ -28,7 +28,7 @@ a boolean expression tree as argument. `assertImpl` evaluates the expression and prints it again in an error message if it evaluates to `false`. ```scala -import scala.quoted._ +import scala.quoted.* inline def assert(inline expr: Boolean): Unit = ${ assertImpl('expr) } @@ -229,7 +229,7 @@ Consider the following implementation of a staged interpreter that implements a compiler through staging. ```scala -import scala.quoted._ +import scala.quoted.* enum Exp: case Num(n: Int) @@ -237,7 +237,7 @@ enum Exp: case Var(x: String) case Let(x: String, e: Exp, in: Exp) -import Exp._ +import Exp.* ``` The interpreted language consists of numbers `Num`, addition `Plus`, and variables @@ -253,7 +253,7 @@ language to quoted Scala code of type `Expr[Int]`. The compiler takes an environment that maps variable names to Scala `Expr`s. ```scala -import scala.quoted._ +import scala.quoted.* def compile(e: Exp, env: Map[String, Expr[Int]])(using Quotes): Expr[Int] = e match @@ -618,9 +618,9 @@ def setForExpr[T: Type](using Quotes): Expr[Set[T]] = case _ => '{ new HashSet[T] } ``` -## Relationship with Whitebox Inline +## Relationship with Transparent Inline -[Inline](./inline.md) documents inlining. The code below introduces a whitebox +[Inline](./inline.md) documents inlining. The code below introduces a transparent inline method that can calculate either a value of type `Int` or a value of type `String`. diff --git a/docs/docs/reference/metaprogramming/reflection.md b/docs/docs/reference/metaprogramming/reflection.md index 0855e4230432..a6c50a6c6038 100644 --- a/docs/docs/reference/metaprogramming/reflection.md +++ b/docs/docs/reference/metaprogramming/reflection.md @@ -19,27 +19,27 @@ guarantees and may fail at macro expansion time, hence additional explicit checks must be done. To provide reflection capabilities in macros we need to add an implicit parameter -of type `scala.quoted.Quotes` and import `quotes.reflect._` from it in the scope +of type `scala.quoted.Quotes` and import `quotes.reflect.*` from it in the scope where it is used. ```scala -import scala.quoted._ +import scala.quoted.* inline def natConst(inline x: Int): Int = ${natConstImpl('{x})} def natConstImpl(x: Expr[Int])(using Quotes): Expr[Int] = - import quotes.reflect._ + import quotes.reflect.* ... ``` ### Extractors -`import quotes.reflect._` will provide all extractors and methods on `quotes.reflect.Tree`s. +`import quotes.reflect.*` will provide all extractors and methods on `quotes.reflect.Tree`s. For example the `Literal(_)` extractor used below. ```scala def natConstImpl(x: Expr[Int])(using Quotes): Expr[Int] = - import quotes.reflect._ + import quotes.reflect.* val tree: Term = x.asTerm tree match case Inlined(_, _, Literal(IntConstant(n))) => @@ -78,7 +78,7 @@ expansion point. ```scala def macroImpl()(quotes: Quotes): Expr[Unit] = - import quotes.reflect._ + import quotes.reflect.* val pos = Position.ofMacroExpansion val path = pos.sourceFile.jpath.toString diff --git a/docs/docs/reference/metaprogramming/staging.md b/docs/docs/reference/metaprogramming/staging.md index 54961f912379..633f7e2984b4 100644 --- a/docs/docs/reference/metaprogramming/staging.md +++ b/docs/docs/reference/metaprogramming/staging.md @@ -104,7 +104,7 @@ expression at runtime. Within the scope of `staging.run` we can also invoke `sho to get a source-like representation of the expression. ```scala -import scala.quoted._ +import scala.quoted.* // make available the necessary compiler for runtime code generation given staging.Compiler = staging.Compiler.make(getClass.getClassLoader) diff --git a/docs/docs/reference/metaprogramming/tasty-inspect.md b/docs/docs/reference/metaprogramming/tasty-inspect.md index 4324f7a63339..757472110ef6 100644 --- a/docs/docs/reference/metaprogramming/tasty-inspect.md +++ b/docs/docs/reference/metaprogramming/tasty-inspect.md @@ -18,12 +18,12 @@ through the TASTy reflect API. To inspect the trees of a TASTy file a consumer can be defined in the following way. ```scala -import scala.quoted._ -import scala.tasty.inspector._ +import scala.quoted.* +import scala.tasty.inspector.* class MyInspector extends Inspector: def inspect(using Quotes)(tastys: List[Tasty[quotes.type]]): Unit = - import quotes.reflect._ + import quotes.reflect.* for tasty <- tastys do val tree = tasty.ast // Do something with the tree diff --git a/docs/docs/reference/other-new-features/export.md b/docs/docs/reference/other-new-features/export.md index 2a7aaada28ef..5ded49aebc75 100644 --- a/docs/docs/reference/other-new-features/export.md +++ b/docs/docs/reference/other-new-features/export.md @@ -70,8 +70,7 @@ A member is _eligible_ if all of the following holds: - it is not a constructor, nor the (synthetic) class part of an object, - it is a given instance (declared with `given`) if and only if the export is from a _given selector_. -It is a compile-time error if a simple or renaming selector does not identify any eligible -members. +It is a compile-time error if a simple or renaming selector does not identify any eligible members. Type members are aliased by type definitions, and term members are aliased by method definitions. Export aliases copy the type and value parameters of the members they refer to. Export aliases are always `final`. Aliases of given instances are again defined as givens (and aliases of old-style implicits are `implicit`). Aliases of inline methods or values are again defined `inline`. There are no other modifiers that can be given to an alias. This has the following consequences for overriding: @@ -91,11 +90,21 @@ export O.c def f: c.T = ... ``` - -Export clauses can appear in classes or they can appear at the top-level. An export clause cannot appear as a statement in a block. -If an export clause contains a wildcard or given selector, it is forbidden for its qualifier path to refer to a package. This is because it is not yet known how to safely track wildcard dependencies to a package for the purposes of incremental compilation. +**Restrictions:** + + 1. Export clauses can appear in classes or they can appear at the top-level. An export clause cannot appear as a statement in a block. + 1. If an export clause contains a wildcard or given selector, it is forbidden for its qualifier path to refer to a package. This is because it is not yet known how to safely track wildcard dependencies to a package for the purposes of incremental compilation. + + 1. Simple renaming exports like + ```scala + export status as stat + ``` + are not supported yet. They would run afoul of the restriction that the + exported `a` cannot be already a member of the object containing the export. + This restriction might be lifted in the future. + (\*) **Note:** Unless otherwise stated, the term "class" in this discussion also includes object and trait definitions. ## Motivation @@ -116,17 +125,15 @@ TemplateStat ::= ... | Export TopStat ::= ... | Export -Import ::= ‘import’ ImportExpr {‘,’ ImportExpr} -ImportExpr ::= StableId ‘.’ ImportSpec -ImportSpec ::= id - | ‘_’ - | ‘given’ - | ‘{’ ImportSelectors) ‘}’ -ImportSelectors ::= id [‘=>’ id | ‘=>’ ‘_’] [‘,’ ImportSelectors] - | WildCardSelector {‘,’ WildCardSelector} -WildCardSelector ::= ‘_' - | ‘given’ [InfixType] Export ::= ‘export’ ImportExpr {‘,’ ImportExpr} +ImportExpr ::= SimpleRef {‘.’ id} ‘.’ ImportSpec +ImportSpec ::= NamedSelector + | WildcardSelector + | ‘{’ ImportSelectors) ‘}’ +NamedSelector ::= id [‘as’ (id | ‘_’)] +WildCardSelector ::= ‘*' | ‘given’ [InfixType] +ImportSelectors ::= NamedSelector [‘,’ ImportSelectors] + | WildCardSelector {‘,’ WildCardSelector} ``` ## Elaboration of Export Clauses diff --git a/docs/docs/reference/other-new-features/matchable.md b/docs/docs/reference/other-new-features/matchable.md index c4814af64f3f..dd230a916537 100644 --- a/docs/docs/reference/other-new-features/matchable.md +++ b/docs/docs/reference/other-new-features/matchable.md @@ -53,7 +53,7 @@ a type pattern `_: C` it is required that the selector type conforms to `Matchable`. If that's not the case a warning is issued. For instance when compiling the example at the start of this section we get: ``` -> sc ../new/test.scala -source 3.1 +> sc ../new/test.scala -source future -- Warning: ../new/test.scala:4:12 --------------------------------------------- 4 | case a: Array[Int] => a(0) = 0 | ^^^^^^^^^^ @@ -62,7 +62,7 @@ to `Matchable`. If that's not the case a warning is issued. For instance when co ``` To allow migration from Scala 2 and cross-compiling -between Scala 2 and 3 the warning is turned on only for `-source 3.1-migration` or higher. +between Scala 2 and 3 the warning is turned on only for `-source future-migration` or higher. `Matchable` is a universal trait with `Any` as its parent class. It is extended by both `AnyVal` and `AnyRef`. Since `Matchable` is a supertype of every concrete value or reference class it means that instances of such classes can be matched as before. However, match selectors of the following types will produce a warning: diff --git a/docs/docs/reference/other-new-features/opaques.md b/docs/docs/reference/other-new-features/opaques.md index 5bed38293b21..61a2bd541f56 100644 --- a/docs/docs/reference/other-new-features/opaques.md +++ b/docs/docs/reference/other-new-features/opaques.md @@ -111,7 +111,7 @@ two types. Hence, the following usage scenario type-checks. ```scala object User: - import Access._ + import Access.* case class Item(rights: Permissions) @@ -133,4 +133,34 @@ end User On the other hand, the call `roItem.rights.isOneOf(ReadWrite)` would give a type error since `Permissions` and `PermissionChoice` are different, unrelated types outside `Access`. + +### Opaque Type Members on Classes +While typically, opaque types are used together with objects to hide implementation details of a module, they can also be used with classes. + +For example, we can redefine the above example of Logarithms as a class. +```scala +class Logarithms: + + opaque type Logarithm = Double + + def apply(d: Double): Logarithm = math.log(d) + + def safe(d: Double): Option[Logarithm] = + if d > 0.0 then Some(math.log(d)) else None + + def mul(x: Logarithm, y: Logarithm) = x + y +``` + +Opaque type members of different instances are treated as different: +```scala +val l1 = new Logarithms +val l2 = new Logarithms +val x = l1(1.5) +val y = l1(2.6) +val z = l2(3.1) +l1.mul(x, y) // type checks +l1.mul(x, z) // error: found l2.Logarithm, required l1.Logarithm +``` +In general, one can think of an opaque type as being only transparent in the scope of `private[this]`. + [More details](opaques-details.md) diff --git a/docs/docs/reference/other-new-features/open-classes.md b/docs/docs/reference/other-new-features/open-classes.md index c1ee2def453b..7164476d0ad4 100644 --- a/docs/docs/reference/other-new-features/open-classes.md +++ b/docs/docs/reference/other-new-features/open-classes.md @@ -76,4 +76,4 @@ A class that is neither `abstract` nor `open` is similar to a `sealed` class: it ### Migration -`open` is a new modifier in Scala 3. To allow cross compilation between Scala 2.13 and Scala 3.0 without warnings, the feature warning for ad-hoc extensions is produced only under `-source 3.1`. It will be produced by default from Scala 3.1 on. +`open` is a new modifier in Scala 3. To allow cross compilation between Scala 2.13 and Scala 3.0 without warnings, the feature warning for ad-hoc extensions is produced only under `-source future`. It will be produced by default from Scala 3.1 on. diff --git a/docs/docs/reference/other-new-features/trait-parameters.md b/docs/docs/reference/other-new-features/trait-parameters.md index 1655e338b32c..f930c10e2c5d 100644 --- a/docs/docs/reference/other-new-features/trait-parameters.md +++ b/docs/docs/reference/other-new-features/trait-parameters.md @@ -26,12 +26,14 @@ class D extends C, Greeting("Bill") // error: parameter passed twice Should this print "Bob" or "Bill"? In fact this program is illegal, because it violates the second rule of the following for trait parameters: - 1. If a class `C` extends a parameterized trait `T`, and its superclass does not, `C` _must_ pass arguments to `T`. + 1. If a class `C` directly extends a parameterized trait `T`, and its superclass does not, `C` _must_ pass arguments to `T`. - 2. If a class `C` extends a parameterized trait `T`, and its superclass does as well, `C` _must not_ pass arguments to `T`. + 2. If a class `C` directly or indirectly extends a parameterized trait `T`, and its superclass does as well, `C` _must not_ pass arguments to `T`. 3. Traits must never pass arguments to parent traits. + 4. If a class `C` extends a parameterized trait `T` only indirectly, and its superclass does not extend `T`, then all parameters of `T` must be defined via overrides. + Here's a trait extending the parameterized trait `Greeting`. ```scala @@ -51,6 +53,13 @@ The correct way to write `E` is to extend both `Greeting` and ```scala class E extends Greeting("Bob"), FormalGreeting ``` +Alternatively, a class could also define the `name` parameter of `Greeting` using +an override, using rule (4) above: + +```scala +class E2 extends FormalGreeting: + override val name: String = "Bob" +``` ## Reference diff --git a/docs/docs/reference/other-new-features/type-test.md b/docs/docs/reference/other-new-features/type-test.md index 43a43e697d83..8c1661fd07f2 100644 --- a/docs/docs/reference/other-new-features/type-test.md +++ b/docs/docs/reference/other-new-features/type-test.md @@ -113,7 +113,7 @@ Using `ClassTag` instances was unsound since classtags can check only the class Given the following abstract definition of Peano numbers that provides two given instances of types `TypeTest[Nat, Zero]` and `TypeTest[Nat, Succ]` ```scala -import scala.reflect._ +import scala.reflect.* trait Peano: type Nat @@ -129,7 +129,7 @@ trait Peano: def apply(nat: Nat): Succ def unapply(succ: Succ): Some[Nat] - given typeTestOfZero: TypeTest[Nat, Zero] + given typeTestOfZero: TypeTest[Nat, Zero] given typeTestOfSucc: TypeTest[Nat, Succ] ``` @@ -162,7 +162,7 @@ it is possible to write the following program ```scala @main def test = - import PeanoInt._ + import PeanoInt.* def divOpt(m: Nat, n: Nat): Option[(Nat, Nat)] = n match diff --git a/docs/docs/reference/soft-modifier.md b/docs/docs/reference/soft-modifier.md index 03c71857cdd8..d024bb3df603 100644 --- a/docs/docs/reference/soft-modifier.md +++ b/docs/docs/reference/soft-modifier.md @@ -17,9 +17,10 @@ Otherwise, soft keywords are treated specially in the following situations: - `end`, if it appears at the start of a line following a statement (i.e. definition or toplevel expression) - `extension`, if it appears at the start of a statement and is followed by `(` or `[`. - `using`, if it appears at the start of a parameter or argument list. + - `as`, in a renaming import clause - `|`, if it separates two patterns in an alternative. - `+`, `-`, if they appear in front of a type parameter. - - `*`, if it follows the type of a parameter or if it appears in - a vararg type ascription `x: _*`. + - `*`, in a wildcard import, or it follows the type of a parameter, or if it appears in + a vararg splice `x*`. Everywhere else a soft keyword is treated as a normal identifier. diff --git a/docs/docs/reference/syntax.md b/docs/docs/reference/syntax.md index b2de66272ddf..508c82e39224 100644 --- a/docs/docs/reference/syntax.md +++ b/docs/docs/reference/syntax.md @@ -119,7 +119,7 @@ type val var while with yield ### Soft keywords ``` -derives end extension infix inline opaque open transparent using | * + - +as derives end extension infix inline opaque open transparent using | * + - ``` See the [separate section on soft keywords](./soft-modifier.md) for additional @@ -222,7 +222,7 @@ Expr1 ::= [‘inline’] ‘if’ ‘(’ Expr ‘)’ {nl} Expr [[ Ascription ::= ‘:’ InfixType | ‘:’ Annotation {Annotation} Catches ::= ‘catch’ (Expr | ExprCaseClause) -PostfixExpr ::= InfixExpr [id] +PostfixExpr ::= InfixExpr [id] -- only if language.postfixOperators is enabled InfixExpr ::= PrefixExpr | InfixExpr id [nl] InfixExpr | InfixExpr MatchClause @@ -254,8 +254,7 @@ ArgumentExprs ::= ParArgumentExprs BlockExpr ::= <<< (CaseClauses | Block) >>> Block ::= {BlockStat semi} [BlockResult] BlockStat ::= Import - | {Annotation {nl}} [‘implicit’ | ‘lazy’] Def - | {Annotation {nl}} {LocalModifier} TmplDef + | {Annotation {nl}} {LocalModifier} Def | Extension | Expr1 | EndMarker @@ -344,16 +343,16 @@ AccessQualifier ::= ‘[’ id ‘]’ Annotation ::= ‘@’ SimpleType1 {ParArgumentExprs} Import ::= ‘import’ ImportExpr {‘,’ ImportExpr} +Export ::= ‘export’ ImportExpr {‘,’ ImportExpr} ImportExpr ::= SimpleRef {‘.’ id} ‘.’ ImportSpec -ImportSpec ::= id - | ‘_’ - | ‘given’ + | SimpleRef ‘as’ id +ImportSpec ::= NamedSelector + | WildcardSelector | ‘{’ ImportSelectors) ‘}’ -ImportSelectors ::= id [‘=>’ id | ‘=>’ ‘_’] [‘,’ ImportSelectors] +NamedSelector ::= id [‘as’ (id | ‘_’)] +WildCardSelector ::= ‘*' | ‘given’ [InfixType] +ImportSelectors ::= NamedSelector [‘,’ ImportSelectors] | WildCardSelector {‘,’ WildCardSelector} -WildCardSelector ::= ‘given’ [InfixType] - | ‘_' -Export ::= ‘export’ ImportExpr {‘,’ ImportExpr} EndMarker ::= ‘end’ EndMarkerTag -- when followed by EOL EndMarkerTag ::= id | ‘if’ | ‘while’ | ‘for’ | ‘match’ | ‘try’ diff --git a/docs/docs/usage/cbt-projects.md b/docs/docs/usage/cbt-projects.md index a40bb92a74fa..59c9f07d8987 100644 --- a/docs/docs/usage/cbt-projects.md +++ b/docs/docs/usage/cbt-projects.md @@ -11,7 +11,7 @@ cbt comes with built-in Dotty support. Follow the ```scala // build/build.scala -import cbt._ +import cbt.* class Build(val context: Context) extends Dotty { ... } diff --git a/docs/docs/usage/getting-started.md b/docs/docs/usage/getting-started.md index 3600b90a0a51..190f07992c09 100644 --- a/docs/docs/usage/getting-started.md +++ b/docs/docs/usage/getting-started.md @@ -38,13 +38,13 @@ Start using the Dotty IDE in any Dotty project by following the ### Standalone installation Releases are available for download on the [Releases Section](https://github.com/lampepfl/dotty/releases) of the Dotty repository. Releases include three executables: `scalac` the Dotty compiler, -`scalad` the [Dotty Documentation tool](./dottydoc.md) and `scala` the Dotty REPL. +`scaladoc` the [Scaladoc](scaladoc.md) and `scala` the Dotty REPL. ``` . └── bin    ├── scalac -    ├── scalad +    ├── scaladoc    └── scala ``` diff --git a/docs/docs/usage/language-versions.md b/docs/docs/usage/language-versions.md index e5395b136e18..f98105f5cc47 100644 --- a/docs/docs/usage/language-versions.md +++ b/docs/docs/usage/language-versions.md @@ -5,8 +5,6 @@ title: "Language Versions" The default Scala language version currently supported by the Dotty compiler is `3.0`. There are also other language versions that can be specified instead: - - `3.1`: A preview of changes introduced in the next version after 3.0. Some Scala-2 specific idioms will be dropped in this version. The feature set supported by this version will be refined over time as we approach its release. - - `3.0-migration`: Same as `3.0` but with a Scala 2 compatibility mode that helps moving Scala 2.13 sources over to Scala 3. In particular, it - flags some Scala 2 constructs that are disallowed in Scala 3 as migration warnings instead of hard errors, @@ -14,7 +12,11 @@ The default Scala language version currently supported by the Dotty compiler is - gives some additional warnings where the semantics has changed between Scala 2.13 and 3.0 - in conjunction with `-rewrite`, offer code rewrites from Scala 2.13 to 3.0. - - `3.1-migration`: Same as `3.1` but with additional helpers to migrate from `3.0`. Similarly to the helpers available under `3.0-migration`, these include migration warnings and optional rewrites. + - `future`: A preview of changes introduced in the next versions after 3.0. In the doc pages here we refer to the language version with these changes as `3.1`, but it might be that some of these changes will be rolled out in later `3.x` versions. + + Some Scala-2 specific idioms will be dropped in this version. The feature set supported by this version will be refined over time as we approach its release. + + - `future-migration`: Same as `future` but with additional helpers to migrate from `3.0`. Similarly to the helpers available under `3.0-migration`, these include migration warnings and optional rewrites. There are two ways to specify a language version. @@ -23,9 +25,10 @@ There are two ways to specify a language version. ```scala package p -import scala.language.`3.1` +import scala.language.`future-migration` class C { ... } ``` -Language imports supersede command-line settings in the compilation units where they are specified. Only one language import is allowed in a compilation unit, and it must come before any definitions in that unit. +Language imports supersede command-line settings in the compilation units where they are specified. Only one language import specifying a source version is allowed in a compilation unit, and it must come before any definitions in that unit. + diff --git a/docs/index.html b/docs/index.html index ce55dbe02167..a6e99cb73265 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,8 +1,104 @@ --- -title: Dotty -layout: base +title: Scala 3 +layout: main +hasFrame: false extraCSS: - css/frontpage.css --- -{% include logo-page.html %} -{% include getting-started.html %} + +
+
+ +
+
+
+ logo +
+

Scala 3

+

A next-generation compiler for Scala

+

(scroll down for more info)

+
+
+
+
+
+
+ +

Try Scala 3

+

There are multiple ways of getting started with Scala 3.

+
    +
  1. You can try Scala 3 in your browser with Scastie.
  2. +
  3. If you already have sbt installed, you can create a Scala 3 project and sbt will take care of the rest.
  4. +
  5. You can install all necessary dependencies with coursier by running cs setup. You can also run cs install scala3-compiler or cs install scala3-repl to install command-line commands for the compiler and repl, correspondingly.
  6. +
  7. You can manually install Scala 3 on your computer.
  8. +
+ +

Install Scala 3

+

If you are a Mac user, you can install Scala 3 with brew:

+
brew install lampepfl/brew/dotty
+ +

+ If you are a Linux or Windows user, as a prerequisite you need a JDK 8 or later properly installed on your system. The environment variable JAVA_HOME should point to your Java installation.
+ For Windows users, we recommend using the Windows subsystem for linux or some other bash shell like git bash.
+ Then download the latest release. Optionally add the path of the folder bin/ to the system environment variable PATH. +

+ +

Now you can compile Scala source code:

+
scalac hello.scala
+ +

To start the REPL, run: scala.

+ +

Create a Scala 3 Project

+

The fastest way to create a new project in Scala 3 is using sbt (1.1.4+).

+ +

Create a Scala 3 project:

+
sbt new lampepfl/dotty.g8
+ +

Or a Scala 3 project that cross compiles with Scala 2:

+
sbt new lampepfl/dotty-cross.g8
+ +

For documentation see the Scala 3 Example Project.

+ +

Learn more about Scala 3

+

You can find much more information about Scala 3 in ...

+ +
+
diff --git a/doc-tool/resources/js/api-search.js b/docs/js/api-search.js similarity index 100% rename from doc-tool/resources/js/api-search.js rename to docs/js/api-search.js diff --git a/scaladoc/scala3-docs/js/bootstrap.min.js b/docs/js/bootstrap.min.js similarity index 100% rename from scaladoc/scala3-docs/js/bootstrap.min.js rename to docs/js/bootstrap.min.js diff --git a/scaladoc/scala3-docs/js/highlight.pack.js b/docs/js/highlight.pack.js similarity index 100% rename from scaladoc/scala3-docs/js/highlight.pack.js rename to docs/js/highlight.pack.js diff --git a/doc-tool/resources/js/jquery.min.js b/docs/js/jquery.min.js similarity index 100% rename from doc-tool/resources/js/jquery.min.js rename to docs/js/jquery.min.js diff --git a/doc-tool/resources/js/sidebar.js b/docs/js/sidebar.js similarity index 100% rename from doc-tool/resources/js/sidebar.js rename to docs/js/sidebar.js diff --git a/doc-tool/resources/js/toolbar.js b/docs/js/toolbar.js similarity index 100% rename from doc-tool/resources/js/toolbar.js rename to docs/js/toolbar.js diff --git a/scaladoc/scala3-docs/logo.svg b/docs/logo.svg similarity index 100% rename from scaladoc/scala3-docs/logo.svg rename to docs/logo.svg diff --git a/docs/sidebar.yml b/docs/sidebar.yml index 35d1c79aedcb..f3c0c63a21b9 100644 --- a/docs/sidebar.yml +++ b/docs/sidebar.yml @@ -129,6 +129,8 @@ sidebar: url: docs/reference/changed-features/operators.html - title: Wildcard Types url: docs/reference/changed-features/wildcards.html + - title: Imports + url: docs/reference/changed-features/imports.html - title: Type Checking url: docs/reference/changed-features/type-checking.html - title: Type Inference diff --git a/library/src/dotty/runtime/RuntimeHandleReceptacle.scala b/library/src/dotty/runtime/RuntimeHandleReceptacle.scala new file mode 100644 index 000000000000..66add43e3f47 --- /dev/null +++ b/library/src/dotty/runtime/RuntimeHandleReceptacle.scala @@ -0,0 +1,43 @@ +package dotty.runtime + +import java.lang.invoke.MethodHandles + +import scala.reflect.ClassTag + +/** + * sun.misc.Unsafe and java.lang.invoke.VarHandle receptacle. + * It allows Java 8-9+ compatibility without using 9-deprecated Unsafe class. + */ + +trait RuntimeHandleReceptacle { + + + def get[U <: AnyRef : ClassTag](ref: Object, clazz: Class[_], varName: String)(implicit tag: ClassTag[U]): U + + def getLongVolatile(ref: Object, clazz: Class[_], varName: String): Long + + def put[U <: AnyRef : ClassTag](ref: Object, clazz: Class[_], varName: String, value: U)(implicit tag: ClassTag[U]): Unit + + def compareAndSwapLong(ref: Object, clazz: Class[_], varName: String, expected: Long, value: Long): Boolean +} + +object RuntimeHandleReceptacle { + + private val lookup = MethodHandles.lookup() + private val reference: RuntimeHandleReceptacle = { + try { + //Java 9+ + Class.forName("java.lang.invoke.VarHandle") + new VarHandlerReceptacle(lookup) + } catch { + //Java 8 + case e: ClassNotFoundException => + val unsafeClass = Class.forName("sun.misc.Unsafe") + var unsafeReference: sun.misc.Unsafe = null + for (field <- unsafeClass.getDeclaredFields) if (field.getType.isAssignableFrom(unsafeClass)) unsafeReference = field.get(null).asInstanceOf[sun.misc.Unsafe] + new UnsafeReceptacle(unsafeReference) + } + } + + def apply(): RuntimeHandleReceptacle = reference +} \ No newline at end of file diff --git a/library/src/dotty/runtime/UnsafeReceptacle.scala b/library/src/dotty/runtime/UnsafeReceptacle.scala new file mode 100644 index 000000000000..b7e181d667d7 --- /dev/null +++ b/library/src/dotty/runtime/UnsafeReceptacle.scala @@ -0,0 +1,20 @@ +package dotty.runtime + +import sun.misc.Unsafe + +import scala.reflect.ClassTag + + +class UnsafeReceptacle(runtimeReference: Unsafe) extends RuntimeHandleReceptacle { + + override def get[U <: AnyRef : ClassTag](ref: Object, clazz: Class[_], varName: String)(implicit tag: ClassTag[U]): U = runtimeReference.getObject(ref, getOffset(clazz, varName)).asInstanceOf[U] + override def getLongVolatile(ref: Object, clazz: Class[_], varName: String): Long = runtimeReference.getLongVolatile(ref, getOffset(clazz, varName)) + + override def put[U : ClassTag](ref: Object, clazz: Class[_], varName: String, value: U)(implicit tag: ClassTag[U]): Unit = runtimeReference.putObject(ref, getOffset(clazz, varName), value) + + override def compareAndSwapLong(ref: Object, clazz: Class[_], varName: String, expected: Long, value: Long): Boolean = runtimeReference.compareAndSwapLong(ref, getOffset(clazz, varName), expected, value) + + private def getOffset(clazz: Class[_], varName: String): Long = runtimeReference.objectFieldOffset(clazz.getDeclaredField(varName)) + + +} \ No newline at end of file diff --git a/library/src/dotty/runtime/VarHandlerReceptacle.scala b/library/src/dotty/runtime/VarHandlerReceptacle.scala new file mode 100644 index 000000000000..96df1f934e13 --- /dev/null +++ b/library/src/dotty/runtime/VarHandlerReceptacle.scala @@ -0,0 +1,16 @@ +package dotty.runtime + +import java.lang.invoke.MethodHandles + +import scala.reflect.ClassTag + +class VarHandlerReceptacle(lookup: MethodHandles.Lookup) extends RuntimeHandleReceptacle { + + override def get[U <: AnyRef : ClassTag](ref: Object, clazz: Class[_], varName: String)(implicit tag: ClassTag[U]): U = lookup.findVarHandle(clazz, varName, tag.runtimeClass).get(ref.asInstanceOf[Object]).asInstanceOf[U] + + override def put[U <: AnyRef : ClassTag](ref: Object, clazz: Class[_], varName: String, value: U)(implicit tag: ClassTag[U]): Unit = lookup.findVarHandle(clazz, varName, tag.runtimeClass).set(ref.asInstanceOf[Object], value.asInstanceOf[Object]).asInstanceOf[U] + + override def compareAndSwapLong(ref: Object, clazz: Class[_], varName: String, expected: Long, value: Long): Boolean = lookup.findVarHandle(clazz, varName, classOf[Long]).compareAndSet(ref, Long.box(expected), Long.box(value)) + + override def getLongVolatile(ref: Object, clazz: Class[_], varName: String): Long = ??? +} diff --git a/library/src/scala/IArray.scala b/library/src/scala/IArray.scala index 75fcb758a3dc..0fcdfcec669c 100644 --- a/library/src/scala/IArray.scala +++ b/library/src/scala/IArray.scala @@ -1,288 +1,379 @@ package scala import reflect.ClassTag +import scala.collection.{LazyZip2, SeqView, Searching, Stepper, StepperShape} +import scala.collection.immutable.ArraySeq +import scala.collection.mutable.{ArrayBuilder, Builder} + +opaque type IArray[+T] = Array[_ <: T] + /** An immutable array. An `IArray[T]` has the same representation as an `Array[T]`, * but it cannot be updated. Unlike regular arrays, immutable arrays are covariant. */ -object opaques: - opaque type IArray[+T] = Array[_ <: T] - - private[scala] type Sub[A] >: Array[A] <: IArray[A] - private[scala] type Sup[A] >: IArray[A] <: Array[_ <: A] - - /** Defines extension methods for immutable arrays */ - given arrayOps: Object with { - - /** The selection operation on an immutable array. - * - * @param arr the immutable array - * @param n the index of the element to select - * @return the element of the array at the given index - */ - extension (arr: IArray[Byte]) def apply(n: Int): Byte = arr.asInstanceOf[Array[Byte]].apply(n) - extension (arr: IArray[Short]) def apply(n: Int): Short = arr.asInstanceOf[Array[Short]].apply(n) - extension (arr: IArray[Char]) def apply(n: Int): Char = arr.asInstanceOf[Array[Char]].apply(n) - extension (arr: IArray[Int]) def apply(n: Int): Int = arr.asInstanceOf[Array[Int]].apply(n) - extension (arr: IArray[Long]) def apply(n: Int): Long = arr.asInstanceOf[Array[Long]].apply(n) - extension (arr: IArray[Float]) def apply(n: Int): Float = arr.asInstanceOf[Array[Float]].apply(n) - extension (arr: IArray[Double]) def apply(n: Int): Double = arr.asInstanceOf[Array[Double]].apply(n) - extension [T <: Object](arr: IArray[T]) def apply (n: Int): T = arr.asInstanceOf[Array[T]].apply(n) - extension [T](arr: IArray[T]) def apply (n: Int): T = arr.asInstanceOf[Array[T]].apply(n) - - /** The number of elements in an immutable array - * @param arr the immutable array - */ - extension (arr: IArray[Byte]) def length: Int = arr.asInstanceOf[Array[Byte]].length - extension (arr: IArray[Short]) def length: Int = arr.asInstanceOf[Array[Short]].length - extension (arr: IArray[Char]) def length: Int = arr.asInstanceOf[Array[Char]].length - extension (arr: IArray[Int]) def length: Int = arr.asInstanceOf[Array[Int]].length - extension (arr: IArray[Long]) def length: Int = arr.asInstanceOf[Array[Long]].length - extension (arr: IArray[Float]) def length: Int = arr.asInstanceOf[Array[Float]].length - extension (arr: IArray[Double]) def length: Int = arr.asInstanceOf[Array[Double]].length - extension (arr: IArray[Object]) def length: Int = arr.asInstanceOf[Array[Object]].length - extension [T](arr: IArray[T]) def length: Int = arr.asInstanceOf[Array[T]].length - - /** Returns this array concatenated with the given array. */ - extension [T](arr: IArray[T]) def ++ [U >: T: ClassTag](that: IArray[U]): IArray[U] = - genericArrayOps(arr) ++ that - - /** Tests whether this array contains a given value as an element. */ - extension [T](arr: IArray[T]) def contains(elem: T): Boolean = - // `genericArrayOps(arr).contains(elem)` does not work because `elem` does not have type `arr.T` - // but we can use `exists` instead, which is how `ArrayOps#contains` itself is implemented: - genericArrayOps(arr).exists(_ == elem) - - /** Copy elements of this array to another array. */ - extension [T](arr: IArray[T]) def copyToArray[U >: T](xs: Array[U]): Int = - genericArrayOps(arr).copyToArray(xs) - - /** Copy elements of this array to another array. */ - extension [T](arr: IArray[T]) def copyToArray[U >: T](xs: Array[U], start: Int): Int = - genericArrayOps(arr).copyToArray(xs, start) - - /** Copy elements of this array to another array. */ - extension [T](arr: IArray[T]) def copyToArray[U >: T](xs: Array[U], start: Int, len: Int): Int = - genericArrayOps(arr).copyToArray(xs, start, len) - - /** Counts the number of elements in this array which satisfy a predicate */ - extension [T](arr: IArray[T]) def count(p: T => Boolean): Int = - genericArrayOps(arr).count(p) - - /** The rest of the array without its `n` first elements. */ - extension [T](arr: IArray[T]) def drop(n: Int): IArray[T] = - genericArrayOps(arr).drop(n) - - /** The rest of the array without its `n` last elements. */ - extension [T](arr: IArray[T]) def dropRight(n: Int): IArray[T] = - genericArrayOps(arr).dropRight(n) - - /** Drops longest prefix of elements that satisfy a predicate. */ - extension [T](arr: IArray[T]) def dropWhile(p: T => Boolean): IArray[T] = - genericArrayOps(arr).dropWhile(p) - - /** Tests whether a predicate holds for at least one element of this array. */ - extension [T](arr: IArray[T]) def exists(p: T => Boolean): Boolean = - genericArrayOps(arr).exists(p) - - /** Selects all elements of this array which satisfy a predicate. */ - extension [T](arr: IArray[T]) def filter(p: T => Boolean): IArray[T] = - genericArrayOps(arr).filter(p) - - /** Selects all elements of this array which do not satisfy a predicate. */ - extension [T](arr: IArray[T]) def filterNot(p: T => Boolean): IArray[T] = - genericArrayOps(arr).filterNot(p) - - /** Finds the first element of the array satisfying a predicate, if any. */ - extension [T](arr: IArray[T]) def find(p: T => Boolean): Option[T] = - genericArrayOps(arr).find(p) - - /** Builds a new array by applying a function to all elements of this array - * and using the elements of the resulting collections. */ - extension [T](arr: IArray[T]) def flatMap[U: ClassTag](f: T => IterableOnce[U]): IArray[U] = - genericArrayOps(arr).flatMap(f) - - /** Flattens a two-dimensional array by concatenating all its rows - * into a single array. */ - extension [T](arr: IArray[T]) def flatten[U: ClassTag](using T => Iterable[U]): IArray[U] = - genericArrayOps(arr).flatten - - /** Folds the elements of this array using the specified associative binary operator. */ - extension [T](arr: IArray[T]) def fold[U >: T: ClassTag](z: U)(op: (U, U) => U): U = - genericArrayOps(arr).fold(z)(op) - - /** Applies a binary operator to a start value and all elements of this array, - * going left to right. */ - extension [T](arr: IArray[T]) def foldLeft[U: ClassTag](z: U)(op: (U, T) => U): U = - genericArrayOps(arr).foldLeft(z)(op) - - /** Applies a binary operator to all elements of this array and a start value, - * going right to left. */ - extension [T](arr: IArray[T]) def foldRight[U: ClassTag](z: U)(op: (T, U) => U): U = - genericArrayOps(arr).foldRight(z)(op) - - /** Tests whether a predicate holds for all elements of this array. */ - extension [T](arr: IArray[T]) def forall(p: T => Boolean): Boolean = - genericArrayOps(arr).forall(p) - - /** Apply `f` to each element for its side effects. */ - extension [T](arr: IArray[T]) def foreach[U](f: T => U): Unit = - genericArrayOps(arr).foreach(f) - - /** Selects the first element of this array. */ - extension [T](arr: IArray[T]) def head: T = - genericArrayOps(arr).head - - /** Optionally selects the first element. */ - extension [T](arr: IArray[T]) def headOption: Option[T] = - genericArrayOps(arr).headOption - - /** Finds index of first occurrence of some value in this array after or at some start index. */ - extension [T](arr: IArray[T]) def indexOf(elem: T, from: Int = 0): Int = - // `asInstanceOf` needed because `elem` does not have type `arr.T` - // We could use `arr.iterator.indexOf(elem, from)` or `arr.indexWhere(_ == elem, from)` - // but these would incur some overhead. - genericArrayOps(arr).indexOf(elem.asInstanceOf, from) - - /** Finds index of the first element satisfying some predicate after or at some start index. */ - extension [T](arr: IArray[T]) def indexWhere(p: T => Boolean, from: Int = 0): Int = - genericArrayOps(arr).indexWhere(p, from) - - /** Produces the range of all indices of this sequence. */ - extension [T](arr: IArray[T]) def indices: Range = - genericArrayOps(arr).indices - - /** The initial part of the array without its last element. */ - extension [T](arr: IArray[T]) def init: IArray[T] = - genericArrayOps(arr).init - - /** Tests whether the array is empty. */ - extension [T](arr: IArray[T]) def isEmpty: Boolean = - genericArrayOps(arr).isEmpty - - /** An iterator yielding the elemenst of this array. */ - extension [T](arr: IArray[T]) def iterator: Iterator[T] = - genericArrayOps(arr).iterator - - /** Selects the last element. */ - extension [T](arr: IArray[T]) def last: T = - genericArrayOps(arr).last - - /** Optionally selects the last element. */ - extension [T](arr: IArray[T]) def lastOption: Option[T] = - genericArrayOps(arr).lastOption - - /** Finds index of last occurrence of some value in this array before or at a given end index. */ - extension [T](arr: IArray[T]) def lastIndexOf(elem: T, end: Int = arr.length - 1): Int = - // see: same issue in `indexOf` - genericArrayOps(arr).lastIndexOf(elem.asInstanceOf, end) - - /** Finds index of last element satisfying some predicate before or at given end index. */ - extension [T](arr: IArray[T]) def lastIndexWhere(p: T => Boolean, end: Int = arr.length - 1): Int = - genericArrayOps(arr).lastIndexWhere(p, end) - - /** Builds a new array by applying a function to all elements of this array. */ - extension [T](arr: IArray[T]) def map[U: ClassTag](f: T => U): IArray[U] = - genericArrayOps(arr).map(f) - - /** Tests whether the array is not empty. */ - extension [T](arr: IArray[T]) def nonEmpty: Boolean = - genericArrayOps(arr).nonEmpty - - /** A pair of, first, all elements that satisfy predicate `p` and, second, all elements that do not. */ - extension [T](arr: IArray[T]) def partition(p: T => Boolean): (IArray[T], IArray[T]) = - genericArrayOps(arr).partition(p) - - /** Returns a new array with the elements in reversed order. */ - extension [T](arr: IArray[T]) def reverse: IArray[T] = - genericArrayOps(arr).reverse - - /** Computes a prefix scan of the elements of the array. */ - extension [T](arr: IArray[T]) def scan[U >: T: ClassTag](z: U)(op: (U, U) => U): IArray[U] = - genericArrayOps(arr).scan(z)(op) - - /** Produces an array containing cumulative results of applying the binary - * operator going left to right. */ - extension [T](arr: IArray[T]) def scanLeft[U: ClassTag](z: U)(op: (U, T) => U): IArray[U] = - genericArrayOps(arr).scanLeft(z)(op) - - /** Produces an array containing cumulative results of applying the binary - * operator going right to left. */ - extension [T](arr: IArray[T]) def scanRight[U: ClassTag](z: U)(op: (T, U) => U): IArray[U] = - genericArrayOps(arr).scanRight(z)(op) - - /** The size of this array. */ - extension [T](arr: IArray[T]) def size: Int = - arr.length - - /** Selects the interval of elements between the given indices. */ - extension [T](arr: IArray[T]) def slice(from: Int, until: Int): IArray[T] = - genericArrayOps(arr).slice(from, until) - - /** Sorts this array according to the Ordering which results from transforming - * an implicitly given Ordering with a transformation function. */ - extension [T](arr: IArray[T]) def sortBy[U: ClassTag](f: T => U)(using math.Ordering[U]): IArray[T] = - genericArrayOps(arr).sortBy(f) - - /** Sorts this array according to a comparison function. */ - extension [T](arr: IArray[T]) def sortWith(f: (T, T) => Boolean): IArray[T] = - genericArrayOps(arr).sortWith(f) - - /** Sorts this array according to an Ordering. */ - extension [T](arr: IArray[T]) def sorted(using math.Ordering[T]): IArray[T] = - genericArrayOps(arr).sorted - - /** Splits this array into a prefix/suffix pair according to a predicate. */ - extension [T](arr: IArray[T]) def span(p: T => Boolean): (IArray[T], IArray[T]) = - genericArrayOps(arr).span(p) - - /** Splits this array into two at a given position. */ - extension [T](arr: IArray[T]) def splitAt(n: Int): (IArray[T], IArray[T]) = - genericArrayOps(arr).splitAt(n) - - /** Tests whether this array starts with the given array. */ - extension [T](arr: IArray[T]) def startsWith[U >: T: ClassTag](that: IArray[U], offset: Int = 0): Boolean = - genericArrayOps(arr).startsWith(that) - - /** The rest of the array without its first element. */ - extension [T](arr: IArray[T]) def tail: IArray[T] = - genericArrayOps(arr).tail - - /** An array containing the first `n` elements of this array. */ - extension [T](arr: IArray[T]) def take(n: Int): IArray[T] = - genericArrayOps(arr).take(n) - - /** An array containing the last `n` elements of this array. */ - extension [T](arr: IArray[T]) def takeRight(n: Int): IArray[T] = - genericArrayOps(arr).takeRight(n) - - /** Takes longest prefix of elements that satisfy a predicate. */ - extension [T](arr: IArray[T]) def takeWhile(p: T => Boolean): IArray[T] = - genericArrayOps(arr).takeWhile(p) - - /** Returns a mutable copy of this immutable array. */ - extension [T](arr: IArray[T]) def toArray: Array[T] = - arr.clone.asInstanceOf[Array[T]] - - /** Converts an array of pairs into an array of first elements and an array of second elements. */ - extension [U: ClassTag, V: ClassTag](arr: IArray[(U, V)]) def unzip: (IArray[U], IArray[V]) = - genericArrayOps(arr).unzip - - /** Returns an array formed from this array and another iterable collection - * by combining corresponding elements in pairs. - * If one of the two collections is longer than the other, its remaining elements are ignored. */ - extension [T](arr: IArray[T]) def zip[U: ClassTag](that: IArray[U]): IArray[(T, U)] = - genericArrayOps(arr).zip(that) - } -end opaques - -type IArray[+T] = opaques.IArray[T] - -object IArray { - import opaques.Sub - import opaques.Sup - - // A convenience to avoid having to cast everything by hand - private given [A]: Conversion[Array[A], IArray[A]] = identity[Sub[A]] +object IArray: + + /** The selection operation on an immutable array. + * + * @param arr the immutable array + * @param n the index of the element to select + * @return the element of the array at the given index + */ + extension (arr: IArray[Byte]) def apply(n: Int): Byte = arr.asInstanceOf[Array[Byte]].apply(n) + extension (arr: IArray[Short]) def apply(n: Int): Short = arr.asInstanceOf[Array[Short]].apply(n) + extension (arr: IArray[Char]) def apply(n: Int): Char = arr.asInstanceOf[Array[Char]].apply(n) + extension (arr: IArray[Int]) def apply(n: Int): Int = arr.asInstanceOf[Array[Int]].apply(n) + extension (arr: IArray[Long]) def apply(n: Int): Long = arr.asInstanceOf[Array[Long]].apply(n) + extension (arr: IArray[Float]) def apply(n: Int): Float = arr.asInstanceOf[Array[Float]].apply(n) + extension (arr: IArray[Double]) def apply(n: Int): Double = arr.asInstanceOf[Array[Double]].apply(n) + extension [T <: Object](arr: IArray[T]) def apply (n: Int): T = arr.asInstanceOf[Array[T]].apply(n) + extension [T](arr: IArray[T]) def apply (n: Int): T = arr.asInstanceOf[Array[T]].apply(n) + + /** The number of elements in an immutable array + * @param arr the immutable array + */ + extension (arr: IArray[Byte]) def length: Int = arr.asInstanceOf[Array[Byte]].length + extension (arr: IArray[Short]) def length: Int = arr.asInstanceOf[Array[Short]].length + extension (arr: IArray[Char]) def length: Int = arr.asInstanceOf[Array[Char]].length + extension (arr: IArray[Int]) def length: Int = arr.asInstanceOf[Array[Int]].length + extension (arr: IArray[Long]) def length: Int = arr.asInstanceOf[Array[Long]].length + extension (arr: IArray[Float]) def length: Int = arr.asInstanceOf[Array[Float]].length + extension (arr: IArray[Double]) def length: Int = arr.asInstanceOf[Array[Double]].length + extension (arr: IArray[Object]) def length: Int = arr.asInstanceOf[Array[Object]].length + extension [T](arr: IArray[T]) def length: Int = arr.asInstanceOf[Array[T]].length + + + /** Tests whether this array contains a given value as an element. */ + extension [T](arr: IArray[T]) def contains(elem: T): Boolean = + genericArrayOps(arr).contains(elem.asInstanceOf) + + /** Copy elements of this array to another array. */ + extension [T](arr: IArray[T]) def copyToArray[U >: T](xs: Array[U]): Int = + genericArrayOps(arr).copyToArray(xs) + + /** Copy elements of this array to another array. */ + extension [T](arr: IArray[T]) def copyToArray[U >: T](xs: Array[U], start: Int): Int = + genericArrayOps(arr).copyToArray(xs, start) + + /** Copy elements of this array to another array. */ + extension [T](arr: IArray[T]) def copyToArray[U >: T](xs: Array[U], start: Int, len: Int): Int = + genericArrayOps(arr).copyToArray(xs, start, len) + + /** Counts the number of elements in this array which satisfy a predicate */ + extension [T](arr: IArray[T]) def count(p: T => Boolean): Int = + genericArrayOps(arr).count(p) + + /** The rest of the array without its `n` first elements. */ + extension [T](arr: IArray[T]) def drop(n: Int): IArray[T] = + genericArrayOps(arr).drop(n) + + /** The rest of the array without its `n` last elements. */ + extension [T](arr: IArray[T]) def dropRight(n: Int): IArray[T] = + genericArrayOps(arr).dropRight(n) + + /** Drops longest prefix of elements that satisfy a predicate. */ + extension [T](arr: IArray[T]) def dropWhile(p: T => Boolean): IArray[T] = + genericArrayOps(arr).dropWhile(p) + + /** Tests whether a predicate holds for at least one element of this array. */ + extension [T](arr: IArray[T]) def exists(p: T => Boolean): Boolean = + genericArrayOps(arr).exists(p) + + /** Selects all elements of this array which satisfy a predicate. */ + extension [T](arr: IArray[T]) def filter(p: T => Boolean): IArray[T] = + genericArrayOps(arr).filter(p) + + /** Selects all elements of this array which do not satisfy a predicate. */ + extension [T](arr: IArray[T]) def filterNot(p: T => Boolean): IArray[T] = + genericArrayOps(arr).filterNot(p) + + /** Finds the first element of the array satisfying a predicate, if any. */ + extension [T](arr: IArray[T]) def find(p: T => Boolean): Option[T] = + genericArrayOps(arr).find(p) + + /** Builds a new array by applying a function to all elements of this array + * and using the elements of the resulting collections. */ + extension [T](arr: IArray[T]) def flatMap[U: ClassTag](f: T => IterableOnce[U]): IArray[U] = + genericArrayOps(arr).flatMap(f) + + /** Flattens a two-dimensional array by concatenating all its rows + * into a single array. */ + extension [T](arr: IArray[T]) def flatten[U](using asIterable: T => Iterable[U], ct: ClassTag[U]): IArray[U] = + genericArrayOps(arr).flatten + + /** Folds the elements of this array using the specified associative binary operator. */ + extension [T](arr: IArray[T]) def fold[U >: T](z: U)(op: (U, U) => U): U = + genericArrayOps(arr).fold(z)(op) + + /** Applies a binary operator to a start value and all elements of this array, + * going left to right. */ + extension [T](arr: IArray[T]) def foldLeft[U](z: U)(op: (U, T) => U): U = + genericArrayOps(arr).foldLeft(z)(op) + + /** Applies a binary operator to all elements of this array and a start value, + * going right to left. */ + extension [T](arr: IArray[T]) def foldRight[U](z: U)(op: (T, U) => U): U = + genericArrayOps(arr).foldRight(z)(op) + + /** Tests whether a predicate holds for all elements of this array. */ + extension [T](arr: IArray[T]) def forall(p: T => Boolean): Boolean = + genericArrayOps(arr).forall(p) + + /** Apply `f` to each element for its side effects. */ + extension [T](arr: IArray[T]) def foreach[U](f: T => U): Unit = + genericArrayOps(arr).foreach(f) + + /** Selects the first element of this array. */ + extension [T](arr: IArray[T]) def head: T = + genericArrayOps(arr).head + + /** Optionally selects the first element. */ + extension [T](arr: IArray[T]) def headOption: Option[T] = + genericArrayOps(arr).headOption + + /** Finds index of first occurrence of some value in this array after or at some start index. */ + extension [T](arr: IArray[T]) def indexOf(elem: T, from: Int = 0): Int = + // `asInstanceOf` needed because `elem` does not have type `arr.T` + // We could use `arr.iterator.indexOf(elem, from)` or `arr.indexWhere(_ == elem, from)` + // but these would incur some overhead. + genericArrayOps(arr).indexOf(elem.asInstanceOf, from) + + /** Finds index of the first element satisfying some predicate after or at some start index. */ + extension [T](arr: IArray[T]) def indexWhere(p: T => Boolean, from: Int = 0): Int = + genericArrayOps(arr).indexWhere(p, from) + + /** Produces the range of all indices of this sequence. */ + extension [T](arr: IArray[T]) def indices: Range = + genericArrayOps(arr).indices + + /** The initial part of the array without its last element. */ + extension [T](arr: IArray[T]) def init: IArray[T] = + genericArrayOps(arr).init + + /** Tests whether the array is empty. */ + extension [T](arr: IArray[T]) def isEmpty: Boolean = + genericArrayOps(arr).isEmpty + + /** An iterator yielding the elemenst of this array. */ + extension [T](arr: IArray[T]) def iterator: Iterator[T] = + genericArrayOps(arr).iterator + + /** Selects the last element. */ + extension [T](arr: IArray[T]) def last: T = + genericArrayOps(arr).last + + /** Optionally selects the last element. */ + extension [T](arr: IArray[T]) def lastOption: Option[T] = + genericArrayOps(arr).lastOption + + /** Finds index of last occurrence of some value in this array before or at a given end index. */ + extension [T](arr: IArray[T]) def lastIndexOf(elem: T, end: Int = arr.length - 1): Int = + // see: same issue in `indexOf` + genericArrayOps(arr).lastIndexOf(elem.asInstanceOf, end) + + /** Finds index of last element satisfying some predicate before or at given end index. */ + extension [T](arr: IArray[T]) def lastIndexWhere(p: T => Boolean, end: Int = arr.length - 1): Int = + genericArrayOps(arr).lastIndexWhere(p, end) + + /** Builds a new array by applying a function to all elements of this array. */ + extension [T](arr: IArray[T]) def map[U: ClassTag](f: T => U): IArray[U] = + genericArrayOps(arr).map(f) + + /** Tests whether the array is not empty. */ + extension [T](arr: IArray[T]) def nonEmpty: Boolean = + genericArrayOps(arr).nonEmpty + + /** A pair of, first, all elements that satisfy predicate `p` and, second, all elements that do not. */ + extension [T](arr: IArray[T]) def partition(p: T => Boolean): (IArray[T], IArray[T]) = + genericArrayOps(arr).partition(p) + + /** Returns a new array with the elements in reversed order. */ + extension [T](arr: IArray[T]) def reverse: IArray[T] = + genericArrayOps(arr).reverse + + /** Computes a prefix scan of the elements of the array. */ + extension [T](arr: IArray[T]) def scan[U >: T: ClassTag](z: U)(op: (U, U) => U): IArray[U] = + genericArrayOps(arr).scan(z)(op) + + /** Produces an array containing cumulative results of applying the binary + * operator going left to right. */ + extension [T](arr: IArray[T]) def scanLeft[U: ClassTag](z: U)(op: (U, T) => U): IArray[U] = + genericArrayOps(arr).scanLeft(z)(op) + + /** Produces an array containing cumulative results of applying the binary + * operator going right to left. */ + extension [T](arr: IArray[T]) def scanRight[U: ClassTag](z: U)(op: (T, U) => U): IArray[U] = + genericArrayOps(arr).scanRight(z)(op) + + /** The size of this array. */ + extension [T](arr: IArray[T]) def size: Int = + arr.length + + /** Selects the interval of elements between the given indices. */ + extension [T](arr: IArray[T]) def slice(from: Int, until: Int): IArray[T] = + genericArrayOps(arr).slice(from, until) + + /** Sorts this array according to the Ordering which results from transforming + * an implicitly given Ordering with a transformation function. */ + extension [T](arr: IArray[T]) def sortBy[U](f: T => U)(using math.Ordering[U]): IArray[T] = + genericArrayOps(arr).sortBy(f) + + /** Sorts this array according to a comparison function. */ + extension [T](arr: IArray[T]) def sortWith(f: (T, T) => Boolean): IArray[T] = + genericArrayOps(arr).sortWith(f) + + /** Sorts this array according to an Ordering. */ + extension [T](arr: IArray[T]) def sorted(using math.Ordering[T]): IArray[T] = + genericArrayOps(arr).sorted + + /** Splits this array into a prefix/suffix pair according to a predicate. */ + extension [T](arr: IArray[T]) def span(p: T => Boolean): (IArray[T], IArray[T]) = + genericArrayOps(arr).span(p) + + /** Splits this array into two at a given position. */ + extension [T](arr: IArray[T]) def splitAt(n: Int): (IArray[T], IArray[T]) = + genericArrayOps(arr).splitAt(n) + + /** The rest of the array without its first element. */ + extension [T](arr: IArray[T]) def tail: IArray[T] = + genericArrayOps(arr).tail + + /** An array containing the first `n` elements of this array. */ + extension [T](arr: IArray[T]) def take(n: Int): IArray[T] = + genericArrayOps(arr).take(n) + + /** An array containing the last `n` elements of this array. */ + extension [T](arr: IArray[T]) def takeRight(n: Int): IArray[T] = + genericArrayOps(arr).takeRight(n) + + /** Takes longest prefix of elements that satisfy a predicate. */ + extension [T](arr: IArray[T]) def takeWhile(p: T => Boolean): IArray[T] = + genericArrayOps(arr).takeWhile(p) + + /** Returns a mutable copy of this immutable array. */ + extension [T](arr: IArray[T]) def toArray: Array[T] = + arr.clone.asInstanceOf[Array[T]] + + extension [T](arr: IArray[T]) + def ++[U >: T: ClassTag](suffix: IArray[U]): IArray[U] = genericArrayOps(arr) ++ suffix.toSeq + def ++[U >: T: ClassTag](suffix: IterableOnce[U]): IArray[U] = genericArrayOps(arr) ++ suffix + def :+ [U >: T: ClassTag](x: U): IArray[U] = genericArrayOps(arr) :+ x + def :++ [U >: T: ClassTag](suffix: IArray[U]): IArray[U] = genericArrayOps(arr) :++ suffix + def :++ [U >: T: ClassTag](suffix: IterableOnce[U]): IArray[U] = genericArrayOps(arr) :++ suffix + def appended[U >: T: ClassTag](x: U): IArray[U] = genericArrayOps(arr).appended(x) + def appendedAll[U >: T: ClassTag](suffix: IArray[U]): IArray[U] = genericArrayOps(arr).appendedAll(suffix) + def appendedAll[U >: T: ClassTag](suffix: IterableOnce[U]): IArray[U] = genericArrayOps(arr).appendedAll(suffix) + def collect[U: ClassTag](pf: PartialFunction[T, U]): IArray[U] = genericArrayOps(arr).collect(pf) + def collectFirst[U](f: PartialFunction[T, U]): Option[U] = genericArrayOps(arr).collectFirst(f) + def combinations(n: Int): Iterator[IArray[T]] = genericArrayOps(arr).combinations(n) + def concat[U >: T: ClassTag](suffix: IArray[U]): IArray[U] = genericArrayOps(arr).concat(suffix) + def concat[U >: T: ClassTag](suffix: IterableOnce[U]): IArray[U] = genericArrayOps(arr).concat(suffix) + def diff[U >: T](that: IArray[U]): IArray[T] = genericArrayOps(arr).diff(that.toSeq) + def diff[U >: T](that: Seq[U]): IArray[T] = genericArrayOps(arr).diff(that) + def distinct: IArray[T] = genericArrayOps(arr).distinct + def distinctBy[U](f: T => U): IArray[T] = genericArrayOps(arr).distinctBy(f) + def startsWith[U >: T](that: IArray[U]): Boolean = genericArrayOps(arr).startsWith(that, 0) + def startsWith[U >: T](that: IArray[U], offset: Int): Boolean = genericArrayOps(arr).startsWith(that, offset) + def startsWith[U >: T](that: IterableOnce[U]): Boolean = genericArrayOps(arr).startsWith(that, 0) + def startsWith[U >: T](that: IterableOnce[U], offset: Int): Boolean = genericArrayOps(arr).startsWith(that, offset) + def endsWith[U >: T](that: IArray[U]): Boolean = genericArrayOps(arr).endsWith(that) + def endsWith[U >: T](that: Iterable[U]): Boolean = genericArrayOps(arr).endsWith(that) + def groupBy[K](f: T => K): Map[K, IArray[T]] = genericArrayOps(arr).groupBy(f) + def groupMap[K, U: ClassTag](key: T => K)(f: T => U): Map[K, IArray[U]] = genericArrayOps(arr).groupMap(key)(f) + def grouped(size: Int): Iterator[IArray[T]] = genericArrayOps(arr).grouped(size) + def inits: Iterator[IArray[T]] = genericArrayOps(arr).inits + def intersect[U >: T](that: IArray[U]): IArray[T] = genericArrayOps(arr).intersect(that) + def intersect[U >: T](that: Seq[U]): IArray[T] = genericArrayOps(arr).intersect(that) + def lazyZip[U](that: IArray[U]): LazyZip2[T, U, IArray[T]] = genericArrayOps(arr).lazyZip[U](that).asInstanceOf[LazyZip2[T, U, IArray[T]]] + def lazyZip[U](that: Iterable[U]): LazyZip2[T, U, IArray[T]] = genericArrayOps(arr).lazyZip[U](that).asInstanceOf[LazyZip2[T, U, IArray[T]]] + def lengthCompare(len: Int): Int = genericArrayOps(arr).lengthCompare(len) + def padTo[U >: T: ClassTag](len: Int, elem: U): IArray[U] = genericArrayOps(arr).padTo(len, elem) + def partitionMap[T1: ClassTag, T2: ClassTag](f: T => Either[T1, T2]): (IArray[T1], IArray[T2]) = genericArrayOps(arr).partitionMap(f) + def patch[U >: T: ClassTag](from: Int, other: IterableOnce[U], replaced: Int): IArray[U] = genericArrayOps(arr).patch(from, other, replaced) + def permutations: Iterator[IArray[T]] = genericArrayOps(arr).permutations + def prepended[U >: T: ClassTag](x: U): IArray[U] = genericArrayOps(arr).prepended(x) + def prependedAll[U >: T: ClassTag](prefix: IterableOnce[U]): IArray[U] = genericArrayOps(arr).prependedAll(prefix) + def reverseIterator: Iterator[T] = genericArrayOps(arr).reverseIterator + def search[U >: T](elem: U)(using Ordering[U]): Searching.SearchResult = arr.toSeq.search(elem) + def search[U >: T](elem: U, from: Int, to: Int)(using Ordering[U]): Searching.SearchResult = arr.toSeq.search(elem, from, to) + def sizeCompare(that: IArray[Any]): Int = arr.toSeq.sizeCompare(that) + def sizeCompare(that: Iterable[_]): Int = arr.toSeq.sizeCompare(that) + def sizeCompare(otherSize: Int): Int = genericArrayOps(arr).sizeCompare(otherSize) + def sliding(size: Int, step: Int = 1): Iterator[IArray[T]] = genericArrayOps(arr).sliding(size, step) + def stepper[S <: Stepper[_]](using StepperShape[T, S]): S = genericArrayOps(arr).stepper[S] + def tails: Iterator[IArray[T]] = genericArrayOps(arr).tails + def tapEach[U](f: (T) => U): IArray[T] = + arr.toSeq.foreach(f) + arr + def transpose[U](implicit asArray: T => IArray[U]): IArray[IArray[U]] = + genericArrayOps(arr).transpose(using asArray.asInstanceOf[T => Array[U]]) + def unzip[T1, T2](using asPair: T => (T1, T2), ct1: ClassTag[T1], ct2: ClassTag[T2]): (IArray[T1], IArray[T2]) = genericArrayOps(arr).unzip + def unzip3[T1, T2, T3](using asTriple: T => (T1, T2, T3), ct1: ClassTag[T1], ct2: ClassTag[T2], ct3: ClassTag[T3]): (IArray[T1], IArray[T2], IArray[T3]) = genericArrayOps(arr).unzip3 + def updated[U >: T: ClassTag](index: Int, elem: U): IArray[U] = genericArrayOps(arr).updated(index, elem) + def view: SeqView[T] = genericArrayOps(arr).view + def withFilter(p: T => Boolean): WithFilter[T] = new WithFilter(p, arr) + def zip[U](that: IArray[U]): IArray[(T, U)] = genericArrayOps(arr).zip(that) + def zip[U](that: IterableOnce[U]): IArray[(T, U)] = genericArrayOps(arr).zip(that) + def zipAll[T1 >: T, U](that: IArray[U], thisElem: T1, thatElem: U): IArray[(T1, U)] = genericArrayOps(arr).zipAll(that, thisElem, thatElem) + def zipAll[T1 >: T, U](that: Iterable[U], thisElem: T1, thatElem: U): IArray[(T1, U)] = genericArrayOps(arr).zipAll(that, thisElem, thatElem) + def zipWithIndex: IArray[(T, Int)] = genericArrayOps(arr).zipWithIndex + + extension [T, U >: T: ClassTag](prefix: IterableOnce[T]) + def ++:(arr: IArray[U]): IArray[U] = genericArrayOps(arr).prependedAll(prefix) + + extension [T, U >: T: ClassTag](prefix: IArray[T]) + def ++:(arr: IArray[U]): IArray[U] = genericArrayOps(arr).prependedAll(prefix) + + extension [T, U >: T: ClassTag](x: T) + def +:(arr: IArray[U]): IArray[U] = genericArrayOps(arr).prepended(x) + + /** Conversion from IArray to immutable.ArraySeq */ + implicit def genericWrapArray[T](arr: IArray[T]): ArraySeq[T] = + if arr eq null then null else ArraySeq.unsafeWrapArray(arr) + + /** Conversion from IArray to immutable.ArraySeq */ + implicit def wrapRefArray[T <: AnyRef](arr: IArray[T]): ArraySeq.ofRef[T] = + // Since the JVM thinks arrays are covariant, one 0-length Array[AnyRef] + // is as good as another for all T <: AnyRef. Instead of creating 100,000,000 + // unique ones by way of this implicit, let's share one. + if (arr eq null) null + else if (arr.length == 0) ArraySeq.empty[AnyRef].asInstanceOf[ArraySeq.ofRef[T]] + else ArraySeq.ofRef(arr.asInstanceOf[Array[T]]) + + /** Conversion from IArray to immutable.ArraySeq */ + implicit def wrapIntArray(arr: IArray[Int]): ArraySeq.ofInt = + if (arr ne null) new ArraySeq.ofInt(arr.asInstanceOf[Array[Int]]) else null + + /** Conversion from IArray to immutable.ArraySeq */ + implicit def wrapDoubleIArray(arr: IArray[Double]): ArraySeq.ofDouble = + if (arr ne null) new ArraySeq.ofDouble(arr.asInstanceOf[Array[Double]]) else null + + /** Conversion from IArray to immutable.ArraySeq */ + implicit def wrapLongIArray(arr: IArray[Long]): ArraySeq.ofLong = + if (arr ne null) new ArraySeq.ofLong(arr.asInstanceOf[Array[Long]]) else null + + /** Conversion from IArray to immutable.ArraySeq */ + implicit def wrapFloatIArray(arr: IArray[Float]): ArraySeq.ofFloat = + if (arr ne null) new ArraySeq.ofFloat(arr.asInstanceOf[Array[Float]]) else null + + /** Conversion from IArray to immutable.ArraySeq */ + implicit def wrapCharIArray(arr: IArray[Char]): ArraySeq.ofChar = + if (arr ne null) new ArraySeq.ofChar(arr.asInstanceOf[Array[Char]]) else null + + /** Conversion from IArray to immutable.ArraySeq */ + implicit def wrapByteIArray(arr: IArray[Byte]): ArraySeq.ofByte = + if (arr ne null) new ArraySeq.ofByte(arr.asInstanceOf[Array[Byte]]) else null + + /** Conversion from IArray to immutable.ArraySeq */ + implicit def wrapShortIArray(arr: IArray[Short]): ArraySeq.ofShort = + if (arr ne null) new ArraySeq.ofShort(arr.asInstanceOf[Array[Short]]) else null + + /** Conversion from IArray to immutable.ArraySeq */ + implicit def wrapBooleanIArray(arr: IArray[Boolean]): ArraySeq.ofBoolean = + if (arr ne null) new ArraySeq.ofBoolean(arr.asInstanceOf[Array[Boolean]]) else null + + /** Conversion from IArray to immutable.ArraySeq */ + implicit def wrapUnitIArray(arr: IArray[Unit]): ArraySeq.ofUnit = + if (arr ne null) new ArraySeq.ofUnit(arr.asInstanceOf[Array[Unit]]) else null /** Convert an array into an immutable array without copying, the original array * must _not_ be mutated after this or the guaranteed immutablity of IArray will @@ -313,25 +404,44 @@ object IArray { def emptyObjectIArray: IArray[Object] = Array.emptyObjectArray /** An immutable array with given elements. */ - inline def apply[T](inline xs: T*)(using inline ct: ClassTag[T]): IArray[T] = Array(xs: _*).asInstanceOf + def apply[T](xs: T*)(using ct: ClassTag[T]): IArray[T] = Array(xs: _*) /** An immutable array with given elements. */ - inline def apply(inline x: Boolean, inline xs: Boolean*): IArray[Boolean] = Array(x, xs: _*).asInstanceOf + def apply(x: Boolean, xs: Boolean*): IArray[Boolean] = Array(x, xs: _*) /** An immutable array with given elements. */ - inline def apply(inline x: Byte, inline xs: Byte*): IArray[Byte] = Array(x, xs: _*).asInstanceOf + def apply(x: Byte, xs: Byte*): IArray[Byte] = Array(x, xs: _*) /** An immutable array with given elements. */ - inline def apply(inline x: Short, inline xs: Short*): IArray[Short] = Array(x, xs: _*).asInstanceOf + def apply(x: Short, xs: Short*): IArray[Short] = Array(x, xs: _*) /** An immutable array with given elements. */ - inline def apply(inline x: Char, inline xs: Char*): IArray[Char] = Array(x, xs: _*).asInstanceOf + def apply(x: Char, xs: Char*): IArray[Char] = Array(x, xs: _*) /** An immutable array with given elements. */ - inline def apply(inline x: Int, inline xs: Int*): IArray[Int] = Array(x, xs: _*).asInstanceOf + def apply(x: Int, xs: Int*): IArray[Int] = Array(x, xs: _*) /** An immutable array with given elements. */ - inline def apply(inline x: Long, inline xs: Long*): IArray[Long] = Array(x, xs: _*).asInstanceOf + def apply(x: Long, xs: Long*): IArray[Long] = Array(x, xs: _*) /** An immutable array with given elements. */ - inline def apply(inline x: Float, inline xs: Float*): IArray[Float] = Array(x, xs: _*).asInstanceOf + def apply(x: Float, xs: Float*): IArray[Float] = Array(x, xs: _*) /** An immutable array with given elements. */ - inline def apply(inline x: Double, inline xs: Double*): IArray[Double] = Array(x, xs: _*).asInstanceOf + def apply(x: Double, xs: Double*): IArray[Double] = Array(x, xs: _*) /** An immutable array with given elements. */ - inline def apply(inline x: Unit, inline xs: Unit*): IArray[Unit] = Array(x, xs: _*).asInstanceOf + def apply(x: Unit, xs: Unit*): IArray[Unit] = Array(x, xs: _*) + + /** Build an array from the iterable collection. + * + * {{{ + * scala> val a = Array.from(Seq(1, 5)) + * val a: Array[Int] = Array(1, 5) + * + * scala> val b = Array.from(Range(1, 5)) + * val b: Array[Int] = Array(1, 2, 3, 4) + * }}} + * + * @param it the iterable collection + * @return an array consisting of elements of the iterable collection + */ + def from[A : ClassTag](it: IterableOnce[A]): Array[A] = + Array.from(it) + + def newBuilder[T](using t: ClassTag[T]): Builder[T, IArray[T]] = + ArrayBuilder.make[T].mapResult(IArray.unsafeFromArray) /** Concatenates all arrays into a single immutable array. * @@ -361,8 +471,7 @@ object IArray { * @param elem the element computation */ def fill[T: ClassTag](n1: Int, n2: Int)(elem: => T): IArray[IArray[T]] = - // We cannot avoid a cast here as Array.fill creates inner arrays out of our control: - Array.fill(n1, n2)(elem).asInstanceOf + Array.fill(n1, n2)(elem) /** Returns a three-dimensional immutable array that contains the results of some element computation a number * of times. Each element is determined by a separate computation. @@ -373,7 +482,7 @@ object IArray { * @param elem the element computation */ def fill[T: ClassTag](n1: Int, n2: Int, n3: Int)(elem: => T): IArray[IArray[IArray[T]]] = - Array.fill(n1, n2, n3)(elem).asInstanceOf + Array.fill(n1, n2, n3)(elem) /** Returns a four-dimensional immutable array that contains the results of some element computation a number * of times. Each element is determined by a separate computation. @@ -385,7 +494,7 @@ object IArray { * @param elem the element computation */ def fill[T: ClassTag](n1: Int, n2: Int, n3: Int, n4: Int)(elem: => T): IArray[IArray[IArray[IArray[T]]]] = - Array.fill(n1, n2, n3, n4)(elem).asInstanceOf + Array.fill(n1, n2, n3, n4)(elem) /** Returns a five-dimensional immutable array that contains the results of some element computation a number * of times. Each element is determined by a separate computation. @@ -398,7 +507,7 @@ object IArray { * @param elem the element computation */ def fill[T: ClassTag](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(elem: => T): IArray[IArray[IArray[IArray[IArray[T]]]]] = - Array.fill(n1, n2, n3, n4, n5)(elem).asInstanceOf + Array.fill(n1, n2, n3, n4, n5)(elem) /** Returns an immutable array containing values of a given function over a range of integer * values starting from 0. @@ -417,7 +526,7 @@ object IArray { * @param f The function computing element values */ def tabulate[T: ClassTag](n1: Int, n2: Int)(f: (Int, Int) => T): IArray[IArray[T]] = - Array.tabulate(n1, n2)(f).asInstanceOf + Array.tabulate(n1, n2)(f) /** Returns a three-dimensional immutable array containing values of a given function * over ranges of integer values starting from `0`. @@ -428,7 +537,7 @@ object IArray { * @param f The function computing element values */ def tabulate[T: ClassTag](n1: Int, n2: Int, n3: Int)(f: (Int, Int, Int) => T): IArray[IArray[IArray[T]]] = - Array.tabulate(n1, n2, n3)(f).asInstanceOf + Array.tabulate(n1, n2, n3)(f) /** Returns a four-dimensional immutable array containing values of a given function * over ranges of integer values starting from `0`. @@ -440,7 +549,7 @@ object IArray { * @param f The function computing element values */ def tabulate[T: ClassTag](n1: Int, n2: Int, n3: Int, n4: Int)(f: (Int, Int, Int, Int) => T): IArray[IArray[IArray[IArray[T]]]] = - Array.tabulate(n1, n2, n3, n4)(f).asInstanceOf + Array.tabulate(n1, n2, n3, n4)(f) /** Returns a five-dimensional immutable array containing values of a given function * over ranges of integer values starting from `0`. @@ -453,7 +562,7 @@ object IArray { * @param f The function computing element values */ def tabulate[T: ClassTag](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(f: (Int, Int, Int, Int, Int) => T): IArray[IArray[IArray[IArray[IArray[T]]]]] = - Array.tabulate(n1, n2, n3, n4, n5)(f).asInstanceOf + Array.tabulate(n1, n2, n3, n4, n5)(f) /** Returns an immutable array containing a sequence of increasing integers in a range. * @@ -482,14 +591,85 @@ object IArray { */ def iterate[T: ClassTag](start: T, len: Int)(f: T => T): IArray[T] = Array.iterate(start, len)(f) + /** Compare two arrays per element. + * + * A more efficient version of `xs.sameElements(ys)`. + * + * @param xs an array of AnyRef + * @param ys an array of AnyRef + * @return true if corresponding elements are equal + */ + def equals(xs: IArray[AnyRef], ys: IArray[AnyRef]): Boolean = + Array.equals(xs.asInstanceOf[Array[AnyRef]], ys.asInstanceOf[Array[AnyRef]]) + /** Returns a decomposition of the array into a sequence. This supports * a pattern match like `{ case IArray(x,y,z) => println('3 elements')}`. * * @param x the selector value * @return sequence wrapped in a [[scala.Some]], if `x` is a Seq, otherwise `None` */ - def unapplySeq[T](x: IArray[T]) = - // The double type ascription is currently needed, - // for some reason (see: https://scastie.scala-lang.org/sSsmOhKxSKym405MgNRKqQ) - Array.unapplySeq((x: Sup[T]): Array[_ <: T]) -} + def unapplySeq[T](x: IArray[T]): Array.UnapplySeqWrapper[_ <: T] = + Array.unapplySeq(x) + + /** A lazy filtered array. No filtering is applied until one of `foreach`, `map` or `flatMap` is called. */ + class WithFilter[T](p: T => Boolean, xs: IArray[T]): + + /** Apply `f` to each element for its side effects. + * Note: [U] parameter needed to help scalac's type inference. + */ + def foreach[U](f: T => U): Unit = { + val len = xs.length + var i = 0 + while(i < len) { + val x = xs(i) + if(p(x)) f(x) + i += 1 + } + } + + /** Builds a new array by applying a function to all elements of this array. + * + * @param f the function to apply to each element. + * @tparam U the element type of the returned array. + * @return a new array resulting from applying the given function + * `f` to each element of this array and collecting the results. + */ + def map[U: ClassTag](f: T => U): IArray[U] = { + val b = IArray.newBuilder[U] + var i = 0 + while (i < xs.length) { + val x = xs(i) + if(p(x)) b += f(x) + i = i + 1 + } + b.result() + } + + /** Builds a new array by applying a function to all elements of this array + * and using the elements of the resulting collections. + * + * @param f the function to apply to each element. + * @tparam U the element type of the returned array. + * @return a new array resulting from applying the given collection-valued function + * `f` to each element of this array and concatenating the results. + */ + def flatMap[U: ClassTag](f: T => IterableOnce[U]): IArray[U] = { + val b = IArray.newBuilder[U] + var i = 0 + while(i < xs.length) { + val x = xs(i) + if(p(x)) b ++= f(xs(i)) + i += 1 + } + b.result() + } + + def flatMap[BS, U](f: T => BS)(using asIterable: BS => Iterable[U], m: ClassTag[U]): IArray[U] = + flatMap[U](x => asIterable(f(x))) + + /** Creates a new non-strict filter which combines this filter with the given predicate. */ + def withFilter(q: T => Boolean): WithFilter[T] = new WithFilter[T](a => p(a) && q(a), xs) + + end WithFilter + +end IArray diff --git a/library/src/scala/compiletime/package.scala b/library/src/scala/compiletime/package.scala index 8ebaf801f3e1..7816e16792c7 100644 --- a/library/src/scala/compiletime/package.scala +++ b/library/src/scala/compiletime/package.scala @@ -84,14 +84,14 @@ package object compiletime { * cannot be constructed from the provided type. Otherwise returns * that value wrapped in `Some`. */ - inline def constValueOpt[T]: Option[T] = + transparent inline def constValueOpt[T]: Option[T] = // implemented in dotty.tools.dotc.typer.Inliner error("Compiler bug: `constValueOpt` was not evaluated by the compiler") /** Given a constant, singleton type `T`, convert it to a value * of the same singleton type. For example: `assert(constValue[1] == 1)`. */ - inline def constValue[T]: T = + transparent inline def constValue[T]: T = // implemented in dotty.tools.dotc.typer.Inliner error("Compiler bug: `constValue` was not evaluated by the compiler") diff --git a/library/src/scala/compiletime/testing/package.scala b/library/src/scala/compiletime/testing/package.scala index 780debc87b20..ebe629244fb3 100644 --- a/library/src/scala/compiletime/testing/package.scala +++ b/library/src/scala/compiletime/testing/package.scala @@ -2,6 +2,8 @@ package scala.compiletime package testing /** Whether the code type checks in the current context? + * + * An inline definition with a call to `typeChecks` should be transparent. * * @param code The code to be type checked * @@ -9,7 +11,7 @@ package testing * * The code should be a sequence of expressions or statements that may appear in a block. */ -inline def typeChecks(inline code: String): Boolean = +transparent inline def typeChecks(inline code: String): Boolean = // implemented in package dotty.tools.dotc.typer.Inliner.Intrinsics error("Compiler bug: `typeChecks` was not checked by the compiler") @@ -20,12 +22,14 @@ inline def typeChecks(inline code: String): Boolean = * version to version. This API is to be used for testing purposes * only. * + * An inline definition with a call to `typeCheckErrors` should be transparent. + * * @param code The code to be type checked * * @return a list of errors encountered during parsing and typechecking. * * The code should be a sequence of expressions or statements that may appear in a block. */ -inline def typeCheckErrors(inline code: String): List[Error] = +transparent inline def typeCheckErrors(inline code: String): List[Error] = // implemented in package dotty.tools.dotc.typer.Inliner.Intrinsics error("Compiler bug: `typeCheckErrors` was not checked by the compiler") diff --git a/library/src/scala/quoted/FromExpr.scala b/library/src/scala/quoted/FromExpr.scala index 6f57c542af50..8cd52cede033 100644 --- a/library/src/scala/quoted/FromExpr.scala +++ b/library/src/scala/quoted/FromExpr.scala @@ -25,7 +25,7 @@ trait FromExpr[T] { object FromExpr { /** Default implementation of `FromExpr[Boolean]` - * - Unlifts `'{true}` into `Some(ture)` + * - Unlifts `'{true}` into `Some(true)` * - Unlifts `'{false}` into `Some(false)` * - Otherwise unlifts to `None` */ diff --git a/library/src/scala/quoted/Quotes.scala b/library/src/scala/quoted/Quotes.scala index 09a7d11bfd6a..31c840e49578 100644 --- a/library/src/scala/quoted/Quotes.scala +++ b/library/src/scala/quoted/Quotes.scala @@ -217,6 +217,19 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => */ trait reflectModule { self: reflect.type => + /** Module object of `type CompilationInfo` */ + val CompilationInfo: CompilationInfoModule + + /** Methods of the module object `val CompilationInfo` */ + trait CompilationInfoModule { this: CompilationInfo.type => + /** Are we expanding a `inline` macro while typing the program? + * + * This will be true when the macro is used in a transparent inline. + */ + def isWhileTyping: Boolean + } + + /** Returns the `Term` representation this expression */ extension (expr: Expr[Any]) def asTerm: Term diff --git a/library/src/scala/quoted/ToExpr.scala b/library/src/scala/quoted/ToExpr.scala index 5d070f03eb18..b13a88caa4fe 100644 --- a/library/src/scala/quoted/ToExpr.scala +++ b/library/src/scala/quoted/ToExpr.scala @@ -408,8 +408,9 @@ object ToExpr { /** Default implemetation of `ToExpr[H *: T]` */ given TupleConsToExpr [H: Type: ToExpr, T <: Tuple: Type: ToExpr]: ToExpr[H *: T] with { def apply(tup: H *: T)(using Quotes): Expr[H *: T] = - '{ ${summon[ToExpr[H]].apply(tup.head)} *: ${summon[ToExpr[T]].apply(tup.tail)} } - // '{ ${Expr(tup.head)} *: ${Expr(tup.tail)} } // TODO figure out why this fails during CI documentation + val head = Expr[H](tup.head) + val tail = Expr[T](tup.tail) + '{ $head *: $tail } } /** Default implemetation of `ToExpr[BigInt]` */ diff --git a/library/src/scala/runtime/stdLibPatches/Predef.scala b/library/src/scala/runtime/stdLibPatches/Predef.scala index d811d7d2e3fb..e27e77e0d9f9 100644 --- a/library/src/scala/runtime/stdLibPatches/Predef.scala +++ b/library/src/scala/runtime/stdLibPatches/Predef.scala @@ -3,10 +3,10 @@ package scala.runtime.stdLibPatches object Predef: import compiletime.summonFrom - inline def assert(inline assertion: Boolean, inline message: => Any): Unit = + transparent inline def assert(inline assertion: Boolean, inline message: => Any): Unit = if !assertion then scala.runtime.Scala3RunTime.assertFailed(message) - inline def assert(inline assertion: Boolean): Unit = + transparent inline def assert(inline assertion: Boolean): Unit = if !assertion then scala.runtime.Scala3RunTime.assertFailed() /** diff --git a/library/src/scala/runtime/stdLibPatches/language.scala b/library/src/scala/runtime/stdLibPatches/language.scala index 2799a1969809..c63bebd96766 100644 --- a/library/src/scala/runtime/stdLibPatches/language.scala +++ b/library/src/scala/runtime/stdLibPatches/language.scala @@ -79,6 +79,10 @@ object language: object unsafeNulls + object future + + object `future-migration` + /** Set source version to 3.0-migration. * * @see [[https://scalacenter.github.io/scala-3-migration-guide/docs/scala-3-migration-mode]] @@ -91,6 +95,7 @@ object language: */ object `3.0` +/* This can be added when we go to 3.1 /** Set source version to 3.1-migration. * * @see [[https://scalacenter.github.io/scala-3-migration-guide/docs/scala-3-migration-mode]] @@ -102,4 +107,5 @@ object language: * @see [[https://scalacenter.github.io/scala-3-migration-guide/docs/scala-3-migration-mode]] */ object `3.1` +*/ end language diff --git a/project/Build.scala b/project/Build.scala index f015bd7760f5..9d233d3dae2f 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -124,10 +124,7 @@ object Build { val scala = inputKey[Unit]("run compiled binary using the correct classpath, or the user supplied classpath") // Compiles the documentation and static site - val genDocs = inputKey[Unit]("run dottydoc to generate static documentation site") - - // Shorthand for compiling a docs site - val dottydoc = inputKey[Unit]("run dottydoc") + val genDocs = inputKey[Unit]("run scaladoc to generate static documentation site") // Only available in vscode-dotty val unpublish = taskKey[Unit]("Unpublish a package") @@ -224,9 +221,7 @@ object Build { ) lazy val disableDocSetting = - // Disable scaladoc generation, it's way too slow and we'll replace it - // by dottydoc anyway. We still publish an empty -javadoc.jar to make - // sonatype happy. + // This is a legacy settings, we should reevalute generating javadocs sources in (Compile, doc) := Seq() lazy val commonSettings = publishSettings ++ Seq( @@ -317,7 +312,7 @@ object Build { // Compile using the non-bootstrapped and non-published dotty managedScalaInstance := false, scalaInstance := { - val externalNonBootstrappedDeps = externalDependencyClasspath.in(`scala3-doc`, Compile).value + val externalNonBootstrappedDeps = externalDependencyClasspath.in(`scaladoc-nonBootstrapped`, Compile).value val scalaLibrary = findArtifact(externalNonBootstrappedDeps, "scala-library") // IMPORTANT: We need to use actual jars to form the ScalaInstance and not @@ -329,9 +324,9 @@ object Build { val dottyLibrary = packageBin.in(`scala3-library`, Compile).value val dottyInterfaces = packageBin.in(`scala3-interfaces`, Compile).value val dottyCompiler = packageBin.in(`scala3-compiler`, Compile).value - val dottyDoc = packageBin.in(`scala3-doc`, Compile).value + val scaladoc = packageBin.in(`scaladoc-nonBootstrapped`, Compile).value - val allJars = Seq(tastyCore, dottyLibrary, dottyInterfaces, dottyCompiler, dottyDoc) ++ externalNonBootstrappedDeps.map(_.data) + val allJars = Seq(tastyCore, dottyLibrary, dottyInterfaces, dottyCompiler, scaladoc) ++ externalNonBootstrappedDeps.map(_.data) makeScalaInstance( state.value, @@ -376,83 +371,6 @@ object Build { lazy val `scala3-interfaces` = project.in(file("interfaces")). settings(commonJavaSettings) - private lazy val dottydocClasspath = Def.task { - val jars = (packageAll in `scala3-compiler`).value - val dottyLib = jars("scala3-library") - val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(File.pathSeparator) - val externalDeps = externalCompilerClasspathTask.value - dottyLib + File.pathSeparator + findArtifactPath(externalDeps, "scala-library") - } - - lazy val commonDocSettings = Seq( - baseDirectory in (Compile, run) := baseDirectory.value / "..", - baseDirectory in Test := baseDirectory.value / "..", - libraryDependencies ++= { - val flexmarkVersion = "0.42.12" - Seq( - "com.vladsch.flexmark" % "flexmark" % flexmarkVersion, - "com.vladsch.flexmark" % "flexmark-ext-gfm-tasklist" % flexmarkVersion, - "com.vladsch.flexmark" % "flexmark-ext-gfm-tables" % flexmarkVersion, - "com.vladsch.flexmark" % "flexmark-ext-autolink" % flexmarkVersion, - "com.vladsch.flexmark" % "flexmark-ext-anchorlink" % flexmarkVersion, - "com.vladsch.flexmark" % "flexmark-ext-emoji" % flexmarkVersion, - "com.vladsch.flexmark" % "flexmark-ext-gfm-strikethrough" % flexmarkVersion, - "com.vladsch.flexmark" % "flexmark-ext-yaml-front-matter" % flexmarkVersion, - Dependencies.`jackson-dataformat-yaml`, - "nl.big-o" % "liqp" % "0.6.7" - ) - } - ) - - def dottyDocSettings(implicit mode: Mode) = Seq( - connectInput in run := true, - - javaOptions ++= (javaOptions in `scala3-compiler`).value, - - javaOptions += "-Xss3m", - - genDocs := Def.inputTaskDyn { - val dottydocExtraArgs = spaceDelimited("").parsed - - // Make majorVersion available at dotty.epfl.ch/versions/latest-nightly-base - // Used by sbt-dotty to resolve the latest nightly - val majorVersion = (scalaBinaryVersion in LocalProject("scala3-library-bootstrapped")).value - IO.write(file("./docs/_site/versions/latest-nightly-base"), majorVersion) - - // This file is used by GitHub Pages when the page is available in a custom domain - IO.write(file("./docs/_site/CNAME"), "dotty.epfl.ch") - - val sources = unmanagedSources.in(dottyLibrary, Compile).value - val args = Seq( - "-siteroot", "docs", - "-project", "Dotty", - "-project-version", dottyVersion, - "-project-url", dottyGithubUrl, - "-project-logo", "scala3-logo.svg", - "-classpath", dottydocClasspath.value, - "-Yerased-terms" - ) ++ dottydocExtraArgs - (runMain in Compile).toTask( - s""" dotty.tools.dottydoc.Main ${args.mkString(" ")} ${sources.mkString(" ")}""" - ) - }.evaluated, - - dottydoc := Def.inputTaskDyn { - val args = spaceDelimited("").parsed - val cp = dottydocClasspath.value - - (runMain in Compile).toTask(s" dotty.tools.dottydoc.Main -classpath $cp " + args.mkString(" ")) - }.evaluated, - ) - - lazy val `scala3-doc` = project.in(file("doc-tool")).asDottyDoc(NonBootstrapped) - lazy val `scala3-doc-bootstrapped` = project.in(file("doc-tool")).asDottyDoc(Bootstrapped) - - def dottyDoc(implicit mode: Mode): Project = mode match { - case NonBootstrapped => `scala3-doc` - case Bootstrapped => `scala3-doc-bootstrapped` - } - /** Find an artifact with the given `name` in `classpath` */ def findArtifact(classpath: Def.Classpath, name: String): File = classpath .find(_.get(artifact.key).exists(_.name == name)) @@ -491,7 +409,7 @@ object Build { // get libraries onboard libraryDependencies ++= Seq( - "org.scala-lang.modules" % "scala-asm" % "9.0.0-scala-1", // used by the backend + "org.scala-lang.modules" % "scala-asm" % "9.1.0-scala-1", // used by the backend Dependencies.oldCompilerInterface, // we stick to the old version to avoid deprecation warnings "org.jline" % "jline-reader" % "3.15.0", // used by the REPL "org.jline" % "jline-terminal" % "3.15.0", @@ -835,6 +753,17 @@ object Build { javaOptions := (javaOptions in `scala3-compiler-bootstrapped`).value ) + lazy val `scala3-tasty-inspector-nonbootstrapped` = project.in(file("tasty-inspector")). + withCommonSettings(NonBootstrapped). + // We want the compiler to be present in the compiler classpath when compiling this project but not + // when compiling a project that depends on scala3-tasty-inspector (see sbt-dotty/sbt-test/sbt-dotty/tasty-inspector-example-project), + // but we always need it to be present on the JVM classpath at runtime. + dependsOn(dottyCompiler(NonBootstrapped) % "provided; compile->runtime; test->test"). + settings(commonNonBootstrappedSettings). + settings( + javaOptions := (javaOptions in `scala3-compiler`).value + ) + /** Scala library compiled by dotty using the latest published sources of the library */ lazy val `stdlib-bootstrapped` = project.in(file("stdlib-bootstrapped")). withCommonSettings(Bootstrapped). @@ -947,7 +876,7 @@ object Build { lazy val `scala3-sbt-bridge` = project.in(file("sbt-bridge/src")). // We cannot depend on any bootstrapped project to compile the bridge, since the // bridge is needed to compile these projects. - dependsOn(dottyDoc(NonBootstrapped) % Provided). + dependsOn(`scaladoc-nonBootstrapped` % Provided). settings(commonJavaSettings). settings( description := "sbt compiler bridge for Dotty", @@ -1222,7 +1151,7 @@ object Build { lazy val `scala3-bench-bootstrapped` = project.in(file("bench")).asDottyBench(Bootstrapped) lazy val `scala3-bench-run` = project.in(file("bench-run")).asDottyBench(Bootstrapped) - val testcasesOutputDir = taskKey[String]("Root directory where tests classses are generated") + val testcasesOutputDir = taskKey[Seq[String]]("Root directory where tests classses are generated") val testcasesSourceRoot = taskKey[String]("Root directory where tests sources are generated") val testDocumentationRoot = taskKey[String]("Root directory where tests documentation are stored") val generateSelfDocumentation = taskKey[Unit]("Generate example documentation") @@ -1230,6 +1159,12 @@ object Build { val generateScalaDocumentation = inputKey[Unit]("Generate documentation for dotty lib") val generateTestcasesDocumentation = taskKey[Unit]("Generate documentation for testcases, usefull for debugging tests") lazy val `scaladoc` = project.in(file("scaladoc")).asScaladoc + lazy val `scaladoc-nonBootstrapped` = project.in(file("scaladoc")).scaladocBasic(NonBootstrapped).settings( + // Unit tests in scaladoc depends on scaladoc-testcases + // we do not want to just cross compile them with bootstrapped and unbootstrapped compiler + sources.in(Test) := Nil + ) + lazy val `scaladoc-testcases` = project.in(file("scaladoc-testcases")).asScaladocTestcases lazy val `scaladoc-js` = project.in(file("scaladoc-js")).asScaladocJs @@ -1279,7 +1214,6 @@ object Build { publishLocal in `tasty-core-bootstrapped`, publishLocal in `scala3-staging`, publishLocal in `scala3-tasty-inspector`, - publishLocal in `scala3-doc-bootstrapped`, publishLocal in `scaladoc`, publishLocal in `scala3-bootstrapped` // Needed because sbt currently hardcodes the dotty artifact ).evaluated @@ -1349,7 +1283,6 @@ object Build { (publishLocal in `scala3-interfaces`).value (publishLocal in `tasty-core-bootstrapped`).value (publishLocal in `scala3-library-bootstrapped`).value - (publishLocal in `scala3-doc-bootstrapped`).value (publishLocal in `scala3-tasty-inspector`).value (publishLocal in `scaladoc`).value (publishLocal in `scala3-compiler-bootstrapped`).value @@ -1482,7 +1415,7 @@ object Build { // FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests def asDottyRoot(implicit mode: Mode): Project = project.withCommonSettings. - aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore, dottyDoc, `scala3-sbt-bridge`). + aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore, scaladoc, `scala3-sbt-bridge`). bootstrappedAggregate(`scala3-language-server`, `scala3-staging`, `scala3-tasty-inspector`, `scala3-library-bootstrappedJS`, scaladoc). dependsOn(tastyCore). @@ -1521,38 +1454,24 @@ object Build { def asTastyCoreScala2: Project = project.settings(commonScala2Settings) - def asDottyDoc(implicit mode: Mode): Project = project.withCommonSettings. - dependsOn(dottyCompiler, dottyCompiler % "test->test"). - settings(commonDocSettings). - settings(dottyDocSettings) - def asDottyBench(implicit mode: Mode): Project = project.withCommonSettings. dependsOn(dottyCompiler). settings(commonBenchmarkSettings). enablePlugins(JmhPlugin) - def asScaladoc: Project = { - def generateDocumentation(targets: String, name: String, outDir: String, ref: String, params: String = "") = Def.taskDyn { - val projectVersion = version.value - IO.createDirectory(file(outDir)) - val scala3version = stdlibVersion(Bootstrapped) - // TODO add versions etc. - val srcManaged = s"out/bootstrap/stdlib-bootstrapped/scala-$baseVersion/src_managed/main/scala-library-src" - val sourceLinks = s"-source-links:$srcManaged=github://scala/scala/v$scala3version#src/library -source-links:github://lampepfl/dotty" - val revision = s"-revision $ref -project-version $projectVersion" - val cmd = s""" -d $outDir -project "$name" $sourceLinks $revision $params $targets""" - run.in(Compile).toTask(cmd) - } - - def joinProducts(products: Seq[java.io.File]): String = - products.iterator.map(_.getAbsolutePath.toString).mkString(" ") - + def scaladocBasic(mode: Mode): Project = { val flexmarkVersion = "0.42.12" - project.settings(commonBootstrappedSettings). - dependsOn(`scala3-compiler-bootstrapped`). - dependsOn(`scala3-tasty-inspector`). - settings( + val base = if(mode == Bootstrapped) + project.settings(commonBootstrappedSettings). + dependsOn(`scala3-compiler-bootstrapped`). + dependsOn(`scala3-tasty-inspector`) + else + project.settings(commonNonBootstrappedSettings). + dependsOn(`scala3-compiler`). + dependsOn(`scala3-tasty-inspector-nonbootstrapped`) + + base.settings( libraryDependencies ++= Seq( "com.vladsch.flexmark" % "flexmark" % flexmarkVersion, "com.vladsch.flexmark" % "flexmark-html-parser" % flexmarkVersion, @@ -1570,95 +1489,135 @@ object Build { "com.novocode" % "junit-interface" % "0.11" % "test", ), - Test / test := (Test / test).dependsOn(compile.in(Compile).in(`scaladoc-testcases`)).value, - testcasesOutputDir.in(Test) := joinProducts((`scaladoc-testcases`/Compile/products).value), - testcasesSourceRoot.in(Test) := (baseDirectory.in(`scaladoc-testcases`).value / "src").getAbsolutePath.toString, Compile / mainClass := Some("dotty.tools.scaladoc.Main"), - baseDirectory.in(run) := baseDirectory.in(ThisBuild).value, - generateSelfDocumentation := Def.taskDyn { - generateDocumentation( - classDirectory.in(Compile).value.getAbsolutePath, - "scaladoc", "scaladoc/output/self", VersionUtil.gitHash, - "-siteroot scaladoc/documentation -project-logo scaladoc/documentation/logo.svg " + + Compile / buildInfoKeys := Seq[BuildInfoKey](version), + Compile / buildInfoPackage := "dotty.tools.scaladoc", + BuildInfoPlugin.buildInfoScopedSettings(Compile), + BuildInfoPlugin.buildInfoDefaultSettings, + ) + } + + def asScaladoc: Project = { + def generateDocumentation(targets: Seq[String], name: String, outDir: String, ref: String, params: Seq[String] = Nil) = + Def.taskDyn { + val distLocation = pack.in(dist).value + val projectVersion = version.value + IO.createDirectory(file(outDir)) + val scala3version = stdlibVersion(Bootstrapped) + // TODO add versions etc. + val srcManaged = s"out/bootstrap/stdlib-bootstrapped/scala-$baseVersion/src_managed/main/scala-library-src" + val sourceLinks = s"-source-links:$srcManaged=github://scala/scala/v$scala3version#src/library-source-links:github://lampepfl/dotty" + val revision = Seq("-revision", ref, "-project-version", projectVersion) + val cmd = Seq("-d", outDir, "-project", name, sourceLinks) ++ revision ++ params ++ targets + import _root_.scala.sys.process._ + Def.task((s"$distLocation/bin/scaladoc" +: cmd).!) + } + + def joinProducts(products: Seq[java.io.File]): String = + products.iterator.map(_.getAbsolutePath).mkString(" ") + + val flexmarkVersion = "0.42.12" + + scaladocBasic(Bootstrapped).settings( + Test / test := (Test / test).dependsOn(compile.in(Compile).in(`scaladoc-testcases`)).value, + testcasesOutputDir.in(Test) := (`scaladoc-testcases`/Compile/products).value.map(_.getAbsolutePath), + testcasesSourceRoot.in(Test) := (baseDirectory.in(`scaladoc-testcases`).value / "src").getAbsolutePath.toString, + baseDirectory.in(run) := baseDirectory.in(ThisBuild).value, + generateSelfDocumentation := Def.taskDyn { + generateDocumentation( + classDirectory.in(Compile).value.getAbsolutePath :: Nil, + "scaladoc", "scaladoc/output/self", VersionUtil.gitHash, + Seq( + "-siteroot", "scaladoc/documentation", + "-project-logo", "scaladoc/documentation/logo.svg", "-external-mappings:" + ".*scala.*::scaladoc3::http://dotty.epfl.ch/api/," + ".*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/" ) - }.value, - - generateScalaDocumentation := Def.inputTaskDyn { - val dottydocExtraArgs = spaceDelimited("[output]").parsed - val dest = file(dottydocExtraArgs.headOption.getOrElse("scaladoc/output/scala3")).getAbsoluteFile - val majorVersion = (scalaBinaryVersion in LocalProject("scala3-library-bootstrapped")).value - - val dottyJars: Seq[java.io.File] = Seq( - (`stdlib-bootstrapped`/Compile/products).value, - (`scala3-interfaces`/Compile/products).value, - (`tasty-core-bootstrapped`/Compile/products).value, - ).flatten - - val roots = joinProducts(dottyJars) - - val managedSources = - (`stdlib-bootstrapped`/Compile/sourceManaged).value / "scala-library-src" - val projectRoot = (ThisBuild/baseDirectory).value.toPath - val stdLibRoot = projectRoot.relativize(managedSources.toPath.normalize()) - val docRootFile = stdLibRoot.resolve("rootdoc.txt") - - if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") } - else Def.task{ - IO.write(dest / "versions" / "latest-nightly-base", majorVersion) - - // This file is used by GitHub Pages when the page is available in a custom domain - IO.write(dest / "CNAME", "dotty.epfl.ch") - }.dependsOn(generateDocumentation( - roots, "Scala 3", dest.getAbsolutePath, "master", + + ) + }.value, + generateScalaDocumentation := Def.inputTaskDyn { + val extraArgs = spaceDelimited("[output]").parsed + val dest = file(extraArgs.headOption.getOrElse("scaladoc/output/scala3")).getAbsoluteFile + val majorVersion = (scalaBinaryVersion in LocalProject("scala3-library-bootstrapped")).value + + val dottyJars: Seq[java.io.File] = Seq( + (`stdlib-bootstrapped`/Compile/products).value, + (`scala3-interfaces`/Compile/products).value, + (`tasty-core-bootstrapped`/Compile/products).value, + ).flatten + + val roots = dottyJars.map(_.getAbsolutePath) + + val managedSources = + (`stdlib-bootstrapped`/Compile/sourceManaged).value / "scala-library-src" + val projectRoot = (ThisBuild/baseDirectory).value.toPath + val stdLibRoot = projectRoot.relativize(managedSources.toPath.normalize()) + val docRootFile = stdLibRoot.resolve("rootdoc.txt") + + if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") } + else Def.task{ + IO.write(dest / "versions" / "latest-nightly-base", majorVersion) + + // This file is used by GitHub Pages when the page is available in a custom domain + IO.write(dest / "CNAME", "dotty.epfl.ch") + }.dependsOn(generateDocumentation( + roots, "Scala 3", dest.getAbsolutePath, "master", + Seq( // contains special definitions which are "transplanted" elsewhere // and which therefore confuse Scaladoc when accessed from this pkg - "-skip-by-id:scala.runtime.stdLibPatches " + + "-skip-by-id:scala.runtime.stdLibPatches", // MatchCase is a special type that represents match type cases, // Reflect doesn't expect to see it as a standalone definition // and therefore it's easier just not to document it - "-skip-by-id:scala.runtime.MatchCase " + - "-skip-by-regex:.+\\.internal($|\\..+) " + - "-skip-by-regex:.+\\.impl($|\\..+) " + - "-comment-syntax wiki -siteroot scaladoc/scala3-docs -project-logo scaladoc/scala3-docs/logo.svg " + - "-external-mappings:.*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/ " + - s"-source-links:$stdLibRoot=github://scala/scala/v${stdlibVersion(Bootstrapped)}#src/library " + - s"-doc-root-content $docRootFile" - )) - }.evaluated, - - generateTestcasesDocumentation := Def.taskDyn { - generateDocumentation(Build.testcasesOutputDir.in(Test).value, "scaladoc testcases", "scaladoc/output/testcases", "master") - }.value, - - buildInfoKeys in Test := Seq[BuildInfoKey]( - Build.testcasesOutputDir.in(Test), - Build.testcasesSourceRoot.in(Test), - Build.testDocumentationRoot, - ), - Compile / buildInfoKeys := Seq[BuildInfoKey](version), - Compile / buildInfoPackage := "dotty.tools.scaladoc", - Compile / resourceGenerators += Def.task { - val jsDestinationFile = (Compile / resourceManaged).value / "dotty_res" / "scripts" / "searchbar.js" - sbt.IO.copyFile((fullOptJS in Compile in `scaladoc-js`).value.data, jsDestinationFile) - Seq(jsDestinationFile) - }.taskValue, - Compile / resourceGenerators += Def.task { - val cssDesitnationFile = (Compile / resourceManaged).value / "dotty_res" / "styles" / "scaladoc-searchbar.css" - val cssSourceFile = (resourceDirectory in Compile in `scaladoc-js`).value / "scaladoc-searchbar.css" - FileFunction.cached(streams.value.cacheDirectory / "css-cache") { (in: Set[File]) => - in.headOption.map(sbt.IO.copyFile(_, cssDesitnationFile)) - Set(cssDesitnationFile) - }.apply(Set(cssSourceFile)).toSeq - }.taskValue, - testDocumentationRoot := (baseDirectory.value / "test-documentations").getAbsolutePath, - buildInfoPackage in Test := "dotty.tools.scaladoc.test", - BuildInfoPlugin.buildInfoScopedSettings(Test), - BuildInfoPlugin.buildInfoScopedSettings(Compile), - BuildInfoPlugin.buildInfoDefaultSettings, - ) + "-skip-by-id:scala.runtime.MatchCase", + "-skip-by-regex:.+\\.internal($|\\..+)", + "-skip-by-regex:.+\\.impl($|\\..+)", + "-comment-syntax", "wiki", + "-siteroot", "docs", + "-project-logo", "docs/logo.svg", + "-external-mappings:.*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/", + "-social-links:" + + "github::https://github.com/lampepfl/dotty," + + "gitter::https://gitter.im/scala/scala," + + "twitter::https://twitter.com/scala_lang", + s"-source-links:$stdLibRoot=github://scala/scala/v${stdlibVersion(Bootstrapped)}#src/library", + "-doc-root-content", docRootFile.toString + ) + )) + }.evaluated, + + generateTestcasesDocumentation := Def.taskDyn { + generateDocumentation( + Build.testcasesOutputDir.in(Test).value, + "scaladoc testcases", + "scaladoc/output/testcases", + "master") + }.value, + + buildInfoKeys in Test := Seq[BuildInfoKey]( + Build.testcasesOutputDir.in(Test), + Build.testcasesSourceRoot.in(Test), + Build.testDocumentationRoot, + ), + Compile / resourceGenerators += Def.task { + val jsDestinationFile = (Compile / resourceManaged).value / "dotty_res" / "scripts" / "searchbar.js" + sbt.IO.copyFile((fullOptJS in Compile in `scaladoc-js`).value.data, jsDestinationFile) + Seq(jsDestinationFile) + }.taskValue, + Compile / resourceGenerators += Def.task { + val cssDesitnationFile = (Compile / resourceManaged).value / "dotty_res" / "styles" / "scaladoc-searchbar.css" + val cssSourceFile = (resourceDirectory in Compile in `scaladoc-js`).value / "scaladoc-searchbar.css" + FileFunction.cached(streams.value.cacheDirectory / "css-cache") { (in: Set[File]) => + in.headOption.map(sbt.IO.copyFile(_, cssDesitnationFile)) + Set(cssDesitnationFile) + }.apply(Set(cssSourceFile)).toSeq + }.taskValue, + testDocumentationRoot := (baseDirectory.value / "test-documentations").getAbsolutePath, + buildInfoPackage in Test := "dotty.tools.scaladoc.test", + BuildInfoPlugin.buildInfoScopedSettings(Test), + ) } def asScaladocTestcases: Project = @@ -1678,7 +1637,7 @@ object Build { def asDist(implicit mode: Mode): Project = project. enablePlugins(PackPlugin). withCommonSettings. - dependsOn(`scala3-interfaces`, dottyCompiler, dottyLibrary, tastyCore, `scala3-staging`, `scala3-tasty-inspector`, dottyDoc). + dependsOn(`scala3-interfaces`, dottyCompiler, dottyLibrary, tastyCore, `scala3-staging`, `scala3-tasty-inspector`, scaladoc). settings(commonDistSettings). bootstrappedSettings( target := baseDirectory.value / "target" // override setting in commonBootstrappedSettings diff --git a/project/build.properties b/project/build.properties index 7de0a9382f10..0b2e09c5ac99 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.4 +sbt.version=1.4.7 diff --git a/project/scripts/bootstrapCmdTests b/project/scripts/bootstrapCmdTests index 201fc3d61ab0..d4d7313d300c 100755 --- a/project/scripts/bootstrapCmdTests +++ b/project/scripts/bootstrapCmdTests @@ -25,11 +25,14 @@ clear_out "$OUT" ./bin/scala -classpath "$OUT" "$MAIN" > "$tmp" test "$EXPECTED_OUTPUT" = "$(cat "$tmp")" +# Test scaladoc based on compiled classes +./bin/scaladoc -project Staging -d "$OUT1" "$OUT" +clear_out "$OUT1" + # check that `scalac` and `scala` works for staging clear_out "$OUT" ./bin/scalac tests/run-staging/i4044f.scala -d "$OUT" ./bin/scala -with-compiler -classpath "$OUT" Test > "$tmp" -./bin/scalad -project Staging -siteroot "$OUT" "tests/run-staging/i4044f.scala" # check that `scalac -from-tasty` compiles and `scala` runs it echo "testing ./bin/scalac -from-tasty and scala -classpath" @@ -51,6 +54,6 @@ grep -qe "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "$tm # echo ":quit" | ./dist/target/pack/bin/scala # not supported by CI -echo "testing ./bin/scalad" -clear_out "$OUT" -./bin/scalad -project Hello -siteroot "$OUT" "$SOURCE" +echo "testing ./bin/scaladoc" +clear_out "$OUT1" +./bin/scaladoc -project Hello -d "$OUT1" "$OUT/out.jar" diff --git a/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/test b/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/test index 092c454ec03f..4b6cf56e68be 100644 --- a/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/test +++ b/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/test @@ -11,7 +11,7 @@ $ copy-file changes/Macro.scala Macro.scala > clean > run -# use an implemntation of the macro that emits a compile time error +# use an implemntation of the macro that emits a compile-time error $ copy-file changes/MacroCompileError.scala Macro.scala -> compile diff --git a/scaladoc-js/resources/scaladoc-searchbar.css b/scaladoc-js/resources/scaladoc-searchbar.css index 4aaaacb98288..035adbee6555 100644 --- a/scaladoc-js/resources/scaladoc-searchbar.css +++ b/scaladoc-js/resources/scaladoc-searchbar.css @@ -41,9 +41,10 @@ } #scaladoc-searchbar { - position: absolute; + position: fixed; top: 50px; right: 40px; + z-index: 5; width: calc(100% - 360px); box-shadow: 0 2px 16px 0 rgba(0, 42, 76, 0.15); font-size: 13px; @@ -71,6 +72,7 @@ } .scaladoc-searchbar-result { + background: white; line-height: 32px; padding-left: 10px; padding-right: 10px; @@ -80,7 +82,7 @@ margin-top: 10px; } -.scaladoc-searchbar-result:hover { +.scaladoc-searchbar-result[selected] { background-color: #d4edff; } diff --git a/scaladoc-js/src/Globals.scala b/scaladoc-js/src/Globals.scala index 919515e3d1f9..c04235dd607e 100644 --- a/scaladoc-js/src/Globals.scala +++ b/scaladoc-js/src/Globals.scala @@ -7,4 +7,11 @@ import scala.scalajs.js.annotation.JSGlobalScope @JSGlobalScope object Globals extends js.Object { val pathToRoot: String = js.native +} + +object StringUtils { + def createCamelCaseTokens(s: String): List[String] = + if s.isEmpty then List.empty + else if s.tail.indexWhere(_.isUpper) == -1 then List(s) + else List(s.take(s.tail.indexWhere(_.isUpper) + 1)) ++ createCamelCaseTokens(s.drop(s.tail.indexWhere(_.isUpper) + 1)) } \ No newline at end of file diff --git a/scaladoc-js/src/Main.scala b/scaladoc-js/src/Main.scala index 25892c5acb7e..7b32aed9a1ea 100644 --- a/scaladoc-js/src/Main.scala +++ b/scaladoc-js/src/Main.scala @@ -2,4 +2,5 @@ package dotty.tools.scaladoc object Main extends App { Searchbar() + SocialLinks() } diff --git a/scaladoc-js/src/searchbar/PageEntry.scala b/scaladoc-js/src/searchbar/PageEntry.scala index 60812715d103..7e335a9b0e0b 100644 --- a/scaladoc-js/src/searchbar/PageEntry.scala +++ b/scaladoc-js/src/searchbar/PageEntry.scala @@ -15,18 +15,15 @@ case class PageEntry( description: String, location: String, shortName: String, - acronym: Option[String] + tokens: List[String] ) object PageEntry { - private def createAcronym(s: String): Option[String] = - s.headOption.map(firstLetter => firstLetter.toString ++ s.tail.filter(_.isUpper)) - def apply(jsObj: PageEntryJS): PageEntry = PageEntry( - jsObj.t, - jsObj.d, - jsObj.l, - jsObj.n.toLowerCase, - createAcronym(jsObj.n) - ) + jsObj.t, + jsObj.d, + jsObj.l, + jsObj.n.toLowerCase, + StringUtils.createCamelCaseTokens(jsObj.n) + ) } diff --git a/scaladoc-js/src/searchbar/SearchbarComponent.scala b/scaladoc-js/src/searchbar/SearchbarComponent.scala index 8d6d79c8ab49..20f7842ad749 100644 --- a/scaladoc-js/src/searchbar/SearchbarComponent.scala +++ b/scaladoc-js/src/searchbar/SearchbarComponent.scala @@ -22,6 +22,9 @@ class SearchbarComponent(val callback: (String) => List[PageEntry]): wrapper.appendChild(resultA) wrapper.appendChild(location) + wrapper.addEventListener("mouseover", { + case e: MouseEvent => handleHover(wrapper) + }) wrapper def handleNewQuery(query: String) = @@ -52,7 +55,10 @@ class SearchbarComponent(val callback: (String) => List[PageEntry]): if (document.body.contains(rootDiv)) { document.body.removeChild(rootDiv) } - else document.body.appendChild(rootDiv) + else { + document.body.appendChild(rootDiv) + input.focus() + } val element = createNestingDiv("search-content")( createNestingDiv("search-container")( @@ -69,6 +75,7 @@ class SearchbarComponent(val callback: (String) => List[PageEntry]): val element = document.createElement("input").asInstanceOf[html.Input] element.id = "scaladoc-searchbar-input" element.addEventListener("input", (e) => handleNewQuery(e.target.asInstanceOf[html.Input].value)) + element.autocomplete = "off" element private val resultsDiv: html.Div = @@ -94,9 +101,58 @@ class SearchbarComponent(val callback: (String) => List[PageEntry]): document.body.removeChild(element) } ) + element.addEventListener("keydown", { + case e: KeyboardEvent => + if e.keyCode == 40 then handleArrowDown() + else if e.keyCode == 38 then handleArrowUp() + else if e.keyCode == 13 then handleEnter() + }) element.id = "scaladoc-searchbar" element.appendChild(input) element.appendChild(resultsDiv) element + private def handleArrowUp() = { + val selectedElement = resultsDiv.querySelector("[selected]") + if selectedElement != null then { + selectedElement.removeAttribute("selected") + val sibling = selectedElement.previousElementSibling + if sibling != null then { + sibling.setAttribute("selected", "") + resultsDiv.scrollTop = sibling.asInstanceOf[html.Element].offsetTop - (2 * sibling.asInstanceOf[html.Element].clientHeight) + } + } + } + private def handleArrowDown() = { + val selectedElement = resultsDiv.querySelector("[selected]") + if selectedElement != null then { + val sibling = selectedElement.nextElementSibling + if sibling != null then { + selectedElement.removeAttribute("selected") + sibling.setAttribute("selected", "") + resultsDiv.scrollTop = sibling.asInstanceOf[html.Element].offsetTop - (2 * sibling.asInstanceOf[html.Element].clientHeight) + } + } else { + val firstResult = resultsDiv.firstElementChild + if firstResult != null then { + firstResult.setAttribute("selected", "") + resultsDiv.scrollTop = firstResult.asInstanceOf[html.Element].offsetTop - (2 * firstResult.asInstanceOf[html.Element].clientHeight) + } + } + } + private def handleEnter() = { + val selectedElement = resultsDiv.querySelector("[selected] a").asInstanceOf[html.Element] + if selectedElement != null then { + selectedElement.click() + } + } + + private def handleHover(elem: html.Element) = { + val selectedElement = resultsDiv.querySelector("[selected]") + if selectedElement != null then { + selectedElement.removeAttribute("selected") + } + elem.setAttribute("selected","") + } + handleNewQuery("") diff --git a/scaladoc-js/src/searchbar/engine/Matchers.scala b/scaladoc-js/src/searchbar/engine/Matchers.scala index a933a3f88c23..ceca8afd357e 100644 --- a/scaladoc-js/src/searchbar/engine/Matchers.scala +++ b/scaladoc-js/src/searchbar/engine/Matchers.scala @@ -1,23 +1,24 @@ package dotty.tools.scaladoc -enum Matchers extends Function1[PageEntry, Int]: - case ByName(query: String) - case ByKind(kind: String) +sealed trait Matchers extends Function1[PageEntry, Int] - def apply(p: PageEntry): Int = this match { - case ByName(query) => { - val nameOption = Option(p.shortName) - val acronym = p.acronym - //Edge case for empty query string - if query == "" then 1 - else { - val results = List( - nameOption.filter(_.contains(query.toLowerCase)).fold(-1)(_.size - query.size), - acronym.filter(_.contains(query)).fold(-1)(_.size - query.size + 1) - ) - if results.forall(_ == -1) then -1 else results.filter(_ != -1).min - } +case class ByName(query: String) extends Matchers: + val tokens = StringUtils.createCamelCaseTokens(query) + def apply(p: PageEntry): Int = { + val nameOption = Option(p.shortName.toLowerCase) + //Edge case for empty query string + if query == "" then 1 + else { + val results = List( + nameOption.filter(_.contains(query.toLowerCase)).fold(-1)(_.size - query.size), + if p.tokens.size >= tokens.size && p.tokens.zip(tokens).forall( (token, query) => token.startsWith(query)) + then p.tokens.size - tokens.size + 1 + else -1 + //acronym.filter(_.contains(query)).fold(-1)(_.size - query.size + 1) + ) + if results.forall(_ == -1) then -1 else results.filter(_ != -1).min } - case ByKind(kind) => p.fullName.split(" ").headOption.filter(_.equalsIgnoreCase(kind)).fold(-1)(_ => 1) } +case class ByKind(kind: String) extends Matchers: + def apply(p: PageEntry): Int = p.fullName.split(" ").headOption.filter(_.equalsIgnoreCase(kind)).fold(-1)(_ => 1) diff --git a/scaladoc-js/src/searchbar/engine/QueryParser.scala b/scaladoc-js/src/searchbar/engine/QueryParser.scala index bb6dcaa3b1c9..f5996484188c 100644 --- a/scaladoc-js/src/searchbar/engine/QueryParser.scala +++ b/scaladoc-js/src/searchbar/engine/QueryParser.scala @@ -21,8 +21,8 @@ class QueryParser: val escapedRegex = raw"`(.*)`".r def parse(query: String): List[Matchers] = query match { - case escapedRegex(rest) => List(Matchers.ByName(rest)) - case kindRegex(kind, rest) => List(Matchers.ByKind(kind)) ++ parse(rest) - case restRegex(name) => List(Matchers.ByName(name)) + case escapedRegex(rest) => List(ByName(rest)) + case kindRegex(kind, rest) => List(ByKind(kind)) ++ parse(rest) + case restRegex(name) => List(ByName(name)) case _ => List() } \ No newline at end of file diff --git a/scaladoc-js/src/social-links/SocialLinks.scala b/scaladoc-js/src/social-links/SocialLinks.scala new file mode 100644 index 000000000000..5fbe42eb99e7 --- /dev/null +++ b/scaladoc-js/src/social-links/SocialLinks.scala @@ -0,0 +1,12 @@ +package dotty.tools.scaladoc + +import org.scalajs.dom._ +import org.scalajs.dom.ext._ + +class SocialLinks: + def addIcon(elem: html.Element) = + val img = document.createElement("img").asInstanceOf[html.Image] + img.src = s"${Globals.pathToRoot}images/${elem.getAttribute("data-icon-path")}" + elem.appendChild(img) + + document.querySelectorAll(".social-icon").collect { case e: html.Element => e }.foreach(addIcon) diff --git a/scaladoc-js/test/dotty/dokka/MatchersTest.scala b/scaladoc-js/test/dotty/dokka/MatchersTest.scala new file mode 100644 index 000000000000..deaa188a6c7c --- /dev/null +++ b/scaladoc-js/test/dotty/dokka/MatchersTest.scala @@ -0,0 +1,79 @@ +package dotty.tools.scaladoc + +import org.junit.{Test, Assert} +import org.junit.Assert._ + +class MatchersTest: + private val kinds = Seq( + "class", + "trait", + "enum", + "object", + "def", + "val", + "var", + "package", + "given", + "type" + ) + private val names = Seq( + "NullPointerException", + "NPException", + "Seq", + "SeqOps", + "writeBytes", + "lessOrEqual", + "testFuzzySearch1", + "testF", + "testFS" + ) + private val pages = for { + kind <- kinds + name <- names + } yield PageEntry( + s"$kind $name", + "", + "", + s"$name", + StringUtils.createCamelCaseTokens(name) + ) + + private def result(matchers: List[Matchers]) = { + pages.map { p => + p -> matchers.map(_(p)) + }.filterNot { (page, results) => + results.exists(_ == -1) + }.map((page, results) => page) + } + + @Test + def testByKind = kinds.foreach { kind => + val res = result(List(ByKind(kind))) + val expected = pages.filter(p => p.fullName.startsWith(kind)).toSet + assertEquals( + s"Matchers test error: for kind: $kind should match $expected but matched $res", + expected, + res.toSet + ) + } + + private def byNameTestCase(query: String, expectedMatch: String*) = expectedMatch.foreach { expMatch => + assertTrue( + s"Matchers test error: for query: $query expected $expMatch", + result(List(ByName(query))).exists(p => p.shortName.contains(expMatch)) + ) + } + + @Test + def testByName = { + names.foreach(n => byNameTestCase(n, n)) + byNameTestCase("NPE", "NPException", "NullPointerException") + byNameTestCase("NullPE", "NullPointerException") + byNameTestCase("tFuzzS", "testFuzzySearch1") + byNameTestCase("SO", "SeqOps") + byNameTestCase("teFS", "testFS") + byNameTestCase("writeBy", "writeBytes") + byNameTestCase("seQ", "Seq") + byNameTestCase("lOrEqu", "lessOrEqual") + byNameTestCase("teF", "testFS", "testF") + } \ No newline at end of file diff --git a/scaladoc-js/test/dotty/dokka/QueryParserTest.scala b/scaladoc-js/test/dotty/dokka/QueryParserTest.scala new file mode 100644 index 000000000000..b89c7502714f --- /dev/null +++ b/scaladoc-js/test/dotty/dokka/QueryParserTest.scala @@ -0,0 +1,35 @@ +package dotty.tools.scaladoc + +import org.junit.{Test, Assert} +import org.junit.Assert._ + +class QueryParserTest: + val queryParser = QueryParser() + val kinds = Seq( + "class", + "trait", + "enum", + "object", + "def", + "val", + "var", + "package", + "given", + "type" + ) + private def testCase(query: String, result: List[Matchers]) = { + val parsed = queryParser.parse(query) + assertEquals( + s"Query parser test error: for query: $query expected $result but found $parsed", + parsed, + result + ) + } + + @Test + def queryParserTests() = { + kinds.foreach(k => testCase(s"$k ", List(ByKind(k), ByName("")))) + testCase("trait", List(ByName("trait"))) + testCase("trait A", List(ByKind("trait"), ByName("A"))) + testCase("`trait A`", List(ByName("trait A"))) + } \ No newline at end of file diff --git a/scaladoc-testcases/src/tests/annotations.scala b/scaladoc-testcases/src/tests/annotations.scala index 37797203cd03..99e2e19c332f 100644 --- a/scaladoc-testcases/src/tests/annotations.scala +++ b/scaladoc-testcases/src/tests/annotations.scala @@ -3,7 +3,7 @@ package annotations import scala.annotation.StaticAnnotation -import java.lang.{Enum => _} +import java.lang.Enum as _ import scala.reflect.Enum class SomeObject(val s: String) diff --git a/scaladoc-testcases/src/tests/classSignatureTestSource.scala b/scaladoc-testcases/src/tests/classSignatureTestSource.scala index 305d264c5e6b..27aef1d2f461 100644 --- a/scaladoc-testcases/src/tests/classSignatureTestSource.scala +++ b/scaladoc-testcases/src/tests/classSignatureTestSource.scala @@ -1,8 +1,8 @@ package tests.classSignatureTestSource -import scala.collection._ +import scala.collection.* import scala.deprecated -import scala.annotation._ +import scala.annotation.* import scala.math.{Pi, max} import example.level2.Documentation diff --git a/scaladoc-testcases/src/tests/complexNames.scala b/scaladoc-testcases/src/tests/complexNames.scala index 92c0abc319af..ea05056d0f61 100644 --- a/scaladoc-testcases/src/tests/complexNames.scala +++ b/scaladoc-testcases/src/tests/complexNames.scala @@ -7,11 +7,10 @@ abstract class A: def +:(other: Int): A def :+(other: Int): A - // scaladoc has problems with names in backticks - // def `multi word name`: Int - // def `*** name with arbitrary chars ^%`: Int - // def `mischievous(param:Int)`(otherParam: Int): String - // def withMischievousParams(`param: String, param2`: String): String + def `multi word name`: Int + def `*** name with arbitrary chars ^%`: Int + def `mischievous(param:Int)`(otherParam: Int): String + def withMischievousParams(`param: String, param23`: String): String def complexName_^*(param: String): A @@ -19,8 +18,10 @@ abstract class A: def `+++:`(other: Int): A //expected: def +++:(other: Int): A def `:+++`(other: Int): A //expected: def :+++(other: Int): A - def `abc_^^_&&`: A //expected: def abc_^^_&&: A + def `abc_^^_&&`: A def `abc_def`: A //expected: def abc_def: A def `abc_def_++`: A //expected: def abc_def_++: A - // def `++_abc`: A - // def `abc_++_--`: A + def `++_abc`: A + def `abc_++_--`: A + +class `class with backticks to check links` diff --git a/scaladoc-testcases/src/tests/externalLocations/javadoc.scala b/scaladoc-testcases/src/tests/externalLocations/javadoc.scala index e50313e9d039..edeac135eb86 100644 --- a/scaladoc-testcases/src/tests/externalLocations/javadoc.scala +++ b/scaladoc-testcases/src/tests/externalLocations/javadoc.scala @@ -1,6 +1,6 @@ package tests.externalJavadoc -import java.util._ +import java.util.* class Test { def a: Map.Entry[String, String] = ??? diff --git a/scaladoc-testcases/src/tests/externalLocations/scaladoc2.scala b/scaladoc-testcases/src/tests/externalLocations/scaladoc2.scala index 25f19b4f637e..3ed5d5f55751 100644 --- a/scaladoc-testcases/src/tests/externalLocations/scaladoc2.scala +++ b/scaladoc-testcases/src/tests/externalLocations/scaladoc2.scala @@ -1,6 +1,6 @@ package tests.externalScaladoc2 -import scala.util.matching._ +import scala.util.matching.* class Test { def a: String = ??? diff --git a/scaladoc-testcases/src/tests/externalLocations/scaladoc3.scala b/scaladoc-testcases/src/tests/externalLocations/scaladoc3.scala index 43e7d9e14adb..590c19ffaa6c 100644 --- a/scaladoc-testcases/src/tests/externalLocations/scaladoc3.scala +++ b/scaladoc-testcases/src/tests/externalLocations/scaladoc3.scala @@ -1,6 +1,6 @@ package tests.externalScaladoc3 -import scala.util.matching._ +import scala.util.matching.* class Test { def a: String = ??? diff --git a/scaladoc-testcases/src/tests/functionDRI.scala b/scaladoc-testcases/src/tests/functionDRI.scala index 2407498e8b86..32a00df1a2c3 100644 --- a/scaladoc-testcases/src/tests/functionDRI.scala +++ b/scaladoc-testcases/src/tests/functionDRI.scala @@ -31,3 +31,9 @@ class E: def b = 10 object F: def b = 11 + +object #:: { + def #:: = 10 +} + + diff --git a/scaladoc-testcases/src/tests/hkts.scala b/scaladoc-testcases/src/tests/hkts.scala new file mode 100644 index 000000000000..d8e29d993821 --- /dev/null +++ b/scaladoc-testcases/src/tests/hkts.scala @@ -0,0 +1,62 @@ +package tests +package hkts + + +class Case1Variant1[List[_]] +class Case1Variant2[List <: ([_] =>> Any)] + +type Case2Variant1 = [A, _] =>> List[A] +type Case2Variant2[A, _] = List[A] + +type Case3Variant1 = [_] =>> Int +type Case3Variant2[_] = Int + +class A1[X] +class A2[X] extends A1[X] +type Case4Variant1 >: ([X] =>> A2[X]) <: ([X] =>> A1[X]) +type Case4Variant2[X] >: A2[X] <: A1[X] + +type Case5Variant1 = [X] =>> [Y] =>> (X, Y) +type Case5Variant2[X, Y] = (X, Y) + +type Case6Variant1 = [A, B] =>> A => B +type Case6Variant2[A, B] = A => B + +class Case7Variant1[List[_] <: Number] +class Case7Variant2[List <: ([_] =>> Number)] + +class Case8Variant1[A, List[A] <: Number] +class Case8Variant2[A, List <: ([A] =>> Number)] + +type Case9Variant1 <: [X] =>> Option[X] +type Case9Variant2[+X] <: Option[X] + +class Case10Variant1[List[_ >: Number]] +class Case10Variant2[List <: ([_ >: Number] =>> Any)] + +class Case11Variant1[Map[_, _]] +class Case11Variant2[Map <: ([_, _] =>> Any)] + +class Case12Variant1[List[A >: Number]] +class Case12Variant2[List <: ([A >: Number] =>> Any)] + +class Case13[List[List[_]]] + +trait Case14[C[_]] +class SomeClass extends Case14[List] + + +def method1[E, T](value: List[_ >: E]): Int = 0 +def method2[F[+X] <: Option[X], A](fa: F[A]): A = fa.get + +import scala.collection.immutable.ArraySeq +trait SomeTraitWithHKTs[A[_], B[_], C[_], D[_], E[_]] +abstract class Foo[Z] +trait SomeTrait extends SomeTraitWithHKTs[Foo, scala.collection.immutable.ArraySeq, ArraySeq, List, [B] =>> List[B]] + +trait A[X] { + type SomeType[X] + def x: SomeType[X] +} + +trait B[D] extends A[D] diff --git a/scaladoc-testcases/src/tests/sealedClasses.scala b/scaladoc-testcases/src/tests/sealedClasses.scala new file mode 100644 index 000000000000..4a5b2b3c8154 --- /dev/null +++ b/scaladoc-testcases/src/tests/sealedClasses.scala @@ -0,0 +1,24 @@ +package tests +package sealedClasses + +sealed trait A + +sealed trait B1 extends A +case class B2(a: Int) extends A +case object B3 extends A +class B4 extends A +object B4 extends A +object B5 extends A +case class B6(a: Int) extends A +case object B6 extends A + +sealed trait C1 extends B1 +case class C2(a: Int) extends B1 +case object C3 extends B1 +class C4 extends B1 +object C4 extends B1 +object C5 extends B1 +case class C6(a: Int) extends B1 +case object C6 extends B1 +sealed trait C7 extends B1 + diff --git a/scaladoc-testcases/src/tests/shadowingDRI.scala b/scaladoc-testcases/src/tests/shadowingDRI.scala index 0cdc2b2ce719..4d96f02c110b 100644 --- a/scaladoc-testcases/src/tests/shadowingDRI.scala +++ b/scaladoc-testcases/src/tests/shadowingDRI.scala @@ -7,4 +7,4 @@ class S: class R: def findThisDeclaration = 1 - given R: A[B] with {} \ No newline at end of file + given R: A[B] with {} diff --git a/scaladoc-testcases/src/tests/typesSignatures.scala b/scaladoc-testcases/src/tests/typesSignatures.scala index 92c6f35394f6..a66c2a521ce8 100644 --- a/scaladoc-testcases/src/tests/typesSignatures.scala +++ b/scaladoc-testcases/src/tests/typesSignatures.scala @@ -46,6 +46,6 @@ class Operators // infix type op[A, B] = Int // type Binary2 = String op Int - import scala.compiletime.ops.boolean._ + import scala.compiletime.ops.boolean.* type Unary = ![true] } \ No newline at end of file diff --git a/scaladoc/README.md b/scaladoc/README.md index ad5a6c0247e5..c55a256e342d 100644 --- a/scaladoc/README.md +++ b/scaladoc/README.md @@ -167,3 +167,9 @@ Make sure all the tests pass (simply run `sbt test` to verify that). A documentation tool needs to access compiler information about the project - it needs to list all definitions, resolve them by name, and query their members. Tasty Reflect is the dedicated way in Scala 3 of accessing this information. + +## Credits + +- [Flatart](https://www.iconfinder.com/Flatart) - Gitter icon + + diff --git a/scaladoc/resources/dotty_res/images/class.svg b/scaladoc/resources/dotty_res/images/class.svg new file mode 100644 index 000000000000..128f74d1ce66 --- /dev/null +++ b/scaladoc/resources/dotty_res/images/class.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C + + + + + + + diff --git a/scaladoc/resources/dotty_res/images/class_comp.svg b/scaladoc/resources/dotty_res/images/class_comp.svg new file mode 100644 index 000000000000..b457207be13c --- /dev/null +++ b/scaladoc/resources/dotty_res/images/class_comp.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C + + + + + + + + diff --git a/scaladoc/resources/dotty_res/images/discord-icon-black.png b/scaladoc/resources/dotty_res/images/discord-icon-black.png new file mode 100644 index 000000000000..e756933de15e Binary files /dev/null and b/scaladoc/resources/dotty_res/images/discord-icon-black.png differ diff --git a/scaladoc/resources/dotty_res/images/discord-icon-white.png b/scaladoc/resources/dotty_res/images/discord-icon-white.png new file mode 100644 index 000000000000..d5346b794c9a Binary files /dev/null and b/scaladoc/resources/dotty_res/images/discord-icon-white.png differ diff --git a/scaladoc/resources/dotty_res/images/enum.svg b/scaladoc/resources/dotty_res/images/enum.svg new file mode 100644 index 000000000000..8d09d1bdc019 --- /dev/null +++ b/scaladoc/resources/dotty_res/images/enum.svg @@ -0,0 +1,249 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + e + + diff --git a/scaladoc/resources/dotty_res/images/enum_comp.svg b/scaladoc/resources/dotty_res/images/enum_comp.svg new file mode 100644 index 000000000000..d601c7692689 --- /dev/null +++ b/scaladoc/resources/dotty_res/images/enum_comp.svg @@ -0,0 +1,273 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + e + + + + + + diff --git a/scaladoc/resources/dotty_res/images/github-icon-black.png b/scaladoc/resources/dotty_res/images/github-icon-black.png new file mode 100644 index 000000000000..8b25551a9792 Binary files /dev/null and b/scaladoc/resources/dotty_res/images/github-icon-black.png differ diff --git a/scaladoc/resources/dotty_res/images/github-icon-white.png b/scaladoc/resources/dotty_res/images/github-icon-white.png new file mode 100644 index 000000000000..628da97c7089 Binary files /dev/null and b/scaladoc/resources/dotty_res/images/github-icon-white.png differ diff --git a/scaladoc/resources/dotty_res/images/gitter-icon-black.png b/scaladoc/resources/dotty_res/images/gitter-icon-black.png new file mode 100644 index 000000000000..7751e3490adf Binary files /dev/null and b/scaladoc/resources/dotty_res/images/gitter-icon-black.png differ diff --git a/scaladoc/resources/dotty_res/images/gitter-icon-white.png b/scaladoc/resources/dotty_res/images/gitter-icon-white.png new file mode 100644 index 000000000000..fe16cc659fd2 Binary files /dev/null and b/scaladoc/resources/dotty_res/images/gitter-icon-white.png differ diff --git a/scaladoc/resources/dotty_res/images/given.svg b/scaladoc/resources/dotty_res/images/given.svg new file mode 100644 index 000000000000..02e882665efc --- /dev/null +++ b/scaladoc/resources/dotty_res/images/given.svg @@ -0,0 +1,250 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + g + + diff --git a/scaladoc/resources/dotty_res/images/object.svg b/scaladoc/resources/dotty_res/images/object.svg new file mode 100644 index 000000000000..6665d73c57a0 --- /dev/null +++ b/scaladoc/resources/dotty_res/images/object.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + O + + + + + + + diff --git a/scaladoc/resources/dotty_res/images/object_comp.svg b/scaladoc/resources/dotty_res/images/object_comp.svg new file mode 100644 index 000000000000..0434243fbd53 --- /dev/null +++ b/scaladoc/resources/dotty_res/images/object_comp.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + O + + + + + + + + diff --git a/scaladoc/resources/dotty_res/images/trait.svg b/scaladoc/resources/dotty_res/images/trait.svg new file mode 100644 index 000000000000..207a89f37f1b --- /dev/null +++ b/scaladoc/resources/dotty_res/images/trait.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + + + + + + + diff --git a/scaladoc/resources/dotty_res/images/trait_comp.svg b/scaladoc/resources/dotty_res/images/trait_comp.svg new file mode 100644 index 000000000000..8c83dec1f109 --- /dev/null +++ b/scaladoc/resources/dotty_res/images/trait_comp.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + + + + + + + + diff --git a/scaladoc/resources/dotty_res/images/twitter-icon-black.png b/scaladoc/resources/dotty_res/images/twitter-icon-black.png new file mode 100644 index 000000000000..040ca1699567 Binary files /dev/null and b/scaladoc/resources/dotty_res/images/twitter-icon-black.png differ diff --git a/scaladoc/resources/dotty_res/images/twitter-icon-white.png b/scaladoc/resources/dotty_res/images/twitter-icon-white.png new file mode 100644 index 000000000000..66962e7d3c80 Binary files /dev/null and b/scaladoc/resources/dotty_res/images/twitter-icon-white.png differ diff --git a/scaladoc/resources/dotty_res/styles/scalastyle.css b/scaladoc/resources/dotty_res/styles/scalastyle.css index 353784b7a84b..4b5d8aad873b 100644 --- a/scaladoc/resources/dotty_res/styles/scalastyle.css +++ b/scaladoc/resources/dotty_res/styles/scalastyle.css @@ -181,14 +181,20 @@ th { #sideMenu2 div.expanded>div { display: block; } - /* always show top level entry*/ #sideMenu2>div{ display: block; } +#sideMenu2 span.micon { + height: 16px; + width: 16px; + margin-right: 8px; +} + /* 'a's in side menu represent text of entry with link */ #sideMenu2 a { + display: flex; align-items: center; flex: 1; overflow-x: hidden; @@ -200,19 +206,12 @@ th { margin-top: 1px; margin-bottom: 1px; width: 100%; - display: block; /* This trick adds selected bachground stratching to the lef side of screen */ margin-left: calc(0px - var(--side-width)); padding-left: var(--side-width); width: calc(2 * var(--side-width)); } -#sideMenu2 a::before { - margin-left: -12em; - width: 12em; - background: red; -} - #sideMenu2 a.selected { background: var(--leftbar-current-bg); font-weight: bold; @@ -224,7 +223,7 @@ th { } /* spans represent a expand button */ -#sideMenu2 span { +#sideMenu2 span.ar { align-items: center; cursor: pointer; position: absolute; @@ -233,7 +232,7 @@ th { padding: 4px; } -#sideMenu2 span::before { +#sideMenu2 span.ar::before { content: "\e903"; /* arrow down */ font-family: "dotty-icons" !important; font-size: 20px; @@ -244,11 +243,11 @@ th { align-items: center; justify-content: center; } -#sideMenu2 .expanded>span::before { +#sideMenu2 .expanded>span.ar::before { content: "\e905"; /* arrow up */ } -#sideMenu2 .div:hover>span::before { +#sideMenu2 .div:hover>span.ar::before { color: var(--leftbar-current-bg); } @@ -431,8 +430,9 @@ Same solution is already used in Dokka. /* Footer */ footer { display: flex; + bottom: 0px; align-items: center; - position: relative; + position: fixed; margin-top: 1rem; margin-left: var(--side-width); width: calc(100% - var(--side-width)); @@ -613,6 +613,87 @@ footer .pull-right { position: relative; } +.cover-header { + display: flex; + flex-direction: row; + padding-top: 1em; +} + +.micon { + box-sizing: content-box; + height: 5.7em; + width: 5.7em; + color:transparent; +} + +.micon.c { + content: url("../images/class.svg") +} + +.micon.c-wc { + content: url("../images/class_comp.svg") +} + +.micon.o { + content: url("../images/object.svg") +} + +.micon.o-wc { + content: url("../images/object_comp.svg") +} + +.micon.t { + content: url("../images/trait.svg") +} + +.micon.t-wc { + content: url("../images/trait_comp.svg") +} + +.micon.e { + content: url("../images/enum.svg") +} + +.micon.e-wc { + content: url("../images/enum_comp.svg") +} + +.micon.g { + content: url("../images/given.svg") +} + +#leftColumn .socials { + margin-left: 5%; + margin-right: 5%; +} + +footer { + color: grey; +} + +footer .socials { + margin-left: 10px; + margin-right: 10px; + display: flex; + align-items: center; +} + +.social-icon { + padding-right: 5px; + padding-left: 5px; +} + +.social-icon img { + height: 20px; + width: 20px; +} + +#generated-by { + margin-right: 20px; + display: flex; + align-items: center; +} + /* Large Screens */ @media(min-width: 1100px) { :root { diff --git a/scaladoc/scala3-docs/_layouts/blog-page.html b/scaladoc/scala3-docs/_layouts/blog-page.html deleted file mode 100644 index 62724cd9c443..000000000000 --- a/scaladoc/scala3-docs/_layouts/blog-page.html +++ /dev/null @@ -1,35 +0,0 @@ ---- -layout: main ---- -
-
-

{{ page.title }}

- - {% if page.subTitle %} -
- {{ page.subTitle }} -
- {% endif %} -
- - {{ content }} - - {% if page.author and page.authorImg %} -
-
- - - {{ page.author }} - -
- {% endif %} -
diff --git a/scaladoc/scala3-docs/_layouts/index.html b/scaladoc/scala3-docs/_layouts/index.html deleted file mode 100644 index 5be2d9794299..000000000000 --- a/scaladoc/scala3-docs/_layouts/index.html +++ /dev/null @@ -1,4 +0,0 @@ ---- -layout: main ---- -

{{ content }}

diff --git a/scaladoc/scala3-docs/_layouts/search.html b/scaladoc/scala3-docs/_layouts/search.html deleted file mode 100644 index 355a7e83eeb4..000000000000 --- a/scaladoc/scala3-docs/_layouts/search.html +++ /dev/null @@ -1,197 +0,0 @@ ---- -layout: main -title: Search ---- - -
- -

- - - -
-
-

Entity Results

-
    -
    -
    -

    Member Results

    -
      -
      -
      -
      - - diff --git a/scaladoc/scala3-docs/blog b/scaladoc/scala3-docs/blog deleted file mode 120000 index b4f84f8e60f7..000000000000 --- a/scaladoc/scala3-docs/blog +++ /dev/null @@ -1 +0,0 @@ -../../docs/blog/ \ No newline at end of file diff --git a/scaladoc/scala3-docs/css/bootstrap.min.css b/scaladoc/scala3-docs/css/bootstrap.min.css deleted file mode 100644 index d9bbfab3ab34..000000000000 --- a/scaladoc/scala3-docs/css/bootstrap.min.css +++ /dev/null @@ -1 +0,0 @@ -@import url("https://fonts.googleapis.com/css?family=Lato:400,700|Fira+Code:400,700&display=fallback");:root{--light:#fafafa;--toolbar:#414551;--toolbar-entry:#fafafa;--toolbar-active:#7c8296;--sidebar:#fafafa;--sidebar-category:#000;--sidebar-page:#414551;--sidebar-active:#ca445e;--pre-bg:#fafafa;--doc-bg:rgba(202,68,94,0.135);--primary:#414551;--secondary:#ca445e;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:"Lato",sans-serif;--font-family-monospace:"Fira Code","Andale Mono",monospace}*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:Lato,sans-serif;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{font-style:normal;line-height:inherit}address,dl,ol,ul{margin-bottom:1rem}dl,ol,ul{margin-top:0}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]),a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:Fira Code,Andale Mono,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{border-style:none}img,svg{vertical-align:middle}svg{overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-family:Lato,sans-serif;font-weight:400;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem}.display-1,.display-2{font-weight:300;line-height:1.2}.display-2{font-size:5.5rem}.display-3{font-size:4.5rem}.display-3,.display-4{font-weight:300;line-height:1.2}.display-4{font-size:3.5rem}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-inline,.list-unstyled{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer:before{content:"\2014\00A0"}.img-fluid,.img-thumbnail{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#ca445e;word-break:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:960px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:flex;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col-auto,.col-lg,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-auto,.col-md,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-md-auto,.col-sm,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{flex-basis:0;flex-grow:1;max-width:100%}.col-auto{flex:0 0 auto;width:auto;max-width:100%}.col-1{flex:0 0 8.333333%;max-width:8.333333%}.col-2{flex:0 0 16.666667%;max-width:16.666667%}.col-3{flex:0 0 25%;max-width:25%}.col-4{flex:0 0 33.333333%;max-width:33.333333%}.col-5{flex:0 0 41.666667%;max-width:41.666667%}.col-6{flex:0 0 50%;max-width:50%}.col-7{flex:0 0 58.333333%;max-width:58.333333%}.col-8{flex:0 0 66.666667%;max-width:66.666667%}.col-9{flex:0 0 75%;max-width:75%}.col-10{flex:0 0 83.333333%;max-width:83.333333%}.col-11{flex:0 0 91.666667%;max-width:91.666667%}.col-12{flex:0 0 100%;max-width:100%}.order-first{order:-1}.order-last{order:13}.order-0{order:0}.order-1{order:1}.order-2{order:2}.order-3{order:3}.order-4{order:4}.order-5{order:5}.order-6{order:6}.order-7{order:7}.order-8{order:8}.order-9{order:9}.order-10{order:10}.order-11{order:11}.order-12{order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{flex-basis:0;flex-grow:1;max-width:100%}.col-sm-auto{flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{flex:0 0 25%;max-width:25%}.col-sm-4{flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{flex:0 0 50%;max-width:50%}.col-sm-7{flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{flex:0 0 75%;max-width:75%}.col-sm-10{flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{flex:0 0 100%;max-width:100%}.order-sm-first{order:-1}.order-sm-last{order:13}.order-sm-0{order:0}.order-sm-1{order:1}.order-sm-2{order:2}.order-sm-3{order:3}.order-sm-4{order:4}.order-sm-5{order:5}.order-sm-6{order:6}.order-sm-7{order:7}.order-sm-8{order:8}.order-sm-9{order:9}.order-sm-10{order:10}.order-sm-11{order:11}.order-sm-12{order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{flex-basis:0;flex-grow:1;max-width:100%}.col-md-auto{flex:0 0 auto;width:auto;max-width:100%}.col-md-1{flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{flex:0 0 25%;max-width:25%}.col-md-4{flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{flex:0 0 50%;max-width:50%}.col-md-7{flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{flex:0 0 75%;max-width:75%}.col-md-10{flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{flex:0 0 100%;max-width:100%}.order-md-first{order:-1}.order-md-last{order:13}.order-md-0{order:0}.order-md-1{order:1}.order-md-2{order:2}.order-md-3{order:3}.order-md-4{order:4}.order-md-5{order:5}.order-md-6{order:6}.order-md-7{order:7}.order-md-8{order:8}.order-md-9{order:9}.order-md-10{order:10}.order-md-11{order:11}.order-md-12{order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{flex-basis:0;flex-grow:1;max-width:100%}.col-lg-auto{flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{flex:0 0 25%;max-width:25%}.col-lg-4{flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{flex:0 0 50%;max-width:50%}.col-lg-7{flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{flex:0 0 75%;max-width:75%}.col-lg-10{flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{flex:0 0 100%;max-width:100%}.order-lg-first{order:-1}.order-lg-last{order:13}.order-lg-0{order:0}.order-lg-1{order:1}.order-lg-2{order:2}.order-lg-3{order:3}.order-lg-4{order:4}.order-lg-5{order:5}.order-lg-6{order:6}.order-lg-7{order:7}.order-lg-8{order:8}.order-lg-9{order:9}.order-lg-10{order:10}.order-lg-11{order:11}.order-lg-12{order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{flex-basis:0;flex-grow:1;max-width:100%}.col-xl-auto{flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{flex:0 0 25%;max-width:25%}.col-xl-4{flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{flex:0 0 50%;max-width:50%}.col-xl-7{flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{flex:0 0 75%;max-width:75%}.col-xl-10{flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{flex:0 0 100%;max-width:100%}.order-xl-first{order:-1}.order-xl-last{order:13}.order-xl-0{order:0}.order-xl-1{order:1}.order-xl-2{order:2}.order-xl-3{order:3}.order-xl-4{order:4}.order-xl-5{order:5}.order-xl-6{order:6}.order-xl-7{order:7}.order-xl-8{order:8}.order-xl-9{order:9}.order-xl-10{order:10}.order-xl-11{order:11}.order-xl-12{order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.table{width:100%;margin-bottom:1rem;color:#212529}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table-sm td,.table-sm th{padding:.3rem}.table-bordered,.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{color:#212529;background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#cacbce}.table-primary tbody+tbody,.table-primary td,.table-primary th,.table-primary thead th{border-color:#9c9ea5}.table-hover .table-primary:hover,.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#bdbec2}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#f0cbd2}.table-secondary tbody+tbody,.table-secondary td,.table-secondary th,.table-secondary thead th{border-color:#e39eab}.table-hover .table-secondary:hover,.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#eab7c1}.table-active,.table-active>td,.table-active>th,.table-hover .table-active:hover,.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#343a40;border-color:#454d55}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#343a40}.table-dark td,.table-dark th,.table-dark thead th{border-color:#454d55}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:hsla(0,0%,100%,.05)}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:hsla(0,0%,100%,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:#212529;text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#414551;border-color:#414551}.btn-primary:hover{color:#fff;background-color:#30333c;border-color:#2a2d35}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem rgba(94,97,107,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#414551;border-color:#414551}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#2a2d35;border-color:#25272e}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(94,97,107,.5)}.btn-secondary{color:#fff;background-color:#ca445e;border-color:#ca445e}.btn-secondary:hover{color:#fff;background-color:#b5334c;border-color:#ab3048}.btn-secondary.focus,.btn-secondary:focus{box-shadow:0 0 0 .2rem rgba(210,96,118,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#ca445e;border-color:#ca445e}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#ab3048;border-color:#a12e44}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(210,96,118,.5)}.btn-outline-primary{color:#414551;border-color:#414551}.btn-outline-primary:hover{color:#fff;background-color:#414551;border-color:#414551}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(65,69,81,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#414551;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#414551;border-color:#414551}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(65,69,81,.5)}.btn-outline-secondary{color:#ca445e;border-color:#ca445e}.btn-outline-secondary:hover{color:#fff;background-color:#ca445e;border-color:#ca445e}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(202,68,94,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#ca445e;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#ca445e;border-color:#ca445e}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(202,68,94,.5)}.btn-link{font-weight:400;color:#007bff;text-decoration:none}.btn-link:hover{color:#0056b3;text-decoration:underline}.btn-link.focus,.btn-link:focus{text-decoration:underline;box-shadow:none}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.nav{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{flex:1 1 auto;text-align:center}.nav-justified .nav-item{flex-basis:0;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;padding:.5rem 1rem}.navbar,.navbar>.container,.navbar>.container-fluid{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:flex;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat 50%;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid{flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand,.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a,.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand,.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:hsla(0,0%,100%,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:hsla(0,0%,100%,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:hsla(0,0%,100%,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:hsla(0,0%,100%,.5);border-color:hsla(0,0%,100%,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:hsla(0,0%,100%,.5)}.navbar-dark .navbar-text a,.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.breadcrumb{display:flex;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item:before{display:inline-block;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover:before{text-decoration:underline;text-decoration:none}.breadcrumb-item.active{color:#6c757d}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.badge{transition:none}}a.badge:focus,a.badge:hover{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#414551}a.badge-primary:focus,a.badge-primary:hover{color:#fff;background-color:#2a2d35}a.badge-primary.focus,a.badge-primary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(65,69,81,.5)}.badge-secondary{color:#fff;background-color:#ca445e}a.badge-secondary:focus,a.badge-secondary:hover{color:#fff;background-color:#ab3048}a.badge-secondary.focus,a.badge-secondary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(202,68,94,.5)}@-webkit-keyframes spinner-border{to{transform:rotate(1turn)}}@keyframes spinner-border{to{transform:rotate(1turn)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid;border-right:.25em solid transparent;border-radius:50%;-webkit-animation:spinner-border .75s linear infinite;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@-webkit-keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1}}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;-webkit-animation:spinner-grow .75s linear infinite;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#414551!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#2a2d35!important}.bg-secondary{background-color:#ca445e!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#ab3048!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#414551!important}.border-secondary{border-color:#ca445e!important}.border-white{border-color:#fff!important}.rounded-sm{border-radius:.2rem!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important}.rounded-right,.rounded-top{border-top-right-radius:.25rem!important}.rounded-bottom,.rounded-right{border-bottom-right-radius:.25rem!important}.rounded-bottom,.rounded-left{border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important}.rounded-lg{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-0{border-radius:0!important}.clearfix:after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:flex!important}.d-inline-flex{display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:flex!important}.d-sm-inline-flex{display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:flex!important}.d-md-inline-flex{display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:flex!important}.d-lg-inline-flex{display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:flex!important}.d-xl-inline-flex{display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:flex!important}.d-print-inline-flex{display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive:before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9:before{padding-top:42.857143%}.embed-responsive-16by9:before{padding-top:56.25%}.embed-responsive-4by3:before{padding-top:75%}.embed-responsive-1by1:before{padding-top:100%}.flex-row{flex-direction:row!important}.flex-column{flex-direction:column!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-column-reverse{flex-direction:column-reverse!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.flex-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-fill{flex:1 1 auto!important}.flex-grow-0{flex-grow:0!important}.flex-grow-1{flex-grow:1!important}.flex-shrink-0{flex-shrink:0!important}.flex-shrink-1{flex-shrink:1!important}.justify-content-start{justify-content:flex-start!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}.justify-content-between{justify-content:space-between!important}.justify-content-around{justify-content:space-around!important}.align-items-start{align-items:flex-start!important}.align-items-end{align-items:flex-end!important}.align-items-center{align-items:center!important}.align-items-baseline{align-items:baseline!important}.align-items-stretch{align-items:stretch!important}.align-content-start{align-content:flex-start!important}.align-content-end{align-content:flex-end!important}.align-content-center{align-content:center!important}.align-content-between{align-content:space-between!important}.align-content-around{align-content:space-around!important}.align-content-stretch{align-content:stretch!important}.align-self-auto{align-self:auto!important}.align-self-start{align-self:flex-start!important}.align-self-end{align-self:flex-end!important}.align-self-center{align-self:center!important}.align-self-baseline{align-self:baseline!important}.align-self-stretch{align-self:stretch!important}@media (min-width:576px){.flex-sm-row{flex-direction:row!important}.flex-sm-column{flex-direction:column!important}.flex-sm-row-reverse{flex-direction:row-reverse!important}.flex-sm-column-reverse{flex-direction:column-reverse!important}.flex-sm-wrap{flex-wrap:wrap!important}.flex-sm-nowrap{flex-wrap:nowrap!important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-sm-fill{flex:1 1 auto!important}.flex-sm-grow-0{flex-grow:0!important}.flex-sm-grow-1{flex-grow:1!important}.flex-sm-shrink-0{flex-shrink:0!important}.flex-sm-shrink-1{flex-shrink:1!important}.justify-content-sm-start{justify-content:flex-start!important}.justify-content-sm-end{justify-content:flex-end!important}.justify-content-sm-center{justify-content:center!important}.justify-content-sm-between{justify-content:space-between!important}.justify-content-sm-around{justify-content:space-around!important}.align-items-sm-start{align-items:flex-start!important}.align-items-sm-end{align-items:flex-end!important}.align-items-sm-center{align-items:center!important}.align-items-sm-baseline{align-items:baseline!important}.align-items-sm-stretch{align-items:stretch!important}.align-content-sm-start{align-content:flex-start!important}.align-content-sm-end{align-content:flex-end!important}.align-content-sm-center{align-content:center!important}.align-content-sm-between{align-content:space-between!important}.align-content-sm-around{align-content:space-around!important}.align-content-sm-stretch{align-content:stretch!important}.align-self-sm-auto{align-self:auto!important}.align-self-sm-start{align-self:flex-start!important}.align-self-sm-end{align-self:flex-end!important}.align-self-sm-center{align-self:center!important}.align-self-sm-baseline{align-self:baseline!important}.align-self-sm-stretch{align-self:stretch!important}}@media (min-width:768px){.flex-md-row{flex-direction:row!important}.flex-md-column{flex-direction:column!important}.flex-md-row-reverse{flex-direction:row-reverse!important}.flex-md-column-reverse{flex-direction:column-reverse!important}.flex-md-wrap{flex-wrap:wrap!important}.flex-md-nowrap{flex-wrap:nowrap!important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-md-fill{flex:1 1 auto!important}.flex-md-grow-0{flex-grow:0!important}.flex-md-grow-1{flex-grow:1!important}.flex-md-shrink-0{flex-shrink:0!important}.flex-md-shrink-1{flex-shrink:1!important}.justify-content-md-start{justify-content:flex-start!important}.justify-content-md-end{justify-content:flex-end!important}.justify-content-md-center{justify-content:center!important}.justify-content-md-between{justify-content:space-between!important}.justify-content-md-around{justify-content:space-around!important}.align-items-md-start{align-items:flex-start!important}.align-items-md-end{align-items:flex-end!important}.align-items-md-center{align-items:center!important}.align-items-md-baseline{align-items:baseline!important}.align-items-md-stretch{align-items:stretch!important}.align-content-md-start{align-content:flex-start!important}.align-content-md-end{align-content:flex-end!important}.align-content-md-center{align-content:center!important}.align-content-md-between{align-content:space-between!important}.align-content-md-around{align-content:space-around!important}.align-content-md-stretch{align-content:stretch!important}.align-self-md-auto{align-self:auto!important}.align-self-md-start{align-self:flex-start!important}.align-self-md-end{align-self:flex-end!important}.align-self-md-center{align-self:center!important}.align-self-md-baseline{align-self:baseline!important}.align-self-md-stretch{align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{flex-direction:row!important}.flex-lg-column{flex-direction:column!important}.flex-lg-row-reverse{flex-direction:row-reverse!important}.flex-lg-column-reverse{flex-direction:column-reverse!important}.flex-lg-wrap{flex-wrap:wrap!important}.flex-lg-nowrap{flex-wrap:nowrap!important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-lg-fill{flex:1 1 auto!important}.flex-lg-grow-0{flex-grow:0!important}.flex-lg-grow-1{flex-grow:1!important}.flex-lg-shrink-0{flex-shrink:0!important}.flex-lg-shrink-1{flex-shrink:1!important}.justify-content-lg-start{justify-content:flex-start!important}.justify-content-lg-end{justify-content:flex-end!important}.justify-content-lg-center{justify-content:center!important}.justify-content-lg-between{justify-content:space-between!important}.justify-content-lg-around{justify-content:space-around!important}.align-items-lg-start{align-items:flex-start!important}.align-items-lg-end{align-items:flex-end!important}.align-items-lg-center{align-items:center!important}.align-items-lg-baseline{align-items:baseline!important}.align-items-lg-stretch{align-items:stretch!important}.align-content-lg-start{align-content:flex-start!important}.align-content-lg-end{align-content:flex-end!important}.align-content-lg-center{align-content:center!important}.align-content-lg-between{align-content:space-between!important}.align-content-lg-around{align-content:space-around!important}.align-content-lg-stretch{align-content:stretch!important}.align-self-lg-auto{align-self:auto!important}.align-self-lg-start{align-self:flex-start!important}.align-self-lg-end{align-self:flex-end!important}.align-self-lg-center{align-self:center!important}.align-self-lg-baseline{align-self:baseline!important}.align-self-lg-stretch{align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{flex-direction:row!important}.flex-xl-column{flex-direction:column!important}.flex-xl-row-reverse{flex-direction:row-reverse!important}.flex-xl-column-reverse{flex-direction:column-reverse!important}.flex-xl-wrap{flex-wrap:wrap!important}.flex-xl-nowrap{flex-wrap:nowrap!important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-xl-fill{flex:1 1 auto!important}.flex-xl-grow-0{flex-grow:0!important}.flex-xl-grow-1{flex-grow:1!important}.flex-xl-shrink-0{flex-shrink:0!important}.flex-xl-shrink-1{flex-shrink:1!important}.justify-content-xl-start{justify-content:flex-start!important}.justify-content-xl-end{justify-content:flex-end!important}.justify-content-xl-center{justify-content:center!important}.justify-content-xl-between{justify-content:space-between!important}.justify-content-xl-around{justify-content:space-around!important}.align-items-xl-start{align-items:flex-start!important}.align-items-xl-end{align-items:flex-end!important}.align-items-xl-center{align-items:center!important}.align-items-xl-baseline{align-items:baseline!important}.align-items-xl-stretch{align-items:stretch!important}.align-content-xl-start{align-content:flex-start!important}.align-content-xl-end{align-content:flex-end!important}.align-content-xl-center{align-content:center!important}.align-content-xl-between{align-content:space-between!important}.align-content-xl-around{align-content:space-around!important}.align-content-xl-stretch{align-content:stretch!important}.align-self-xl-auto{align-self:auto!important}.align-self-xl-start{align-self:flex-start!important}.align-self-xl-end{align-self:flex-end!important}.align-self-xl-center{align-self:center!important}.align-self-xl-baseline{align-self:baseline!important}.align-self-xl-stretch{align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{top:0}.fixed-bottom,.fixed-top{position:fixed;right:0;left:0;z-index:1030}.fixed-bottom{bottom:0}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.min-vw-100{min-width:100vw!important}.min-vh-100{min-height:100vh!important}.vw-100{width:100vw!important}.vh-100{height:100vh!important}.stretched-link:after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:transparent}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-n1{margin:-.25rem!important}.mt-n1,.my-n1{margin-top:-.25rem!important}.mr-n1,.mx-n1{margin-right:-.25rem!important}.mb-n1,.my-n1{margin-bottom:-.25rem!important}.ml-n1,.mx-n1{margin-left:-.25rem!important}.m-n2{margin:-.5rem!important}.mt-n2,.my-n2{margin-top:-.5rem!important}.mr-n2,.mx-n2{margin-right:-.5rem!important}.mb-n2,.my-n2{margin-bottom:-.5rem!important}.ml-n2,.mx-n2{margin-left:-.5rem!important}.m-n3{margin:-1rem!important}.mt-n3,.my-n3{margin-top:-1rem!important}.mr-n3,.mx-n3{margin-right:-1rem!important}.mb-n3,.my-n3{margin-bottom:-1rem!important}.ml-n3,.mx-n3{margin-left:-1rem!important}.m-n4{margin:-1.5rem!important}.mt-n4,.my-n4{margin-top:-1.5rem!important}.mr-n4,.mx-n4{margin-right:-1.5rem!important}.mb-n4,.my-n4{margin-bottom:-1.5rem!important}.ml-n4,.mx-n4{margin-left:-1.5rem!important}.m-n5{margin:-3rem!important}.mt-n5,.my-n5{margin-top:-3rem!important}.mr-n5,.mx-n5{margin-right:-3rem!important}.mb-n5,.my-n5{margin-bottom:-3rem!important}.ml-n5,.mx-n5{margin-left:-3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-n1{margin:-.25rem!important}.mt-sm-n1,.my-sm-n1{margin-top:-.25rem!important}.mr-sm-n1,.mx-sm-n1{margin-right:-.25rem!important}.mb-sm-n1,.my-sm-n1{margin-bottom:-.25rem!important}.ml-sm-n1,.mx-sm-n1{margin-left:-.25rem!important}.m-sm-n2{margin:-.5rem!important}.mt-sm-n2,.my-sm-n2{margin-top:-.5rem!important}.mr-sm-n2,.mx-sm-n2{margin-right:-.5rem!important}.mb-sm-n2,.my-sm-n2{margin-bottom:-.5rem!important}.ml-sm-n2,.mx-sm-n2{margin-left:-.5rem!important}.m-sm-n3{margin:-1rem!important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem!important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem!important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem!important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem!important}.m-sm-n4{margin:-1.5rem!important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem!important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem!important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem!important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem!important}.m-sm-n5{margin:-3rem!important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem!important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem!important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem!important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-n1{margin:-.25rem!important}.mt-md-n1,.my-md-n1{margin-top:-.25rem!important}.mr-md-n1,.mx-md-n1{margin-right:-.25rem!important}.mb-md-n1,.my-md-n1{margin-bottom:-.25rem!important}.ml-md-n1,.mx-md-n1{margin-left:-.25rem!important}.m-md-n2{margin:-.5rem!important}.mt-md-n2,.my-md-n2{margin-top:-.5rem!important}.mr-md-n2,.mx-md-n2{margin-right:-.5rem!important}.mb-md-n2,.my-md-n2{margin-bottom:-.5rem!important}.ml-md-n2,.mx-md-n2{margin-left:-.5rem!important}.m-md-n3{margin:-1rem!important}.mt-md-n3,.my-md-n3{margin-top:-1rem!important}.mr-md-n3,.mx-md-n3{margin-right:-1rem!important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem!important}.ml-md-n3,.mx-md-n3{margin-left:-1rem!important}.m-md-n4{margin:-1.5rem!important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem!important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem!important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem!important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem!important}.m-md-n5{margin:-3rem!important}.mt-md-n5,.my-md-n5{margin-top:-3rem!important}.mr-md-n5,.mx-md-n5{margin-right:-3rem!important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem!important}.ml-md-n5,.mx-md-n5{margin-left:-3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-n1{margin:-.25rem!important}.mt-lg-n1,.my-lg-n1{margin-top:-.25rem!important}.mr-lg-n1,.mx-lg-n1{margin-right:-.25rem!important}.mb-lg-n1,.my-lg-n1{margin-bottom:-.25rem!important}.ml-lg-n1,.mx-lg-n1{margin-left:-.25rem!important}.m-lg-n2{margin:-.5rem!important}.mt-lg-n2,.my-lg-n2{margin-top:-.5rem!important}.mr-lg-n2,.mx-lg-n2{margin-right:-.5rem!important}.mb-lg-n2,.my-lg-n2{margin-bottom:-.5rem!important}.ml-lg-n2,.mx-lg-n2{margin-left:-.5rem!important}.m-lg-n3{margin:-1rem!important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem!important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem!important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem!important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem!important}.m-lg-n4{margin:-1.5rem!important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem!important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem!important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem!important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem!important}.m-lg-n5{margin:-3rem!important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem!important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem!important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem!important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-n1{margin:-.25rem!important}.mt-xl-n1,.my-xl-n1{margin-top:-.25rem!important}.mr-xl-n1,.mx-xl-n1{margin-right:-.25rem!important}.mb-xl-n1,.my-xl-n1{margin-bottom:-.25rem!important}.ml-xl-n1,.mx-xl-n1{margin-left:-.25rem!important}.m-xl-n2{margin:-.5rem!important}.mt-xl-n2,.my-xl-n2{margin-top:-.5rem!important}.mr-xl-n2,.mx-xl-n2{margin-right:-.5rem!important}.mb-xl-n2,.my-xl-n2{margin-bottom:-.5rem!important}.ml-xl-n2,.mx-xl-n2{margin-left:-.5rem!important}.m-xl-n3{margin:-1rem!important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem!important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem!important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem!important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem!important}.m-xl-n4{margin:-1.5rem!important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem!important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem!important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem!important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem!important}.m-xl-n5{margin:-3rem!important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem!important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem!important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem!important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.text-monospace{font-family:Fira Code,Andale Mono,monospace!important}.text-justify{text-align:justify!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-lighter{font-weight:lighter!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-weight-bolder{font-weight:bolder!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#414551!important}a.text-primary:focus,a.text-primary:hover{color:#1f2127!important}.text-secondary{color:#ca445e!important}a.text-secondary:focus,a.text-secondary:hover{color:#972b40!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:hsla(0,0%,100%,.5)!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.text-decoration-none{text-decoration:none!important}.text-break{word-break:break-word!important;overflow-wrap:break-word!important}.text-reset{color:inherit!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}:root{--font-family-toolbar-main:"Lato",sans-serif;--font-weight-toolbar-main:400;--font-family-toolbar-details:"Lato",sans-serif;--font-weight-toolbar-details:400;--font-family-sidebar:"Lato",sans-serif;--font-size-sidebar-category:18px;--font-weight-sidebar-category:400;--font-size-sidebar-page:1rem;--font-weight-sidebar-page:400} \ No newline at end of file diff --git a/scaladoc/scala3-docs/css/frontpage.css b/scaladoc/scala3-docs/css/frontpage.css deleted file mode 100644 index 722d4ba09802..000000000000 --- a/scaladoc/scala3-docs/css/frontpage.css +++ /dev/null @@ -1,175 +0,0 @@ - @import url('https://fonts.googleapis.com/css?family=Lobster&display=swap'); - -body { - height: 100%; - width: 100%; - margin: 0; - padding: 0; - font-family: var(--font-family-sans-serif); - font-weight: 300; - scroll-behavior: smooth; -} - -h1, h2, h3 { - font-family: "Lobster", serif; - font-weight: 500; - text-align: center; - padding-top: 20px; -} - -h1 { - font-size: 64px; -} - -h1#main { - font-size: 15vh; -} - -/* navigation */ -header { - font-size: 24px; -} - -header .nav-item i { - font-size: 1.5em; -} - -.navbar-dark .navbar-nav .nav-link, .navbar-dark .navbar-toggler { - color: white; -} - -.navbar-dark .navbar-toggler { - border: none; - padding: 0; - font-size: 1.5em; -} - -.navbar #navbarContent { - /* above the logo when opened on small screens */ - background: #ca445e; - z-index: 100; - box-shadow: 0px 10px 40px #ca445e; -} - -.nav-item { - margin-left: .5em; -} - -/* layout */ -section.page { - min-height: 100vh; - width: 100%; - padding: 0; - padding-bottom: 2em; -} - -section.page strong { - font-weight: bold; - color: rgba(255,255,255,0.6); -} - -section .container { - max-width: 750px; -} - -section p { - margin-bottom: 0px; - padding-bottom: 15px; - line-height: 3vh; -} - -section p ~ pre { - margin-top: -8px; - margin-bottom: 25px; -} - -.centered-table table { - width: 100%; - margin-left: auto; - margin-right: auto; -} - -/* background colors */ -.bg-red { - background-color: #ca445e; -} -.bg-blue { - background-color: #002B36; -} -.bg-teal { - background-color: #224951; -} - -/* text colors */ -.bg-dark { - color: white; -} -.bg-dark a { - color: #f26527; -} -.bg-dark a:hover { - color: #da4323; -} - -/* code */ -pre, code { - background-color: #efefef; - border-radius: 4px; - padding: 3px 8px; - line-height: 1.75em; -} - -/* gitter chat */ -.gitter-chat-embed { - top: 0; - bottom: 0; -} - -aside { - margin: 0; - padding: 0; -} - -/* logo animation */ -@keyframes fadeInLogo { - from { - transform: translateY(0) scale(0.8); - opacity: 0; - } - - to { - transform: translateY(0) scale(1); - opacity: 1; - } -} - -.scala-logo-container { - height: calc(100vh - 80px); - margin: auto; - position: absolute; - top: 80px; - right: 0; - bottom: 0; - left: 0; - animation: 2s fadeInLogo; - animation-timing-function: cubic-bezier(0.6, 0.2, 0.1, 1) 0.1s; -} - -.scala-logo-container img { - height: 60%; - display: block; - width: 100%; -} - -.scala-logo-container .subtitle { - bottom: 0; - position: absolute; - width: 100%; - font-size: 1.5em; - line-height: 3vh; -} - -.scala-logo-container .subtitle h1 { - font-size: 100px; - font-size: 15vh; -} diff --git a/scaladoc/scala3-docs/css/search.css b/scaladoc/scala3-docs/css/search.css deleted file mode 100644 index cb1c868ab875..000000000000 --- a/scaladoc/scala3-docs/css/search.css +++ /dev/null @@ -1,36 +0,0 @@ -ul { - list-style: none; - padding: 0; -} - -ul li { - margin-bottom: 5px; - font-family: var(--font-family-sans-serif); -} - -h3 { - padding-top: .5rem; -} -h4 { - display: inline-block; - font-size: 1.25rem; -} - -.package-name a { - color: inherit; -} - -.entity-kinds { - display: inline; -} - -.member-result { - padding-left: 1em; - font-family: var(--font-family-monospace); -} - -@media(min-width: 768px) { - .tab-content > .tab-pane { - display: block; - } -} diff --git a/scaladoc/scala3-docs/css/sidebar.css b/scaladoc/scala3-docs/css/sidebar.css deleted file mode 100644 index 5f96c0889deb..000000000000 --- a/scaladoc/scala3-docs/css/sidebar.css +++ /dev/null @@ -1,149 +0,0 @@ -.sidebar { - position: fixed; - top: 50px; - left: 0; - z-index: 1000; - width: 275px; - height: 100%; - overflow-x: hidden; /* Safari and some others don't support overflow: x y */ - overflow-y: auto; - -webkit-overflow-scrolling: touch; /* nicer scrolling on touch screens */ - font-family: var(--font-family-sidebar); - background: var(--sidebar); - margin-left: -275px; /* invisible by default, shown by toggle */ - transition: margin .25s ease-out; -} - -.sidebar.toggled { - margin-left: 0; - box-shadow: -2px 0 8px var(--primary); -} - -.sidebar ul.toc { - padding-bottom: 60px; /* avoids unreachable elements at the end of toc */ - padding-left: 1em; - padding-top: 1em; - margin-bottom: 0; -} - -.sidebar ul { - list-style-type: none; - padding-left: 0; -} - -.sidebar li { - margin-top: .5em; -} - -.sidebar li.section ul { - padding-left: 1em; - display: none; -} -.sidebar li.section ul.toggled { - display: block; -} - -.sidebar li.section.index-entities ul { - padding-left: 0; -} - -.sidebar .index-entity.entity-package { - margin-left: 5px; - margin-top: .25em; -} - -.sidebar .toc > li:not(.index-entities) > ul { - border-left: 2px solid var(--sidebar-active); - padding-left: 1em; - margin-left: 5px; -} - -.sidebar li a { - font-size: var(--font-size-sidebar-page); - font-weight: var(--font-weight-sidebar-page); -} - -.sidebar > ul > li.leaf > a, .sidebar li.section > a { - font-size: var(--font-size-sidebar-category); - font-weight: var(--font-weight-sidebar-category); - text-transform: capitalize; - cursor: pointer; - color: var(--sidebar-category); -} - -.sidebar .entity-package > .entity-name { - text-transform: none; -} - -.sidebar a { - width: 100%; - color: var(--sidebar-page); - transition: color .2s ease-out; -} -.sidebar a:hover, .sidebar a.toggled { - color: var(--sidebar-active) !important; -} - -/* API Documentation */ -.package-toggle i.fas { - font-size: 15px; - margin-right: 1px; - color: var(--sidebar-active); -} - -.entity-kinds { - display: inline-flex; - /* so that it is aligned with the text AND allows to select the type - and its companion if any. */ -} - -.entity-kinds > a.letter-anchor { - float: left; - width: 1.5em; - height: 1.5em; - color: white; - text-align: center; - text-decoration: none; - margin-right: 5px; - border-radius: 1em; -} - -.entity-kinds a.object { - background: #2c6c8d; -} -.entity-kinds a.class { - background: #44ad7d; - padding-right: 1px; -} -.entity-kinds a.trait { - background: #19aacf; - padding-right: 1px; -} - -.with-companion .entity-kinds:not(:hover) a.object { - display:none; -} -.with-companion .entity-kinds:not(:hover) a.class { - background: linear-gradient(45deg, #2c6c8d 49%, #44ad7d 51%); -} -.with-companion .entity-kinds:not(:hover) a.trait { - background: linear-gradient(45deg, #2c6c8d 49%, #19aacf 51%); -} - -@media (min-width: 768px) { - .sidebar { /* visible by default, hidden by toggle */ - margin-left: 0; - box-shadow: -2px 0 8px var(--primary); - } - .sidebar.toggled { - margin-left: -275px; - box-shadow: none; - } - #content-wrapper { - margin-left: 275px !important; - transition: margin .25s ease-out; - } - .sidebar.toggled ~ #content-wrapper { - margin-left: 0 !important; - } -} diff --git a/scaladoc/scala3-docs/css/toolbar.css b/scaladoc/scala3-docs/css/toolbar.css deleted file mode 100644 index faf051e5dde8..000000000000 --- a/scaladoc/scala3-docs/css/toolbar.css +++ /dev/null @@ -1,98 +0,0 @@ -body { - margin-top: 50px; -} - -nav.navbar { - height: 50px; - line-height: 1; - font-size: 24px; - font-family: var(--font-family-toolbar-details); - background-color: var(--toolbar); - box-shadow: 0 0 6px; -} -nav.navbar-dark * { - color: var(--toolbar-entry); - transition: color .2s ease-out; -} - -nav.navbar-dark a:hover *, nav.navbar-dark a:focus * { - color: var(--toolbar-active); -} -nav.navbar a:hover { - text-decoration: none; -} -nav.navbar a { - cursor: pointer; -} - -.navbar-brand { - margin-right: auto; - margin-left: auto; - font-size: inherit; - display: flex; - align-items: center; -} - -.navbar-brand .project-logo { - display: none; - height: 40px; - margin-right: 7px; -} - -.navbar-brand .project-details * { - margin: 0; - line-height: inherit; -} -.navbar-brand .project-details h1 { - font-size: 1em; - font-family: var(--font-family-toolbar-main); - font-weight: var(--font-weight-toolbar-main); -} -.navbar-brand .project-details h2 { - font-size: 0.5em; - margin-top: 2px; - font-weight: var(--font-weight-toolbar-details); -} - -#search-api-input { - color: initial; - width: 10em; -} -#searchbar { - display: none; -} -#searchbar.shown { - display: initial; - margin-left: auto; - margin-right: auto; -} -#searchbar.shown + .navbar-brand { - display: none; -} - -#search-icon { - margin-left: .5em; -} - -@media (min-width: 420px) { - .navbar-brand .project-logo { - display: inline; - } -} - -@media (min-width: 768px) { - #search-icon, #searchbar.shown { - margin-left: 1em; - margin-right: initial; - } - #searchbar.shown + .navbar-brand { - display: flex; - } -} - -@media (min-width: 1200px) { - #searchbar.shown { - position: absolute; - margin-left: 4em; - } -} diff --git a/scaladoc/scala3-docs/docs b/scaladoc/scala3-docs/docs deleted file mode 120000 index 4fb178c6ece2..000000000000 --- a/scaladoc/scala3-docs/docs +++ /dev/null @@ -1 +0,0 @@ -../../docs/docs \ No newline at end of file diff --git a/scaladoc/scala3-docs/images b/scaladoc/scala3-docs/images deleted file mode 120000 index 4c0d78a4008b..000000000000 --- a/scaladoc/scala3-docs/images +++ /dev/null @@ -1 +0,0 @@ -../../docs/images \ No newline at end of file diff --git a/scaladoc/scala3-docs/index.html b/scaladoc/scala3-docs/index.html deleted file mode 100644 index a6e99cb73265..000000000000 --- a/scaladoc/scala3-docs/index.html +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: Scala 3 -layout: main -hasFrame: false -extraCSS: - - css/frontpage.css ---- - -
      -
      - -
      -
      -
      - logo -
      -

      Scala 3

      -

      A next-generation compiler for Scala

      -

      (scroll down for more info)

      -
      -
      -
      -
      -
      -
      - -

      Try Scala 3

      -

      There are multiple ways of getting started with Scala 3.

      -
        -
      1. You can try Scala 3 in your browser with Scastie.
      2. -
      3. If you already have sbt installed, you can create a Scala 3 project and sbt will take care of the rest.
      4. -
      5. You can install all necessary dependencies with coursier by running cs setup. You can also run cs install scala3-compiler or cs install scala3-repl to install command-line commands for the compiler and repl, correspondingly.
      6. -
      7. You can manually install Scala 3 on your computer.
      8. -
      - -

      Install Scala 3

      -

      If you are a Mac user, you can install Scala 3 with brew:

      -
      brew install lampepfl/brew/dotty
      - -

      - If you are a Linux or Windows user, as a prerequisite you need a JDK 8 or later properly installed on your system. The environment variable JAVA_HOME should point to your Java installation.
      - For Windows users, we recommend using the Windows subsystem for linux or some other bash shell like git bash.
      - Then download the latest release. Optionally add the path of the folder bin/ to the system environment variable PATH. -

      - -

      Now you can compile Scala source code:

      -
      scalac hello.scala
      - -

      To start the REPL, run: scala.

      - -

      Create a Scala 3 Project

      -

      The fastest way to create a new project in Scala 3 is using sbt (1.1.4+).

      - -

      Create a Scala 3 project:

      -
      sbt new lampepfl/dotty.g8
      - -

      Or a Scala 3 project that cross compiles with Scala 2:

      -
      sbt new lampepfl/dotty-cross.g8
      - -

      For documentation see the Scala 3 Example Project.

      - -

      Learn more about Scala 3

      -

      You can find much more information about Scala 3 in ...

      - -
      -
      diff --git a/scaladoc/scala3-docs/js/api-search.js b/scaladoc/scala3-docs/js/api-search.js deleted file mode 100644 index 4950d2067ffe..000000000000 --- a/scaladoc/scala3-docs/js/api-search.js +++ /dev/null @@ -1,93 +0,0 @@ -/** This Webworker performs search on the API structure - * - * It can be used as follows: - * - * ```javascript - * var apiSearch = new Worker(""); - * apiSearch.postMessage({ - * "type": "setup", - * "search": "", - * "docs": - * }); - * ``` - * - * It posts a few different messages to its parent: - * - * ```json - * { - * "type": "entityResult", - * "package": , - * "entity": - * } - * - * { - * "type": "memberResult", - * "package": , - * "parent": , - * "member": - * } - * ``` - */ -onmessage = function(e) { - var docs = e.data.docs; - var searchTerm = e.data.search; - - var regexForTerm = function(query) { - var escaped = query.replace(/([\.\*\+\?\|\(\)\[\]\\])/g, '\\$1'); - if (query.toLowerCase() != query) { - // Regexp that matches CamelCase subbits: "BiSe" is - // "[a-z]*Bi[a-z]*Se" and matches "BitSet", "ABitSet", ... - return new RegExp(escaped.replace(/([A-Z])/g,"[a-z]*$1")); - } - else { // if query is all lower case make a normal case insensitive search - return new RegExp(escaped, "i"); - } - }; - - var searchRegex = regexForTerm(searchTerm); - - var filterPackages = function(entity) { - switch(entity.kind) { - case "val": - case "def": - case "type": - case "package": - return false; - default: - return true; - } - }; - - // look at this higher order function, such syntax: - var messageParentIfMatches = function(parent) { - return function(entity) { - var fullName = entity.path.join('.'); - - if (searchRegex.test(fullName)) { - postMessage({ - "type": "entityResult", - "package": parent, - "entity": entity - }); - } - - var searchChild = function(member) { - if (searchRegex.test(member.name)) { - postMessage({ - "type": "memberResult", - "package": parent, - "parent": entity, - "member": member, - }); - } - }; - entity.members.forEach(searchChild); - }; - }; - - docs.forEach(function(pack) { - pack.members - .filter(filterPackages) - .forEach(messageParentIfMatches(pack)); - }); -} diff --git a/scaladoc/scala3-docs/js/jquery.min.js b/scaladoc/scala3-docs/js/jquery.min.js deleted file mode 100644 index a1c07fd803b5..000000000000 --- a/scaladoc/scala3-docs/js/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
      "],col:[2,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
      ",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0 { - $(".sidebar").toggleClass("toggled"); - }) - $("#search-icon").click(() => { - $("#searchbar").toggleClass("shown"); - $("#search-api-input").focus(); - }) - const searchInput = $("#search-api-input"); - searchInput.keydown(evt => { - if (evt.which == 13) { - const baseUrl = $("#baseurl-input").val(); - window.location = ( - baseUrl + "/api/search.html?" + - "searchTerm=" + searchInput.val() + - "&previousUrl=" + encodeURI(window.location) - ); - } - }) -}) diff --git a/scaladoc/scala3-docs/sidebar.yml b/scaladoc/scala3-docs/sidebar.yml deleted file mode 120000 index 8a524a9d97f1..000000000000 --- a/scaladoc/scala3-docs/sidebar.yml +++ /dev/null @@ -1 +0,0 @@ -../../docs/sidebar.yml \ No newline at end of file diff --git a/scaladoc/src/dotty/tools/scaladoc/DRI.scala b/scaladoc/src/dotty/tools/scaladoc/DRI.scala index 45eb4745b4bb..8d5317a39f45 100644 --- a/scaladoc/src/dotty/tools/scaladoc/DRI.scala +++ b/scaladoc/src/dotty/tools/scaladoc/DRI.scala @@ -1,6 +1,7 @@ package dotty.tools.scaladoc import java.nio.file.Path +import dotty.tools.scaladoc.util.Escape._ val staticFileSymbolUUID = "___staticFile___" @@ -17,7 +18,7 @@ final case class DRI( def isStaticFile = symbolUUID == staticFileSymbolUUID - def asFileLocation: String = location.replace(".","/") + def asFileLocation: String = escapeUrl(location).replace(".", "/") object DRI: def forPath(path: Path) = diff --git a/scaladoc/src/dotty/tools/scaladoc/Main.scala b/scaladoc/src/dotty/tools/scaladoc/Main.scala index 3f796d4b6840..c78af8bb52b7 100644 --- a/scaladoc/src/dotty/tools/scaladoc/Main.scala +++ b/scaladoc/src/dotty/tools/scaladoc/Main.scala @@ -13,17 +13,19 @@ import dotty.tools.dotc.config.CommonScalaSettings import dotty.tools.dotc.core.Contexts._ /** Main class for the doctool when used from cli. */ +class Main: + // This is an entry point for Mill or other tools in the future since it provides easy access to reporter + def run(args: Array[String]) = Scaladoc.run(args, (new ContextBase).initialCtx) + object Main: def main(args: Array[String]): Unit = - try - // We should create our own context here... - val reporter = Scaladoc.run(args, (new ContextBase).initialCtx) + try + // We should create our own context here... + val reporter = Main().run(args) + // Sometimes jvm is hanging, so we want to be sure that we force shout down the jvm + sys.exit(if reporter.hasErrors then 1 else 0) + catch + case a: Exception => + a.printStackTrace() // Sometimes jvm is hanging, so we want to be sure that we force shout down the jvm - sys.exit(if reporter.hasErrors then 1 else 0) - catch - case a: Exception => - a.printStackTrace() - // Sometimes jvm is hanging, so we want to be sure that we force shout down the jvm - sys.exit(1) - - + sys.exit(1) diff --git a/scaladoc/src/dotty/tools/scaladoc/ScalaModuleCreator.scala b/scaladoc/src/dotty/tools/scaladoc/ScalaModuleCreator.scala index fbf7d02a2c3d..eda96db893a3 100644 --- a/scaladoc/src/dotty/tools/scaladoc/ScalaModuleCreator.scala +++ b/scaladoc/src/dotty/tools/scaladoc/ScalaModuleCreator.scala @@ -1,6 +1,6 @@ package dotty.tools.scaladoc -import dotty.tools.scaladoc.tasty.DokkaTastyInspector +import dotty.tools.scaladoc.tasty.ScaladocTastyInspector import collection.JavaConverters._ import transformers._ @@ -8,7 +8,7 @@ case class Module(rootPackage: Member, members: Map[DRI, Member]) object ScalaModuleProvider: def mkModule()(using ctx: DocContext): Module = - val (result, rootDoc) = DokkaTastyInspector().result() + val (result, rootDoc) = ScaladocTastyInspector().result() val (rootPck, rest) = result.partition(_.name == "API") val packageMembers = (rest ++ rootPck.flatMap(_.members)) .filter(p => p.members.nonEmpty || p.docs.nonEmpty).sortBy(_.name) @@ -22,6 +22,7 @@ object ScalaModuleProvider: val transformers = List( ImplicitMembersExtensionTransformer(), - InheritanceInformationTransformer() + InheritanceInformationTransformer(), + SealedMarksGraphTransformer() ) transformers.foldLeft(original)((module, transformer) => transformer.apply(module)) diff --git a/scaladoc/src/dotty/tools/scaladoc/Scaladoc.scala b/scaladoc/src/dotty/tools/scaladoc/Scaladoc.scala index cec8d648f0db..8f483f777848 100644 --- a/scaladoc/src/dotty/tools/scaladoc/Scaladoc.scala +++ b/scaladoc/src/dotty/tools/scaladoc/Scaladoc.scala @@ -38,6 +38,7 @@ object Scaladoc: sourceLinks: List[String] = Nil, revision: Option[String] = None, externalMappings: List[ExternalDocLink] = Nil, + socialLinks: List[SocialLinks] = Nil, identifiersToSkip: List[String] = Nil, regexesToSkip: List[String] = Nil, rootDocPath: Option[String] = None diff --git a/scaladoc/src/dotty/tools/scaladoc/ScaladocArgs.scala b/scaladoc/src/dotty/tools/scaladoc/ScaladocArgs.scala index ac45d706b805..9472173e2f88 100644 --- a/scaladoc/src/dotty/tools/scaladoc/ScaladocArgs.scala +++ b/scaladoc/src/dotty/tools/scaladoc/ScaladocArgs.scala @@ -36,6 +36,11 @@ class ScaladocArgs extends SettingGroup with CommonScalaSettings: "Mapping between regexes matching classpath entries and external documentation. " + "'regex::[scaladoc|scaladoc|javadoc]::path' syntax is used") + val socialLinks: Setting[List[String]] = + MultiStringSetting("-social-links", "social-links", + "Links to social sites. '[github|twitter|gitter|discord]::link' syntax is used. " + + "'custom::link::white_icon_name::black_icon_name' is also allowed, in this case icons must be present in 'images/'' directory.") + val deprecatedSkipPackages: Setting[List[String]] = MultiStringSetting("-skip-packages", "packages", "Deprecated, please use `-skip-by-id` or `-skip-by-regex`") @@ -49,7 +54,7 @@ class ScaladocArgs extends SettingGroup with CommonScalaSettings: StringSetting("-doc-root-content", "path", "The file from which the root package documentation should be imported.", "") def scaladocSpecificSettings: Set[Setting[_]] = - Set(sourceLinks, syntax, revision, externalDocumentationMappings, skipById, skipByRegex, deprecatedSkipPackages, docRootContent) + Set(sourceLinks, syntax, revision, externalDocumentationMappings, socialLinks, skipById, skipByRegex, deprecatedSkipPackages, docRootContent) object ScaladocArgs: def extract(args: List[String], rootCtx: CompilerContext):(Scaladoc.Args, CompilerContext) = @@ -101,7 +106,7 @@ object ScaladocArgs: ) def defaultDest(): File = - report.error("Destenation is missing, please provide '-d' parameter pointing to directory here docs should be created") + report.error("Destination is not provided, please provide '-d' parameter pointing to directory where docs should be created") File("output") val parseSyntax = syntax.nonDefault.fold(CommentSyntax.default){ str => @@ -119,6 +124,14 @@ object ScaladocArgs: ) ) + val socialLinksParsed = + socialLinks.get.flatMap { s => + SocialLinks.parse(s).fold(left => { + report.warning(left) + None + },right => Some(right)) + } + unsupportedSettings.filter(s => s.get != s.default).foreach { s => report.warning(s"Setting ${s.name} is currently not supported.") } @@ -142,6 +155,7 @@ object ScaladocArgs: sourceLinks.get, revision.nonDefault, externalMappings, + socialLinksParsed, skipById.get ++ deprecatedSkipPackages.get, skipByRegex.get, docRootContent.nonDefault diff --git a/scaladoc/src/dotty/tools/scaladoc/SocialLinks.scala b/scaladoc/src/dotty/tools/scaladoc/SocialLinks.scala new file mode 100644 index 000000000000..4b2f43202e25 --- /dev/null +++ b/scaladoc/src/dotty/tools/scaladoc/SocialLinks.scala @@ -0,0 +1,30 @@ +package dotty.tools.scaladoc + +import java.nio.file.Path +import java.nio.file.Paths +import dotty.tools.dotc.core.Contexts.Context + +enum SocialLinks(val url: String, val whiteIconName: String, val blackIconName: String): + case Github(ghUrl: String) extends SocialLinks(ghUrl, "github-icon-white.png", "github-icon-black.png") + case Twitter(tUrl: String) extends SocialLinks(tUrl, "twitter-icon-white.png", "twitter-icon-black.png") + case Gitter(gUrl: String) extends SocialLinks(gUrl, "gitter-icon-white.png", "gitter-icon-black.png") + case Discord(dUrl: String) extends SocialLinks(dUrl, "discord-icon-white.png", "discord-icon-black.png") + case Custom(cUrl: String, cWhiteIconName: String, cBlackIconName: String) extends SocialLinks(cUrl, cWhiteIconName, cBlackIconName) + +object SocialLinks: + def parse(s: String): Either[String, SocialLinks] = + val errorPrefix = s"Social links arg $s is invalid: " + val splitted = s.split("::") + splitted.head match { + case "custom" if splitted.size == 4 => Right(Custom(splitted(1), splitted(2), splitted(3))) + case "custom" => Left(errorPrefix + "For 'custom' arg expected three arguments: url, white icon name and black icon name") + case "github" if splitted.size == 2 => Right(Github(splitted(1))) + case "github" => Left(errorPrefix + "For 'github' arg expected one argument: url") + case "twitter" if splitted.size == 2 => Right(Twitter(splitted(1))) + case "twitter" => Left(errorPrefix + "For 'twitter' arg expected one argument: url") + case "gitter" if splitted.size == 2 => Right(Gitter(splitted(1))) + case "gitter" => Left(errorPrefix + "For 'gitter' arg expected one argument: url") + case "discord" if splitted.size == 2 => Right(Discord(splitted(1))) + case "discord" => Left(errorPrefix + "For 'discord' arg expected one argument: url") + case _ => Left(errorPrefix) + } diff --git a/scaladoc/src/dotty/tools/scaladoc/api.scala b/scaladoc/src/dotty/tools/scaladoc/api.scala index 06e6fe2e7adc..76b6b777e9b1 100644 --- a/scaladoc/src/dotty/tools/scaladoc/api.scala +++ b/scaladoc/src/dotty/tools/scaladoc/api.scala @@ -126,8 +126,9 @@ extension (s: Signature) def join(a: Signature): Signature = s ++ a case class LinkToType(signature: Signature, dri: DRI, kind: Kind) -case class HierarchyGraph(edges: Seq[(LinkToType, LinkToType)]): - private def vertecies: Seq[LinkToType] = edges.flatten((a, b) => Seq(a, b)).distinct + +case class HierarchyGraph(edges: Seq[(LinkToType, LinkToType)], sealedNodes: Set[LinkToType] = Set.empty): + def vertecies: Seq[LinkToType] = edges.flatten((a, b) => Seq(a, b)).distinct def verteciesWithId: Map[LinkToType, Int] = vertecies.zipWithIndex.toMap def +(edge: (LinkToType, LinkToType)): HierarchyGraph = HierarchyGraph((edges :+ edge).distinct) def ++(edges: Seq[(LinkToType, LinkToType)]): HierarchyGraph = edges.foldLeft(this) { @@ -137,7 +138,6 @@ object HierarchyGraph: def empty = HierarchyGraph(Seq.empty) def withEdges(edges: Seq[(LinkToType, LinkToType)]) = HierarchyGraph.empty ++ edges - case class Member( name: String, dri: DRI, diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/DotDiagramBuilder.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/DotDiagramBuilder.scala index 4a680bc62ca2..e8845dabcfb2 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/DotDiagramBuilder.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/DotDiagramBuilder.scala @@ -5,7 +5,7 @@ import util.HTML._ object DotDiagramBuilder: def build(diagram: HierarchyGraph, renderer: SignatureRenderer)(using DocContext): String = - def getStyle(vertex: LinkToType) = vertex.kind match + def getStyle(kind: Kind) = kind match case _ : Kind.Class => "fill: #45AD7D;" case Kind.Object => "fill: #285577;" case _ : Kind.Trait => "fill: #1CAACF;" @@ -14,8 +14,9 @@ object DotDiagramBuilder: case other => report.error(s"unexpected value: $other") val vWithId = diagram.verteciesWithId + val sealedNodes = diagram.sealedNodes val vertecies = vWithId.map { (vertex, id) => - s"""node${id} [id=node${id}, label="${getHtmlLabel(vertex, renderer)}", style="${getStyle(vertex)}"];\n""" + s"""node${id} [id=node${id}, label="${getHtmlLabel(vertex, renderer, sealedNodes)}", style="${getStyle(vertex.kind)}"];\n""" }.mkString val edges = diagram.edges.map { (from, to) => @@ -29,8 +30,9 @@ object DotDiagramBuilder: |} |""".stripMargin - private def getHtmlLabel(vertex: LinkToType, renderer: SignatureRenderer): String = + private def getHtmlLabel(vertex: LinkToType, renderer: SignatureRenderer, sealedNodes: Set[LinkToType]): String = span(style := "color: #FFFFFF;")( + if sealedNodes.contains(vertex) then "sealed " else "", vertex.kind.name, " ", vertex.signature.map(renderer.renderElementWith(_)) diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala index 764d4f5766ba..34a792685b92 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala @@ -28,6 +28,8 @@ class HtmlRenderer(rootPackage: Member, val members: Map[DRI, Member])(using ctx private val args = summon[DocContext].args val staticSite = summon[DocContext].staticSiteContext + val effectiveMembers = members.filter( (dri, member) => member.origin == Origin.RegularlyDefined && member.inheritedFrom.isEmpty) + private def needsOwnPage(member: Member): Boolean = def properKind(kind: Kind): Boolean = kind match case Kind.Package => true @@ -144,11 +146,20 @@ class HtmlRenderer(rootPackage: Member, val members: Map[DRI, Member])(using ctx ) private def buildNavigation(pageLink: Link): AppliedTag = + def navigationIcon(member: Member) = member.kind match { + case m if m.isInstanceOf[Classlike] => Seq(span(cls := s"micon ${member.kind.name.head}")) + case _ => Nil + } + def renderNested(nav: Page): (Boolean, AppliedTag) = val isSelected = nav.link.dri == pageLink.dri def linkHtml(exapnded: Boolean = false) = val attrs = if (isSelected) Seq(cls := "selected expanded") else Nil - a(href := pathToPage(pageLink.dri, nav.link.dri), attrs)(nav.link.name) + val icon = nav.content match { + case m: Member => navigationIcon(m) + case _ => Nil + } + Seq(a(href := pathToPage(pageLink.dri, nav.link.dri), attrs)(icon, nav.link.name)) nav.children match case Nil => isSelected -> div(linkHtml()) @@ -158,11 +169,21 @@ class HtmlRenderer(rootPackage: Member, val members: Map[DRI, Member])(using ctx val attr = if expanded || isSelected then Seq(cls := "expanded") else Nil (isSelected || expanded) -> div(attr)( linkHtml(expanded), - span(), + span(cls := "ar"), nested.map(_._2) ) renderNested(navigablePage)._2 + private def hasSocialLinks = !args.socialLinks.isEmpty + + private def socialLinks(whiteIcon: Boolean = true) = + val icon = (link: SocialLinks) => if whiteIcon then link.whiteIconName else link.blackIconName + args.socialLinks.map { link => + a(href := link.url)( + span(cls := s"social-icon", Attr("data-icon-path") := icon(link)) + ) + } + private def mkFrame(link: Link, parents: Vector[Link], content: => AppliedTag): AppliedTag = val projectLogo = args.projectLogo.map { path => @@ -186,6 +207,9 @@ class HtmlRenderer(rootPackage: Member, val members: Map[DRI, Member])(using ctx ), span( args.projectVersion.map(v => div(cls:="projectVersion")(v)).toList + ), + div(cls := "socials")( + socialLinks() ) ), div(id := "paneSearch"), @@ -211,14 +235,20 @@ class HtmlRenderer(rootPackage: Member, val members: Map[DRI, Member])(using ctx raw(" Back to top") ) ), - raw("Generated by "), - a(href := "https://github.com/lampepfl/dotty/tree/master/scaladoc")( - img( - src := resolveRoot(link.dri, "images/scaladoc_logo.svg"), - alt := "scaladoc", - cls := "scaladoc_logo" + div(cls := "socials")( + if hasSocialLinks then Seq(raw("Social links ")) else Nil, + socialLinks(whiteIcon = false) + ), + div(id := "generated-by")( + raw("Generated by "), + a(href := "https://github.com/lampepfl/dotty/tree/master/scaladoc")( + img( + src := resolveRoot(link.dri, "images/scaladoc_logo.svg"), + alt := "scaladoc", + cls := "scaladoc_logo" + ) ) - ) ) ) ) + ) diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/Locations.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/Locations.scala index aae61ab30507..05ba195f8e02 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/Locations.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/Locations.scala @@ -17,7 +17,7 @@ import scala.util.matching._ val UnresolvedLocationLink = "#" trait Locations(using ctx: DocContext): - def members: Map[DRI, Member] + def effectiveMembers: Map[DRI, Member] var cache = new JHashMap[DRI, Seq[String]]() @@ -48,7 +48,7 @@ trait Locations(using ctx: DocContext): UnresolvedLocationLink def pathToPage(from: DRI, to: DRI): String = - if to.isStaticFile || members.contains(to) then + if to.isStaticFile || effectiveMembers.contains(to) then val anchor = if to.anchor.isEmpty then "" else "#" + to.anchor pathToRaw(rawLocation(from), rawLocation(to)) +".html" + anchor else @@ -63,6 +63,7 @@ trait Locations(using ctx: DocContext): def pathToRaw(from: Seq[String], to: Seq[String]): String = + import dotty.tools.scaladoc.util.Escape._ val fromDir = from.dropRight(1) val commonPaths = to.zip(fromDir).takeWhile{ case (a, b) => a == b }.size @@ -72,7 +73,7 @@ trait Locations(using ctx: DocContext): case Nil => to.lastOption.fold(Seq("index"))(".." :: _ :: Nil) case l => l - (contextPath ++ nodePath).mkString("/") + escapeUrl((contextPath ++ nodePath).mkString("/")) def resolveRoot(from: Seq[String], to: String): String = pathToRaw(from, to.split("/").toList) diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/MemberRenderer.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/MemberRenderer.scala index 0d09a109ddd6..8a41b4e93ca4 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/MemberRenderer.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/MemberRenderer.scala @@ -140,6 +140,14 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext span(cls := "signature")(signature.map(renderElement)), ) + def memberIcon(member: Member) = member.kind match { + case Kind.Package => Nil + case _ => + val withCompanion = member.companion.fold("")(_ => "-wc") + val iconSpan = span(cls := s"micon ${member.kind.name.head}$withCompanion")() + Seq(member.companion.flatMap(link(_)).fold(iconSpan)(link => a(href := link)(iconSpan))) + } + def annotations(member: Member) = val rawBuilder = InlineSignatureBuilder().annotationsBlock(member) val signatures = rawBuilder.asInstanceOf[InlineSignatureBuilder].names.reverse @@ -345,8 +353,14 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext case Kind.RootPackage =>Seq(h1(summon[DocContext].args.name)) case _ => Seq( - h1(m.name), - div(cls:= "header monospace")(annotations(m), memberSingnature(m)) + div(cls := "cover-header")( + memberIcon(m), + h1(m.name) + ), + div(cls := "signature monospace")( + annotations(m), + memberSingnature(m) + ) ) div( diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/Resources.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/Resources.scala index 233c452e8d18..06c8108d6875 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/Resources.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/Resources.scala @@ -129,6 +129,23 @@ trait Resources(using ctx: DocContext) extends Locations, Writer: dottyRes("fonts/dotty-icons.woff"), dottyRes("fonts/dotty-icons.ttf"), dottyRes("images/scaladoc_logo.svg"), + dottyRes("images/class.svg"), + dottyRes("images/class_comp.svg"), + dottyRes("images/object.svg"), + dottyRes("images/object_comp.svg"), + dottyRes("images/trait.svg"), + dottyRes("images/trait_comp.svg"), + dottyRes("images/enum.svg"), + dottyRes("images/enum_comp.svg"), + dottyRes("images/given.svg"), + dottyRes("images/github-icon-black.png"), + dottyRes("images/github-icon-white.png"), + dottyRes("images/discord-icon-black.png"), + dottyRes("images/discord-icon-white.png"), + dottyRes("images/twitter-icon-black.png"), + dottyRes("images/twitter-icon-white.png"), + dottyRes("images/gitter-icon-black.png"), + dottyRes("images/gitter-icon-white.png"), searchData(pages) ) diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/ClassLikeSupport.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/ClassLikeSupport.scala index e45c5b067095..41652c709f74 100644 --- a/scaladoc/src/dotty/tools/scaladoc/tasty/ClassLikeSupport.scala +++ b/scaladoc/src/dotty/tools/scaladoc/tasty/ClassLikeSupport.scala @@ -48,7 +48,6 @@ trait ClassLikeSupport: signatureOnly: Boolean = false, modifiers: Seq[Modifier] = classDef.symbol.getExtraModifiers(), ): Member = - def unpackTreeToClassDef(tree: Tree): ClassDef = tree match case tree: ClassDef => tree case TypeDef(_, tbt: TypeBoundsTree) => unpackTreeToClassDef(tbt.tpe.typeSymbol.tree) @@ -73,14 +72,15 @@ trait ClassLikeSupport: } val selfSiangture: DSignature = typeForClass(classDef).asSignature - val graph = HierarchyGraph.withEdges(getSupertypesGraph(classDef, - LinkToType(selfSiangture, classDef.symbol.dri, bareClasslikeKind(classDef.symbol)))) + val graph = HierarchyGraph.withEdges( + getSupertypesGraph(classDef, LinkToType(selfSiangture, classDef.symbol.dri, bareClasslikeKind(classDef.symbol))) + ) val baseMember = mkMember(classDef.symbol, kindForClasslike(classDef), selfSiangture)( - modifiers = modifiers, - graph = graph, - deprecated = classDef.symbol.isDeprecated() - ) + modifiers = modifiers, + graph = graph, + deprecated = classDef.symbol.isDeprecated() + ) if signatureOnly then baseMember else baseMember.copy( members = classDef.extractPatchedMembers, @@ -144,7 +144,7 @@ trait ClassLikeSupport: Some(parseMethod(c, dd.symbol)) case td: TypeDef if !td.symbol.flags.is(Flags.Synthetic) && (!td.symbol.flags.is(Flags.Case) || !td.symbol.flags.is(Flags.Enum)) => - Some(parseTypeDef(td)) + Some(parseTypeDef(c, td)) case vd: ValDef if !isSyntheticField(vd.symbol) && (!vd.symbol.flags.is(Flags.Case) || !vd.symbol.flags.is(Flags.Enum)) @@ -292,7 +292,7 @@ trait ClassLikeSupport: val enumTypes = companion.membersToDocument.collect { case td: TypeDef if !td.symbol.flags.is(Flags.Synthetic) && td.symbol.flags.is(Flags.Enum) && td.symbol.flags.is(Flags.Case) => td - }.toList.map(parseTypeDef) + }.toList.map(parseTypeDef(classDef, _)) val enumNested = companion.membersToDocument.collect { case c: ClassDef if c.symbol.flags.is(Flags.Case) && c.symbol.flags.is(Flags.Enum) => processTree(c)(parseClasslike(c)) @@ -378,22 +378,23 @@ trait ClassLikeSupport: if argument.symbol.flags.is(Flags.Covariant) then "+" else if argument.symbol.flags.is(Flags.Contravariant) then "-" else "" + val name = argument.symbol.normalizedName + val normalizedName = if name.matches("_\\$\\d*") then "_" else name TypeParameter( argument.symbol.getAnnotations(), variancePrefix, - name, + normalizedName, argument.symbol.dri, memberInfo.get(name).fold(argument.rhs.asSignature)(_.asSignature) ) - def parseTypeDef(typeDef: TypeDef): Member = + def parseTypeDef(c: ClassDef, typeDef: TypeDef): Member = def isTreeAbstract(typ: Tree): Boolean = typ match { case TypeBoundsTree(_, _) => true case LambdaTypeTree(params, body) => isTreeAbstract(body) case _ => false } - val (generics, tpeTree) = typeDef.rhs match case LambdaTypeTree(params, body) => (params.map(mkTypeArgument(_)), body) case tpe => (Nil, tpe) diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/NameNormalizer.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/NameNormalizer.scala index 8ddf9ed5fec6..24366288557c 100644 --- a/scaladoc/src/dotty/tools/scaladoc/tasty/NameNormalizer.scala +++ b/scaladoc/src/dotty/tools/scaladoc/tasty/NameNormalizer.scala @@ -1,6 +1,8 @@ package dotty.tools.scaladoc.tasty import dotty.tools.scaladoc._ +import dotty.tools.dotc.core.StdNames.nme.keywords +import dotty.tools.dotc.core.Names.termName trait NameNormalizer { self: TastyParser => import qctx.reflect._ @@ -8,6 +10,17 @@ trait NameNormalizer { self: TastyParser => val withoutGivenPrefix = if s.isGiven then s.name.stripPrefix("given_") else s.name val withoutObjectSuffix = if s.flags.is(Flags.Module) then withoutGivenPrefix.stripSuffix("$") else withoutGivenPrefix val constructorNormalizedName = if s.isClassConstructor then "this" else withoutObjectSuffix - constructorNormalizedName + val escaped = escapedName(constructorNormalizedName) + escaped } + + private val ignoredKeywords: Set[String] = Set("this") + + private def escapedName(name: String) = + val simpleIdentifierRegex = raw"(?:\w+_[^\[\(\s_]+)|\w+|[^\[\(\s\w_]+".r + name match + case n if ignoredKeywords(n) => n + case n if keywords(termName(n)) => s"`$n`" + case simpleIdentifierRegex() => name + case n => s"`$n`" } diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/SymOps.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/SymOps.scala index 3842aae82509..64121556c670 100644 --- a/scaladoc/src/dotty/tools/scaladoc/tasty/SymOps.scala +++ b/scaladoc/src/dotty/tools/scaladoc/tasty/SymOps.scala @@ -16,7 +16,7 @@ class SymOps[Q <: Quotes](val q: Q): def className: Option[String] = if (sym.isClassDef && !sym.flags.is(Flags.Package)) Some( Some(sym.maybeOwner).filter(s => s.exists).flatMap(_.className).fold("")(cn => cn + "$") + sym.name - ) + ).filterNot(_.contains("package$")) else if (sym.isPackageDef) None else sym.maybeOwner.className @@ -117,8 +117,8 @@ class SymOps[Q <: Quotes](val q: Q): val csym = sym.asInstanceOf[dotc.core.Symbols.Symbol] Option(csym.associatedFile).fold("")(_.path) } - // We want package object to point to package - val className = sym.className.filter(_ != "package$") + + val className = sym.className DRI( className.fold(sym.packageName)(cn => s"${sym.packageName}.${cn}"), diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/TastyParser.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/TastyParser.scala index adf710ca1dfb..eadf63c70def 100644 --- a/scaladoc/src/dotty/tools/scaladoc/tasty/TastyParser.scala +++ b/scaladoc/src/dotty/tools/scaladoc/tasty/TastyParser.scala @@ -21,7 +21,7 @@ import java.nio.file.Files * * Delegates most of the work to [[TastyParser]] [[dotty.tools.scaladoc.tasty.TastyParser]]. */ -case class DokkaTastyInspector()(using ctx: DocContext) extends DocTastyInspector: +case class ScaladocTastyInspector()(using ctx: DocContext) extends DocTastyInspector: private val topLevels = Seq.newBuilder[(String, Member)] private var rootDoc: Option[Comment] = None @@ -123,7 +123,7 @@ case class DokkaTastyInspector()(using ctx: DocContext) extends DocTastyInspecto val filePaths = ctx.args.tastyFiles.map(_.getAbsolutePath).toList val classpath = ctx.args.classpath.split(java.io.File.pathSeparator).toList - inspectFilesInContext(classpath, filePaths) + if filePaths.nonEmpty then inspectFilesInContext(classpath, filePaths) val all = topLevels.result() all.groupBy(_._1).map { case (pckName, members) => @@ -137,7 +137,7 @@ case class DokkaTastyInspector()(using ctx: DocContext) extends DocTastyInspecto /** Parses a single Tasty compilation unit. */ case class TastyParser( qctx: Quotes, - inspector: DokkaTastyInspector, + inspector: ScaladocTastyInspector, )( isSkipped: qctx.reflect.Symbol => Boolean )( diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala index 96fe4ac0c585..af5509768aaa 100644 --- a/scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala +++ b/scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala @@ -40,8 +40,8 @@ trait TypesSupport: extension (tpeTree: Tree) def asSignature: DocSignature = tpeTree match - case TypeBoundsTree(low, high) => typeBound(low.tpe, low = true) ++ typeBound(high.tpe, low = false) - case tpeTree: TypeTree => inner(tpeTree.tpe) + case TypeBoundsTree(low, high) => typeBoundsTreeOfHigherKindedType(low.tpe, high.tpe) + case tpeTree: TypeTree => inner(tpeTree.tpe) case term: Term => inner(term.tpe) given TypeSyntax: AnyRef with @@ -95,9 +95,10 @@ trait TypesSupport: case AnnotatedType(tpe, _) => inner(tpe) case tl @ TypeLambda(params, paramBounds, resType) => - // println(params) - // println(paramBounds) - texts("[") ++ commas(params.zip(paramBounds).map( (name, typ) => texts(s"${name}") ++ inner(typ) )) ++ texts("]") + texts("[") ++ commas(params.zip(paramBounds).map { (name, typ) => + val normalizedName = if name.matches("_\\$\\d*") then "_" else name + texts(normalizedName) ++ inner(typ) + }) ++ texts("]") ++ texts(" =>> ") ++ inner(resType) @@ -184,7 +185,10 @@ trait TypesSupport: Nil case args => texts("(") ++ commas(args.map(inner)) ++ texts(")") - else inner(tpe) ++ texts("[") ++ commas(typeList.map(inner)) ++ texts("]") + else inner(tpe) ++ texts("[") ++ commas(typeList.map { t => t match + case _: TypeBounds => texts("_") ++ inner(t) + case _ => inner(t) + }) ++ texts("]") case tp @ TypeRef(qual, typeName) => qual match { @@ -238,7 +242,7 @@ trait TypesSupport: // case _ => throw Exception("No match for type in conversion to Reference. This should not happen, please open an issue. " + tp) case TypeBounds(low, hi) => if(low == hi) texts(" = ") ++ inner(low) - else typeBound(low, low = true) ++ typeBound(hi, low = false) + else typeBoundsTreeOfHigherKindedType(low, hi) case NoPrefix() => Nil @@ -267,3 +271,16 @@ trait TypesSupport: case _ => Nil } + private def typeBoundsTreeOfHigherKindedType(low: TypeRepr, high: TypeRepr) = + def regularTypeBounds(low: TypeRepr, high: TypeRepr) = + typeBound(low, low = true) ++ typeBound(high, low = false) + high.match + case TypeLambda(params, paramBounds, resType) => + if resType.typeSymbol == defn.AnyClass then + texts("[") ++ commas(params.zip(paramBounds).map { (name, typ) => + val normalizedName = if name.matches("_\\$\\d*") then "_" else name + texts(normalizedName) ++ inner(typ) + }) ++ texts("]") + else + regularTypeBounds(low, high) + case _ => regularTypeBounds(low, high) diff --git a/scaladoc/src/dotty/tools/scaladoc/transformers/SealedMarksGraphTransformer.scala b/scaladoc/src/dotty/tools/scaladoc/transformers/SealedMarksGraphTransformer.scala new file mode 100644 index 000000000000..e40e8c795821 --- /dev/null +++ b/scaladoc/src/dotty/tools/scaladoc/transformers/SealedMarksGraphTransformer.scala @@ -0,0 +1,16 @@ +package dotty.tools.scaladoc +package transformers + + +class SealedMarksGraphTransformer(using context: DocContext) extends (Module => Module): + override def apply(original: Module): Module = + val sealedRelations = getSealedRelations(original.rootPackage) + original.updateMembers { m => + m.copy(graph = m.graph.copy(sealedNodes = m.graph.vertecies.filter { v => + sealedRelations.contains(v.dri) + }.toSet)) + } + + private def getSealedRelations(c: Member): Set[DRI] = + val selfMapping = if c.modifiers.contains(Modifier.Sealed) then Set(c.dri) else Set.empty + selfMapping ++ c.members.flatMap(getSealedRelations) diff --git a/scaladoc/src/dotty/tools/scaladoc/util/escape.scala b/scaladoc/src/dotty/tools/scaladoc/util/escape.scala new file mode 100644 index 000000000000..66035e76ca98 --- /dev/null +++ b/scaladoc/src/dotty/tools/scaladoc/util/escape.scala @@ -0,0 +1,4 @@ +package dotty.tools.scaladoc.util + +object Escape: + def escapeUrl(url: String) = url.replace("#","%23") \ No newline at end of file diff --git a/scaladoc/src/scala/tasty/inspector/DocTastyInspector.scala b/scaladoc/src/scala/tasty/inspector/DocTastyInspector.scala index 963c1dfc3550..d908c2646f59 100644 --- a/scaladoc/src/scala/tasty/inspector/DocTastyInspector.scala +++ b/scaladoc/src/scala/tasty/inspector/DocTastyInspector.scala @@ -6,4 +6,4 @@ abstract class DocTastyInspector extends OldTastyInspector: def inspectFilesInDocContext( classpath: List[String], filePaths: List[String])( - using Context): Unit = inspectFilesInContext(classpath, filePaths) \ No newline at end of file + using Context): Unit = inspectFilesInContext(classpath, filePaths) diff --git a/scaladoc/test/dotty/dokka/BaseHtmlTest.scala b/scaladoc/test/dotty/tools/scaladoc/BaseHtmlTest.scala similarity index 97% rename from scaladoc/test/dotty/dokka/BaseHtmlTest.scala rename to scaladoc/test/dotty/tools/scaladoc/BaseHtmlTest.scala index de3b25c0595b..2432fe984751 100644 --- a/scaladoc/test/dotty/dokka/BaseHtmlTest.scala +++ b/scaladoc/test/dotty/tools/scaladoc/BaseHtmlTest.scala @@ -31,7 +31,7 @@ class BaseHtmlTest: try val args = Scaladoc.Args( name = projectName, - tastyFiles = pcks.flatMap(tastyFiles), + tastyFiles = pcks.flatMap(tastyFiles(_)), output = dest.toFile, docsRoot = docsRoot, projectVersion = Some(projectVersion), diff --git a/scaladoc/test/dotty/dokka/ExternalLocationProviderIntegrationTest.scala b/scaladoc/test/dotty/tools/scaladoc/ExternalLocationProviderIntegrationTest.scala similarity index 100% rename from scaladoc/test/dotty/dokka/ExternalLocationProviderIntegrationTest.scala rename to scaladoc/test/dotty/tools/scaladoc/ExternalLocationProviderIntegrationTest.scala diff --git a/scaladoc/test/dotty/dokka/RaportingTest.scala b/scaladoc/test/dotty/tools/scaladoc/RaportingTest.scala similarity index 90% rename from scaladoc/test/dotty/dokka/RaportingTest.scala rename to scaladoc/test/dotty/tools/scaladoc/RaportingTest.scala index e84417b3850a..a73f026f7774 100644 --- a/scaladoc/test/dotty/dokka/RaportingTest.scala +++ b/scaladoc/test/dotty/tools/scaladoc/RaportingTest.scala @@ -33,11 +33,6 @@ class ReportingTest: assertNoInfos(diag) } - @Test - def noClassesErors = checkReportedDiagnostics(_.copy(tastyFiles = Nil)){ diag => - assertMessagesAbout(diag.errorMsgs)("classes should no be empty") - } - @Test def errorsInCaseOfIncompletClasspath = val notTasty = Files.createTempFile("broken", ".notTasty") @@ -57,4 +52,4 @@ class ReportingTest: assertNoErrors(diag) assertMessagesAbout(diag.infoMsgs)("generation completed successfully") - } \ No newline at end of file + } diff --git a/scaladoc/test/dotty/dokka/ScaladocTest.scala b/scaladoc/test/dotty/tools/scaladoc/ScaladocTest.scala similarity index 94% rename from scaladoc/test/dotty/dokka/ScaladocTest.scala rename to scaladoc/test/dotty/tools/scaladoc/ScaladocTest.scala index 17db7310ec62..8d7574adf13d 100644 --- a/scaladoc/test/dotty/dokka/ScaladocTest.scala +++ b/scaladoc/test/dotty/tools/scaladoc/ScaladocTest.scala @@ -13,7 +13,7 @@ abstract class ScaladocTest(val name: String): def withModule(op: DocContext ?=> Module => Unit) = - given DocContext = testDocContext + given DocContext = testDocContext(tastyFiles(name)) op(ScalaModuleProvider.mkModule()) private def getTempDir() : TemporaryFolder = diff --git a/scaladoc/test/dotty/dokka/SignatureTest.scala b/scaladoc/test/dotty/tools/scaladoc/SignatureTest.scala similarity index 100% rename from scaladoc/test/dotty/dokka/SignatureTest.scala rename to scaladoc/test/dotty/tools/scaladoc/SignatureTest.scala diff --git a/scaladoc/test/dotty/dokka/SignatureTestCases.scala b/scaladoc/test/dotty/tools/scaladoc/SignatureTestCases.scala similarity index 99% rename from scaladoc/test/dotty/dokka/SignatureTestCases.scala rename to scaladoc/test/dotty/tools/scaladoc/SignatureTestCases.scala index 0644f89f6fa1..4a85b191dc92 100644 --- a/scaladoc/test/dotty/dokka/SignatureTestCases.scala +++ b/scaladoc/test/dotty/tools/scaladoc/SignatureTestCases.scala @@ -58,7 +58,7 @@ class InheritanceLoop extends SignatureTest("inheritanceLoop", SignatureTest.all class InheritedMembers extends SignatureTest("inheritedMembers2", SignatureTest.all.filter(_ != "class"), sourceFiles = List("inheritedMembers1", "inheritedMembers2")) -class ComplexNames extends SignatureTest("complexNames", Seq("def")) +class ComplexNames extends SignatureTest("complexNames", Seq("def", "class")) class WrongDocumentationLinks extends SignatureTest("links", Seq("def")) diff --git a/scaladoc/test/dotty/dokka/SourceLinksTests.scala b/scaladoc/test/dotty/tools/scaladoc/SourceLinksTests.scala similarity index 100% rename from scaladoc/test/dotty/dokka/SourceLinksTests.scala rename to scaladoc/test/dotty/tools/scaladoc/SourceLinksTests.scala diff --git a/scaladoc/test/dotty/dokka/diagram/HierarchyTest.scala b/scaladoc/test/dotty/tools/scaladoc/diagram/HierarchyTest.scala similarity index 99% rename from scaladoc/test/dotty/dokka/diagram/HierarchyTest.scala rename to scaladoc/test/dotty/tools/scaladoc/diagram/HierarchyTest.scala index 5a02b9515994..bd37d814300c 100644 --- a/scaladoc/test/dotty/dokka/diagram/HierarchyTest.scala +++ b/scaladoc/test/dotty/tools/scaladoc/diagram/HierarchyTest.scala @@ -95,7 +95,3 @@ class HierarchyTest extends ScaladocTest("hierarchy"): x.graph.edges.map((a, b) => (a.signature.getName, b.signature.getName)).toSet ) case _ => - - - - diff --git a/scaladoc/test/dotty/tools/scaladoc/diagram/SealedHierarchyTest.scala b/scaladoc/test/dotty/tools/scaladoc/diagram/SealedHierarchyTest.scala new file mode 100644 index 000000000000..288f8b665c2b --- /dev/null +++ b/scaladoc/test/dotty/tools/scaladoc/diagram/SealedHierarchyTest.scala @@ -0,0 +1,30 @@ +package dotty.tools.scaladoc +package diagram + +import dotty.tools.scaladoc.ScaladocTest +import scala.jdk.CollectionConverters.{ListHasAsScala, SeqHasAsJava} +import org.junit.Assert.{assertSame, assertTrue, assertEquals} + +class SealedHierarchyTest extends ScaladocTest("sealedClasses"): + override def runTest = withModule(_.visitMembers(checkMember)) + + def checkMember(x: Member) = x.name match + case "A" => + assertEquals(4, x.graph.sealedNodes.size) + assertEquals( + Set("A", "B1", "C1", "C7"), + x.graph.sealedNodes.map(_.signature.getName) + ) + case "B1" => + assertEquals(4, x.graph.sealedNodes.size) + assertEquals( + Set("A", "B1", "C1", "C7"), + x.graph.sealedNodes.map(_.signature.getName) + ) + case "C1" => + assertEquals(3, x.graph.sealedNodes.size) + assertEquals( + Set("A", "B1", "C1"), + x.graph.sealedNodes.map(_.signature.getName) + ) + case _ => diff --git a/scaladoc/test/dotty/dokka/linking/DriTest.scala b/scaladoc/test/dotty/tools/scaladoc/linking/DriTest.scala similarity index 100% rename from scaladoc/test/dotty/dokka/linking/DriTest.scala rename to scaladoc/test/dotty/tools/scaladoc/linking/DriTest.scala diff --git a/scaladoc/test/dotty/dokka/linking/DriTestCases.scala b/scaladoc/test/dotty/tools/scaladoc/linking/DriTestCases.scala similarity index 100% rename from scaladoc/test/dotty/dokka/linking/DriTestCases.scala rename to scaladoc/test/dotty/tools/scaladoc/linking/DriTestCases.scala diff --git a/scaladoc/test/dotty/dokka/renderers/HtmlTagsTest.scala b/scaladoc/test/dotty/tools/scaladoc/renderers/HtmlTagsTest.scala similarity index 100% rename from scaladoc/test/dotty/dokka/renderers/HtmlTagsTest.scala rename to scaladoc/test/dotty/tools/scaladoc/renderers/HtmlTagsTest.scala diff --git a/scaladoc/test/dotty/dokka/renderers/LocationTests.scala b/scaladoc/test/dotty/tools/scaladoc/renderers/LocationTests.scala similarity index 93% rename from scaladoc/test/dotty/dokka/renderers/LocationTests.scala rename to scaladoc/test/dotty/tools/scaladoc/renderers/LocationTests.scala index ea1f0d925cec..ffcf1a69106e 100644 --- a/scaladoc/test/dotty/dokka/renderers/LocationTests.scala +++ b/scaladoc/test/dotty/tools/scaladoc/renderers/LocationTests.scala @@ -6,9 +6,9 @@ import org.junit.Assert.{assertSame, assertTrue, assertEquals} import dotty.tools.scaladoc.util.HTML._ class LocationTests: - given DocContext = testDocContext + given DocContext = testDocContext() object locations extends Locations: - val members = Map.empty + val effectiveMembers = Map.empty @Test def testPathToRoot() = @@ -36,4 +36,4 @@ class LocationTests: assertEquals( "../../annotation", path("api/scala/annotation/meta/beanGetter", "api/scala/annotation"), - ) \ No newline at end of file + ) diff --git a/scaladoc/test/dotty/dokka/site/NavigationTest.scala b/scaladoc/test/dotty/tools/scaladoc/site/NavigationTest.scala similarity index 100% rename from scaladoc/test/dotty/dokka/site/NavigationTest.scala rename to scaladoc/test/dotty/tools/scaladoc/site/NavigationTest.scala diff --git a/scaladoc/test/dotty/dokka/site/SiteGeneratationTest.scala b/scaladoc/test/dotty/tools/scaladoc/site/SiteGeneratationTest.scala similarity index 100% rename from scaladoc/test/dotty/dokka/site/SiteGeneratationTest.scala rename to scaladoc/test/dotty/tools/scaladoc/site/SiteGeneratationTest.scala diff --git a/scaladoc/test/dotty/dokka/site/StaticSiteContextTest.scala b/scaladoc/test/dotty/tools/scaladoc/site/StaticSiteContextTest.scala similarity index 100% rename from scaladoc/test/dotty/dokka/site/StaticSiteContextTest.scala rename to scaladoc/test/dotty/tools/scaladoc/site/StaticSiteContextTest.scala diff --git a/scaladoc/test/dotty/dokka/site/TemplateFileTests.scala b/scaladoc/test/dotty/tools/scaladoc/site/TemplateFileTests.scala similarity index 100% rename from scaladoc/test/dotty/dokka/site/TemplateFileTests.scala rename to scaladoc/test/dotty/tools/scaladoc/site/TemplateFileTests.scala diff --git a/scaladoc/test/dotty/dokka/tasty/comments/CommentExpanderTests.scala b/scaladoc/test/dotty/tools/scaladoc/tasty/comments/CommentExpanderTests.scala similarity index 100% rename from scaladoc/test/dotty/dokka/tasty/comments/CommentExpanderTests.scala rename to scaladoc/test/dotty/tools/scaladoc/tasty/comments/CommentExpanderTests.scala diff --git a/scaladoc/test/dotty/dokka/tasty/comments/DocFlexmarkParserTests.scala b/scaladoc/test/dotty/tools/scaladoc/tasty/comments/DocFlexmarkParserTests.scala similarity index 100% rename from scaladoc/test/dotty/dokka/tasty/comments/DocFlexmarkParserTests.scala rename to scaladoc/test/dotty/tools/scaladoc/tasty/comments/DocFlexmarkParserTests.scala diff --git a/scaladoc/test/dotty/dokka/tasty/comments/IntegrationTest.scala b/scaladoc/test/dotty/tools/scaladoc/tasty/comments/IntegrationTest.scala similarity index 100% rename from scaladoc/test/dotty/dokka/tasty/comments/IntegrationTest.scala rename to scaladoc/test/dotty/tools/scaladoc/tasty/comments/IntegrationTest.scala diff --git a/scaladoc/test/dotty/dokka/tasty/comments/MemberLookupTests.scala b/scaladoc/test/dotty/tools/scaladoc/tasty/comments/MemberLookupTests.scala similarity index 100% rename from scaladoc/test/dotty/dokka/tasty/comments/MemberLookupTests.scala rename to scaladoc/test/dotty/tools/scaladoc/tasty/comments/MemberLookupTests.scala diff --git a/scaladoc/test/dotty/dokka/tasty/comments/QueryParserTests.scala b/scaladoc/test/dotty/tools/scaladoc/tasty/comments/QueryParserTests.scala similarity index 100% rename from scaladoc/test/dotty/dokka/tasty/comments/QueryParserTests.scala rename to scaladoc/test/dotty/tools/scaladoc/tasty/comments/QueryParserTests.scala diff --git a/scaladoc/test/dotty/dokka/tasty/util/TestUtils.scala b/scaladoc/test/dotty/tools/scaladoc/tasty/util/TestUtils.scala similarity index 50% rename from scaladoc/test/dotty/dokka/tasty/util/TestUtils.scala rename to scaladoc/test/dotty/tools/scaladoc/tasty/util/TestUtils.scala index 4ffc06516312..356268c44b3a 100644 --- a/scaladoc/test/dotty/dokka/tasty/util/TestUtils.scala +++ b/scaladoc/test/dotty/tools/scaladoc/tasty/util/TestUtils.scala @@ -8,8 +8,6 @@ object TestUtils { import java.io.File import scala.collection.mutable.ListBuffer - val classRoot = new File(BuildInfo.test_testcasesOutputDir) - def go(bld: ListBuffer[String])(file: File): Unit = file.listFiles.foreach { f => if f.isFile() then @@ -17,11 +15,17 @@ object TestUtils { else go(bld)(f) } - if classRoot.isDirectory then - val bld = new ListBuffer[String] - go(bld)(classRoot) - bld.result - else - sys.error(s"Class root could not be found: $classRoot") + def listEntry(entry: String): List[String] = + val classRoot = File(entry) + if classRoot.isDirectory then + val bld = new ListBuffer[String] + go(bld)(classRoot) + bld.result + else + sys.error(s"Class root could not be found: $classRoot") + + val files = BuildInfo.test_testcasesOutputDir.flatMap(listEntry).toList + assert(files.nonEmpty, "Provided list of root directories is empty") + files } } diff --git a/scaladoc/test/dotty/dokka/testUtils.scala b/scaladoc/test/dotty/tools/scaladoc/testUtils.scala similarity index 89% rename from scaladoc/test/dotty/dokka/testUtils.scala rename to scaladoc/test/dotty/tools/scaladoc/testUtils.scala index 6c1ce1049121..cfab383c9ba8 100644 --- a/scaladoc/test/dotty/dokka/testUtils.scala +++ b/scaladoc/test/dotty/tools/scaladoc/testUtils.scala @@ -58,9 +58,9 @@ def testArgs(files: Seq[File] = Nil, dest: File = new File("notUsed")) = Scalado def testContext = (new ContextBase).initialCtx.fresh.setReporter(new TestReporter) -def testDocContext = DocContext(testArgs(), testContext) +def testDocContext(files: Seq[File] = Nil) = DocContext(testArgs(files), testContext) -def tastyFiles(name: String) = +def tastyFiles(name: String, allowEmpty: Boolean = false) = def listFilesSafe(dir: File) = Option(dir.listFiles).getOrElse { throw AssertionError(s"$dir not found. The test name is incorrect or scaladoc-testcases were not recompiled.") } @@ -69,4 +69,7 @@ def tastyFiles(name: String) = case f if f.getName endsWith ".tasty" => f :: Nil case _ => Nil } - collectFiles(File(s"${BuildInfo.test_testcasesOutputDir}/tests/$name")) \ No newline at end of file + val files = BuildInfo.test_testcasesOutputDir.flatMap(p => collectFiles(File(s"$p/tests/$name"))) + assert(files.nonEmpty || allowEmpty) + files.toSeq + diff --git a/scaladoc/test/dotty/dokka/util/JSONTest.scala b/scaladoc/test/dotty/tools/scaladoc/util/JSONTest.scala similarity index 100% rename from scaladoc/test/dotty/dokka/util/JSONTest.scala rename to scaladoc/test/dotty/tools/scaladoc/util/JSONTest.scala diff --git a/tests/bench/inductive-implicits.scala b/tests/bench/inductive-implicits.scala index d99439bc580a..58714214ce33 100644 --- a/tests/bench/inductive-implicits.scala +++ b/tests/bench/inductive-implicits.scala @@ -58,7 +58,7 @@ package shapeless { } } -import shapeless._ +import shapeless.* object Test extends App { val sel = Selector[L, Boolean] diff --git a/tests/bench/power-macro/PowerInlined-1.scala b/tests/bench/power-macro/PowerInlined-1.scala index 1e12da45f90a..eceff3aa18b9 100644 --- a/tests/bench/power-macro/PowerInlined-1.scala +++ b/tests/bench/power-macro/PowerInlined-1.scala @@ -1,6 +1,6 @@ object PowerInlined { - import PowerMacro._ + import PowerMacro.* power(1, 5.0) // 1 quotes to unpickle } diff --git a/tests/bench/power-macro/PowerInlined-1k.scala b/tests/bench/power-macro/PowerInlined-1k.scala index b5f6a5a11645..c90c949b1bc4 100644 --- a/tests/bench/power-macro/PowerInlined-1k.scala +++ b/tests/bench/power-macro/PowerInlined-1k.scala @@ -1,6 +1,6 @@ object PowerInlined1K { - import PowerMacro._ + import PowerMacro.* power(Int.MaxValue, 5.0) power(Int.MaxValue, 5.0) diff --git a/tests/bench/power-macro/PowerMacro.scala b/tests/bench/power-macro/PowerMacro.scala index 9462d2b71afd..03a77d927287 100644 --- a/tests/bench/power-macro/PowerMacro.scala +++ b/tests/bench/power-macro/PowerMacro.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object PowerMacro { diff --git a/tests/bench/string-interpolation-macro/Macro.scala b/tests/bench/string-interpolation-macro/Macro.scala index 4c5ba3cca029..373c7a491953 100644 --- a/tests/bench/string-interpolation-macro/Macro.scala +++ b/tests/bench/string-interpolation-macro/Macro.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/bench/string-interpolation-macro/Test.scala b/tests/bench/string-interpolation-macro/Test.scala index e32eeea2fef7..18332688dcf3 100644 --- a/tests/bench/string-interpolation-macro/Test.scala +++ b/tests/bench/string-interpolation-macro/Test.scala @@ -1,4 +1,4 @@ -import Macro._ +import Macro.* class Test: def test: String = x"a${1}b${2}c${3}d${4}e${5}f" diff --git a/tests/explicit-nulls/pos/java-varargs.scala b/tests/explicit-nulls/pos/java-varargs.scala index 8f2e48d287a3..1f7fd133fba7 100644 --- a/tests/explicit-nulls/pos/java-varargs.scala +++ b/tests/explicit-nulls/pos/java-varargs.scala @@ -1,5 +1,5 @@ -import java.nio.file._ +import java.nio.file.* import java.nio.file.Paths diff --git a/tests/fuzzy/015ea9cf2d07b27200a33c4451bfc4c93afe213e.scala b/tests/fuzzy/015ea9cf2d07b27200a33c4451bfc4c93afe213e.scala index e9f92773671a..00b6c6343d67 100644 --- a/tests/fuzzy/015ea9cf2d07b27200a33c4451bfc4c93afe213e.scala +++ b/tests/fuzzy/015ea9cf2d07b27200a33c4451bfc4c93afe213e.scala @@ -2,7 +2,7 @@ class i0 { type Int; val i1 = 2 private val i2 = (List(): List[Int]) -import i1.{ () => Double(_)).asInstanceOf[i2]) } else new i0(1) +import i1.{ () as Double(_)).asInstanceOf[i2]) } else new i0(1) List(List(1), None) println(i1(17)) new _ diff --git a/tests/fuzzy/14b960e57195554a6a085eae8e039a949e8b106d.scala b/tests/fuzzy/14b960e57195554a6a085eae8e039a949e8b106d.scala index 96e0aade993e..eb05d04d1a8c 100644 --- a/tests/fuzzy/14b960e57195554a6a085eae8e039a949e8b106d.scala +++ b/tests/fuzzy/14b960e57195554a6a085eae8e039a949e8b106d.scala @@ -2,6 +2,6 @@ class i0 { val i1: (Any => String) = ??? } object i0 { -import Ordering.{ implicitly => } (true: Boolean) match { case _: i1 => true } +import Ordering.{ implicitly as } (true: Boolean) match { case _: i1 as true } def i1(erased i2: Int): Int = { i1: Set[Int] => } } \ No newline at end of file diff --git a/tests/fuzzy/1d1f57703bbd37dd850480cb5d99130930be08c9.scala b/tests/fuzzy/1d1f57703bbd37dd850480cb5d99130930be08c9.scala index ccfcbef33a65..d3cccdf43509 100644 --- a/tests/fuzzy/1d1f57703bbd37dd850480cb5d99130930be08c9.scala +++ b/tests/fuzzy/1d1f57703bbd37dd850480cb5d99130930be08c9.scala @@ -1,5 +1,5 @@ object App { -import i0.{ i1 => false } +import i0.{ i1 as false } def Array(i0: Int => Boolean): Any = ??? } object i2 { diff --git a/tests/fuzzy/471d33abf565d5dd3691679237f148638f4ff115.scala b/tests/fuzzy/471d33abf565d5dd3691679237f148638f4ff115.scala index da61389c21cc..8c00a4f07b6d 100644 --- a/tests/fuzzy/471d33abf565d5dd3691679237f148638f4ff115.scala +++ b/tests/fuzzy/471d33abf565d5dd3691679237f148638f4ff115.scala @@ -45,7 +45,7 @@ private def i3 = 1000 * 60 * 24 * i2 = 5 + i4 + i2; case 5 => 0 } } } -import i0.{ toInt, i2 => this } +import i0.{ toInt, i2 as this } val i7 = new i4 val i5 = new i0 val i6 = new i0 diff --git a/tests/fuzzy/628b3c175445b95d9155223a2651ad97c6091657.scala b/tests/fuzzy/628b3c175445b95d9155223a2651ad97c6091657.scala index 4394f5e14cdd..a646fd6bbf23 100644 --- a/tests/fuzzy/628b3c175445b95d9155223a2651ad97c6091657.scala +++ b/tests/fuzzy/628b3c175445b95d9155223a2651ad97c6091657.scala @@ -11,7 +11,7 @@ type i6 type i79 <: i7{type i9, i10 <: i5.i2] } val i9: i8 { type i4 = i13.i9 } val i16 = new i1 {} } -import i9.{ Set, i8 => }i9 { +import i9.{ Set, i8 as }i9 { object i10 extends i6 with i4 { val i5 = new i9 var i9: i3.i2 diff --git a/tests/fuzzy/670b1276fc9546345aa3a1f1cd07439d77fbb913.scala b/tests/fuzzy/670b1276fc9546345aa3a1f1cd07439d77fbb913.scala index 8d4f9133fde1..0507e8aae9e2 100644 --- a/tests/fuzzy/670b1276fc9546345aa3a1f1cd07439d77fbb913.scala +++ b/tests/fuzzy/670b1276fc9546345aa3a1f1cd07439d77fbb913.scala @@ -13,7 +13,7 @@ def i4(i5: Any) = () object i6 { def i7(i8: String): Int = i11 val i11 = new i1 { -import i2.{ i7 => } class i10 { +import i2.{ i7 as } class i10 { val i10 = new Array(10) val i11: i0 = i13 case i10 => i13.i10 case _ => case _ => case _ => throw new i17 diff --git a/tests/fuzzy/827a8c670660b1c8bbe210e7a9dffea632ee39ea.scala b/tests/fuzzy/827a8c670660b1c8bbe210e7a9dffea632ee39ea.scala index b5e32d1d4ac4..9e8ec9bb6d7f 100644 --- a/tests/fuzzy/827a8c670660b1c8bbe210e7a9dffea632ee39ea.scala +++ b/tests/fuzzy/827a8c670660b1c8bbe210e7a9dffea632ee39ea.scala @@ -19,7 +19,7 @@ def i16() = 55 } object i11 extends i12 { override def i16: i1 = ??? -import i8._ +import i8.* i15.size = ??? } } \ No newline at end of file diff --git a/tests/fuzzy/87b1e375168a7888470eefc1fb867d0c9f550865.scala b/tests/fuzzy/87b1e375168a7888470eefc1fb867d0c9f550865.scala index 64bb876e79bf..8740ea3c720d 100644 --- a/tests/fuzzy/87b1e375168a7888470eefc1fb867d0c9f550865.scala +++ b/tests/fuzzy/87b1e375168a7888470eefc1fb867d0c9f550865.scala @@ -25,7 +25,7 @@ type i11 <: i10 type i19 = i10 val i11: i5[i12] = ??? } -import i12._ +import i12.* val i20: i12 = ??? i16 i14 { type i18[i3[i1, i2]] = i15[i5[i10]#i14, diff --git a/tests/fuzzy/87e911d4a30f9df0be954fcb2cd693c86d4ea19d.scala b/tests/fuzzy/87e911d4a30f9df0be954fcb2cd693c86d4ea19d.scala index 6d6eb635ba75..c91f0558b286 100644 --- a/tests/fuzzy/87e911d4a30f9df0be954fcb2cd693c86d4ea19d.scala +++ b/tests/fuzzy/87e911d4a30f9df0be954fcb2cd693c86d4ea19d.scala @@ -7,7 +7,7 @@ trait i6 extends i3 { var i1: Int } class i4 { -import i0._ +import i0.* val i7 = new i3 {} } object i8 { diff --git a/tests/fuzzy/95bbe2ee00e10cbb3890bcbfe5da2b584a8388e1.scala b/tests/fuzzy/95bbe2ee00e10cbb3890bcbfe5da2b584a8388e1.scala index 103e49758095..d6531b1368e1 100644 --- a/tests/fuzzy/95bbe2ee00e10cbb3890bcbfe5da2b584a8388e1.scala +++ b/tests/fuzzy/95bbe2ee00e10cbb3890bcbfe5da2b584a8388e1.scala @@ -4,7 +4,7 @@ def i1(i2: String)(i3: String): String = ??? } class i4() { def apply(i1: Int): Int = i2 match { case _: Throwable -import scala.annotation.i1._ +import scala.annotation.i1.* type i2 = i0 { type i1 } trait i3 { type i1 <: i0 diff --git a/tests/fuzzy/c091e02ebdd6f7de5e190325fdbb80c8aca00c62.scala b/tests/fuzzy/c091e02ebdd6f7de5e190325fdbb80c8aca00c62.scala index 0ac83f56a5f4..e7e6cf507940 100644 --- a/tests/fuzzy/c091e02ebdd6f7de5e190325fdbb80c8aca00c62.scala +++ b/tests/fuzzy/c091e02ebdd6f7de5e190325fdbb80c8aca00c62.scala @@ -1,4 +1,4 @@ -import scala.i0.{ i1 => } +import scala.i0.{ i1 as } object i2 { private[this] { object i3 extends i0 { new i0 { case i1 => type i2 = Int } } implicit object i4 extends Object { diff --git a/tests/fuzzy/comment7.scala b/tests/fuzzy/comment7.scala index 485b22eb1ed6..90e38e623020 100644 --- a/tests/fuzzy/comment7.scala +++ b/tests/fuzzy/comment7.scala @@ -8,6 +8,6 @@ case i0(i1, i1) => case _ => i2 } } object i5 { -import collection.mutable._ +import collection.mutable.* try { ??? mutable { case i1(i5, i3, i4) => i5 }) } diff --git a/tests/fuzzy/d9366dfb4c3f01352f197fec820c771a96500a98.scala b/tests/fuzzy/d9366dfb4c3f01352f197fec820c771a96500a98.scala index 931520fc7264..74fd5dc75caf 100644 --- a/tests/fuzzy/d9366dfb4c3f01352f197fec820c771a96500a98.scala +++ b/tests/fuzzy/d9366dfb4c3f01352f197fec820c771a96500a98.scala @@ -6,6 +6,6 @@ val i5 = i1(i4, ) def i6(i5: String)(i6: => i3.asInstanceOf[String]) = i4.length } object i7 { -import i6._ +import i6.* val i7: Int = 1 val i1 = new i2() } \ No newline at end of file diff --git a/tests/fuzzy/dc731deada78bc82a0367866d3b7be065344d6f3.scala b/tests/fuzzy/dc731deada78bc82a0367866d3b7be065344d6f3.scala index a27370e08141..5b58166553d1 100644 --- a/tests/fuzzy/dc731deada78bc82a0367866d3b7be065344d6f3.scala +++ b/tests/fuzzy/dc731deada78bc82a0367866d3b7be065344d6f3.scala @@ -6,4 +6,4 @@ new i0 { implicit def i4: Any = super[String] } trait i3 -class i4 extends import +({ classTag) => i5 }(Tuple2.i6) } \ No newline at end of file +class i4 extends import +({ classTag) as i5 }(Tuple2.i6) } \ No newline at end of file diff --git a/tests/idempotency/IdempotencyCheck.scala b/tests/idempotency/IdempotencyCheck.scala index 4e1686ece38e..6f9a8de588de 100644 --- a/tests/idempotency/IdempotencyCheck.scala +++ b/tests/idempotency/IdempotencyCheck.scala @@ -1,9 +1,9 @@ -import java.io.{File => JFile} -import java.nio.file.{ Files => JFiles, Path => JPath, Paths => JPaths } -import java.util.stream.{ Stream => JStream } +import java.io.File as JFile +import java.nio.file.{ Files as JFiles, Path as JPath, Paths as JPaths } +import java.util.stream.Stream as JStream -import scala.collection.JavaConverters._ +import scala.collection.JavaConverters.* object IdempotencyCheck { val blacklisted = Set( diff --git a/tests/init/crash/tuples.scala b/tests/init/crash/tuples.scala index 2ab97cb4aec3..b700900f8e86 100644 --- a/tests/init/crash/tuples.scala +++ b/tests/init/crash/tuples.scala @@ -1,4 +1,4 @@ -import Function._ +import Function.* object Test extends App { var xyz: (Int, String, Boolean) = _ // error diff --git a/tests/init/neg/inner-pat_iuli.scala b/tests/init/neg/inner-pat_iuli.scala index 35e757cd7cb5..e5010cca98ec 100644 --- a/tests/init/neg/inner-pat_iuli.scala +++ b/tests/init/neg/inner-pat_iuli.scala @@ -7,7 +7,7 @@ trait Ops { self: MyCodes => } trait Blox { self: MyCodes => - import opcodes._ + import opcodes.* class Basick { var foo: Instru = null diff --git a/tests/init/neg/inner11.scala b/tests/init/neg/inner11.scala index 7a96a29f8a25..df5eb52a55c8 100644 --- a/tests/init/neg/inner11.scala +++ b/tests/init/neg/inner11.scala @@ -13,6 +13,7 @@ object NameKinds { type ThisInfo = Info val info: Info = new Info println(info.kind) // error + val n = 10 } } @@ -32,4 +33,4 @@ object NameKinds2 { val info: Info = new Info println(info.kind) // ok } -} \ No newline at end of file +} diff --git a/tests/init/neg/lazylist1.scala b/tests/init/neg/lazylist1.scala index 9df3fcfddee7..75556d73aa74 100644 --- a/tests/init/neg/lazylist1.scala +++ b/tests/init/neg/lazylist1.scala @@ -9,7 +9,7 @@ object LazyList { } } -import LazyList._ +import LazyList.* final class Test { lazy val a: LazyList[Int] = 5 #:: b diff --git a/tests/init/neg/lazylist2.scala b/tests/init/neg/lazylist2.scala index 3ef61b6d29e8..18072676fa4c 100644 --- a/tests/init/neg/lazylist2.scala +++ b/tests/init/neg/lazylist2.scala @@ -17,7 +17,7 @@ object LazyList { } } -import LazyList._ +import LazyList.* final class Test1 { lazy val a: LazyList[Int] = 5 #:: b diff --git a/tests/init/pos/Properties.scala b/tests/init/pos/Properties.scala index df4aee821f9a..84d1e09a24f9 100644 --- a/tests/init/pos/Properties.scala +++ b/tests/init/pos/Properties.scala @@ -11,7 +11,7 @@ package scala package util import java.io.{ IOException, PrintWriter } -import java.util.jar.Attributes.{ Name => AttributeName } +import java.util.jar.Attributes.Name as AttributeName private[scala] trait PropertiesTrait { protected def propCategory: String // specializes the remainder of the values diff --git a/tests/init/pos/assignments.scala b/tests/init/pos/assignments.scala index aa20daf02402..bb58275a89d0 100644 --- a/tests/init/pos/assignments.scala +++ b/tests/init/pos/assignments.scala @@ -20,7 +20,7 @@ object assignments { c.x = c.x * 2 val cc = c - import cc._ + import cc.* x = x + 1 x *= 2 } diff --git a/tests/init/pos/early-promote-simple.scala b/tests/init/pos/early-promote-simple.scala new file mode 100644 index 000000000000..2c2992519280 --- /dev/null +++ b/tests/init/pos/early-promote-simple.scala @@ -0,0 +1,14 @@ +class P() { + val a = 1 + List(this) +} + +class Outer { + class Inner { + val b = a + } + val a = 5 + val b = new Inner() + List(new Inner()) + List(b) +} \ No newline at end of file diff --git a/tests/invalid/pos/specializes-sym-crash.scala b/tests/invalid/pos/specializes-sym-crash.scala index e0e458170929..94878da32f8f 100644 --- a/tests/invalid/pos/specializes-sym-crash.scala +++ b/tests/invalid/pos/specializes-sym-crash.scala @@ -1,5 +1,5 @@ // This relies on the naming of the transformed classes which will have to change in the new stdlib. -import scala.collection._ +import scala.collection.* trait Foo[+A, +Coll, diff --git a/tests/invalid/pos/t2782.scala b/tests/invalid/pos/t2782.scala index 3b387af8030e..aa5538d79367 100644 --- a/tests/invalid/pos/t2782.scala +++ b/tests/invalid/pos/t2782.scala @@ -1,4 +1,4 @@ -import scala.{collection => sc} +import scala.collection as sc object Test { trait Foo[T] diff --git a/tests/invalid/pos/t4365/a_1.scala b/tests/invalid/pos/t4365/a_1.scala index 0be5ca8a19e9..361c8c306ab7 100644 --- a/tests/invalid/pos/t4365/a_1.scala +++ b/tests/invalid/pos/t4365/a_1.scala @@ -1,5 +1,5 @@ // Invalid because it relies on internal traits of views that will change their names. -import scala.collection._ +import scala.collection.* trait SeqViewLike[+A, +Coll, diff --git a/tests/invalid/pos/t4365/b_1.scala b/tests/invalid/pos/t4365/b_1.scala index e1423813f1b2..5644aca370cb 100644 --- a/tests/invalid/pos/t4365/b_1.scala +++ b/tests/invalid/pos/t4365/b_1.scala @@ -1,4 +1,4 @@ -import scala.collection._ +import scala.collection.* trait GenSeqView0[+A, +Coll] diff --git a/tests/invalid/pos/t533.scala b/tests/invalid/pos/t533.scala index 9bc9995d9c30..81b298e82010 100644 --- a/tests/invalid/pos/t533.scala +++ b/tests/invalid/pos/t533.scala @@ -1,4 +1,4 @@ -import scala.actors._ +import scala.actors.* object test extends Actor { def act(): Unit = { diff --git a/tests/invalid/pos/t8023.scala b/tests/invalid/pos/t8023.scala index 9ce5619dbe39..63c0528e4d56 100644 --- a/tests/invalid/pos/t8023.scala +++ b/tests/invalid/pos/t8023.scala @@ -1,5 +1,5 @@ // Invalid because nested hk type parameters are no longer allowed -import language._ +import language.* object Test { diff --git a/tests/invalid/run/Tuple.scala b/tests/invalid/run/Tuple.scala index 00a9b545e77d..9da7e941b098 100644 --- a/tests/invalid/run/Tuple.scala +++ b/tests/invalid/run/Tuple.scala @@ -13,7 +13,7 @@ object Empty extends Tuple final case class *: [H, T <: Tuple](hd: H, tl: T) extends Tuple object Tuple { - import typelevel._ + import typelevel.* type Empty = Empty.type class TupleOps(val xs: Tuple) extends AnyVal { diff --git a/tests/invalid/run/typelevel-patmat.scala b/tests/invalid/run/typelevel-patmat.scala index 7b110c97c42c..e639a7b795a1 100644 --- a/tests/invalid/run/typelevel-patmat.scala +++ b/tests/invalid/run/typelevel-patmat.scala @@ -17,7 +17,7 @@ case object HNil extends HList case class HCons [H, T <: HList](hd: H, tl: T) extends HList object Test extends App { - import typelevel._ + import typelevel.* type HNil = HNil.type type Z = Z.type diff --git a/tests/link/on-custom-lib/builder2.scala b/tests/link/on-custom-lib/builder2.scala index 88c447900ca6..93b2bdd3771c 100644 --- a/tests/link/on-custom-lib/builder2.scala +++ b/tests/link/on-custom-lib/builder2.scala @@ -1,5 +1,5 @@ -import strawman.collection.mutable._ +import strawman.collection.mutable.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/link/on-custom-lib/map2.scala b/tests/link/on-custom-lib/map2.scala index 7a3b41dd4e88..08ca7a634e98 100644 --- a/tests/link/on-custom-lib/map2.scala +++ b/tests/link/on-custom-lib/map2.scala @@ -1,4 +1,4 @@ -import strawman.collection._ +import strawman.collection.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/neg-custom-args/erased/erased-machine-state-encoding-with-inline.scala b/tests/neg-custom-args/erased/erased-machine-state-encoding-with-inline.scala index 0961ca4fbbee..f2d1e8300b45 100644 --- a/tests/neg-custom-args/erased/erased-machine-state-encoding-with-inline.scala +++ b/tests/neg-custom-args/erased/erased-machine-state-encoding-with-inline.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* sealed trait State final class On extends State diff --git a/tests/neg-custom-args/fatal-warnings/classtag-typetest/3_1-migration.scala b/tests/neg-custom-args/fatal-warnings/classtag-typetest/3_1-migration.scala index 07bb2971bb0a..da26fd3c5569 100644 --- a/tests/neg-custom-args/fatal-warnings/classtag-typetest/3_1-migration.scala +++ b/tests/neg-custom-args/fatal-warnings/classtag-typetest/3_1-migration.scala @@ -1,4 +1,4 @@ -import scala.language.`3.1-migration` +import scala.language.`future-migration` import scala.reflect.ClassTag def f3_1m[T: ClassTag](x: Any): Unit = diff --git a/tests/neg-custom-args/fatal-warnings/classtag-typetest/3_1.scala b/tests/neg-custom-args/fatal-warnings/classtag-typetest/3_1.scala index 3a795e7e3dd0..b21fb0606b8e 100644 --- a/tests/neg-custom-args/fatal-warnings/classtag-typetest/3_1.scala +++ b/tests/neg-custom-args/fatal-warnings/classtag-typetest/3_1.scala @@ -1,4 +1,4 @@ -import scala.language.`3.1` +import scala.language.future import scala.reflect.ClassTag def f3_1[T: ClassTag](x: Any): Unit = diff --git a/tests/neg-custom-args/fatal-warnings/i9266.check b/tests/neg-custom-args/fatal-warnings/i9266.check index 00f0973a160c..849aed5fa2e0 100644 --- a/tests/neg-custom-args/fatal-warnings/i9266.check +++ b/tests/neg-custom-args/fatal-warnings/i9266.check @@ -2,4 +2,4 @@ 3 |def test = { implicit x: Int => x + x } // error | ^ | This syntax is no longer supported; parameter needs to be enclosed in (...) - | This construct can be rewritten automatically under -rewrite -source 3.1-migration. + | This construct can be rewritten automatically under -rewrite -source future-migration. diff --git a/tests/neg-custom-args/fatal-warnings/i9266.scala b/tests/neg-custom-args/fatal-warnings/i9266.scala index a658591792fb..84268c078b49 100644 --- a/tests/neg-custom-args/fatal-warnings/i9266.scala +++ b/tests/neg-custom-args/fatal-warnings/i9266.scala @@ -1,3 +1,3 @@ -import language.`3.1-migration` +import language.`future-migration` def test = { implicit x: Int => x + x } // error diff --git a/tests/neg-custom-args/fatal-warnings/i9408b/Test_2.scala b/tests/neg-custom-args/fatal-warnings/i9408b/Test_2.scala index 885126691cf8..1c45f8ba66fe 100644 --- a/tests/neg-custom-args/fatal-warnings/i9408b/Test_2.scala +++ b/tests/neg-custom-args/fatal-warnings/i9408b/Test_2.scala @@ -2,6 +2,6 @@ import language.`3.0-migration` import scala.language.implicitConversions object Test { - import test.conversions.Conv._ + import test.conversions.Conv.* val length: Int = "abc" // error } diff --git a/tests/neg-custom-args/i5498-postfixOps.scala b/tests/neg-custom-args/i5498-postfixOps.scala index 2c02c2c62c5d..79b73717db6a 100644 --- a/tests/neg-custom-args/i5498-postfixOps.scala +++ b/tests/neg-custom-args/i5498-postfixOps.scala @@ -1,7 +1,7 @@ -import scala.concurrent.duration._ +import scala.concurrent.duration.* def test() = { 1 second // error: usage of postfix operator Seq(1, 2).filter(List(1,2) contains) // error: usage of postfix operator -} \ No newline at end of file +} diff --git a/tests/neg-custom-args/implicit-conversions-old.scala b/tests/neg-custom-args/implicit-conversions-old.scala index ca2bf150ddf5..1050094dcaf1 100644 --- a/tests/neg-custom-args/implicit-conversions-old.scala +++ b/tests/neg-custom-args/implicit-conversions-old.scala @@ -15,7 +15,7 @@ object D { } object Test { - import D._ + import D.* val x1: A = new B val x2: B = new A // ok, since it's an old-style comversion diff --git a/tests/neg-custom-args/typeclass-derivation2.scala b/tests/neg-custom-args/typeclass-derivation2.scala index 525d3ea040da..75e549413027 100644 --- a/tests/neg-custom-args/typeclass-derivation2.scala +++ b/tests/neg-custom-args/typeclass-derivation2.scala @@ -5,7 +5,7 @@ object TypeLevel { /** @param caseLabels The case and element labels of the described ADT as encoded strings. */ class GenericClass(labelsStr: String) { - import GenericClass._ + import GenericClass.* /** A mirror of case with ordinal number `ordinal` and elements as given by `Product` */ def mirror(ordinal: Int, product: Product): Mirror = @@ -128,7 +128,7 @@ enum Lst[+T] { object Lst { // common compiler-generated infrastructure - import TypeLevel._ + import TypeLevel.* type Shape[T] = Shape.Cases[( Shape.Case[Cons[T], (T, Lst[T])], @@ -161,7 +161,7 @@ case class Pair[T](x: T, y: T) // derives Eq, Pickler, Show object Pair { // common compiler-generated infrastructure - import TypeLevel._ + import TypeLevel.* type Shape[T] = Shape.Case[Pair[T], (T, T)] @@ -182,7 +182,7 @@ case class Left[L](x: L) extends Either[L, Nothing] case class Right[R](x: R) extends Either[Nothing, R] object Either { - import TypeLevel._ + import TypeLevel.* type Shape[L, R] = Shape.Cases[( Shape.Case[Left[L], L *: EmptyTuple], @@ -211,7 +211,7 @@ trait Show[T] { } object Show { import scala.compiletime.{erasedValue, error, summonInline} - import TypeLevel._ + import TypeLevel.* inline def tryShow[T](x: T): String = summonInline[Show[T]].show(x) @@ -263,7 +263,7 @@ object Show { // Tests object Test extends App { - import TypeLevel._ + import TypeLevel.* def showPrintln[T: Show](x: T): Unit = println(implicitly[Show[T]].show(x)) diff --git a/tests/neg-macros/BigFloat/BigFloatFromDigitsImpl_1.scala b/tests/neg-macros/BigFloat/BigFloatFromDigitsImpl_1.scala index a1ecc31b776e..96f65d0c0ec0 100644 --- a/tests/neg-macros/BigFloat/BigFloatFromDigitsImpl_1.scala +++ b/tests/neg-macros/BigFloat/BigFloatFromDigitsImpl_1.scala @@ -1,7 +1,7 @@ package test import language.experimental.genericNumberLiterals import scala.util.FromDigits -import scala.quoted._ +import scala.quoted.* object BigFloatFromDigitsImpl: def apply(digits: Expr[String])(using Quotes): Expr[BigFloat] = diff --git a/tests/neg-macros/BigFloat/BigFloat_1.scala b/tests/neg-macros/BigFloat/BigFloat_1.scala index 4d256f4394d8..5bb5b49587bd 100644 --- a/tests/neg-macros/BigFloat/BigFloat_1.scala +++ b/tests/neg-macros/BigFloat/BigFloat_1.scala @@ -1,7 +1,7 @@ package test import language.experimental.genericNumberLiterals import scala.util.FromDigits -import scala.quoted._ +import scala.quoted.* case class BigFloat(mantissa: BigInt, exponent: Int) { diff --git a/tests/neg-macros/GenericNumLits/EvenFromDigitsImpl_1.scala b/tests/neg-macros/GenericNumLits/EvenFromDigitsImpl_1.scala index 1d2e484daa5d..2c8e0d088ea8 100644 --- a/tests/neg-macros/GenericNumLits/EvenFromDigitsImpl_1.scala +++ b/tests/neg-macros/GenericNumLits/EvenFromDigitsImpl_1.scala @@ -1,7 +1,7 @@ import language.experimental.genericNumberLiterals import scala.util.FromDigits -import scala.quoted._ -import Even._ +import scala.quoted.* +import Even.* object EvenFromDigitsImpl: def apply(digits: Expr[String])(using Quotes): Expr[Even] = digits.value match { diff --git a/tests/neg-macros/GenericNumLits/Even_1.scala b/tests/neg-macros/GenericNumLits/Even_1.scala index 6dc1117f25b6..0867150dd944 100644 --- a/tests/neg-macros/GenericNumLits/Even_1.scala +++ b/tests/neg-macros/GenericNumLits/Even_1.scala @@ -1,6 +1,6 @@ import language.experimental.genericNumberLiterals import scala.util.FromDigits -import scala.quoted._ +import scala.quoted.* case class Even(n: Int) diff --git a/tests/neg-macros/beta-reduce-inline-result/Macro_1.scala b/tests/neg-macros/beta-reduce-inline-result/Macro_1.scala index 748f2c4d5a41..0dd6bf899b63 100644 --- a/tests/neg-macros/beta-reduce-inline-result/Macro_1.scala +++ b/tests/neg-macros/beta-reduce-inline-result/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def betaReduce[Arg,Result](inline fn: Arg=>Result)(inline arg: Arg): Result = diff --git a/tests/neg-macros/delegate-match-1/Macro_1.scala b/tests/neg-macros/delegate-match-1/Macro_1.scala index b6b87f2939cb..7c5702b56fc6 100644 --- a/tests/neg-macros/delegate-match-1/Macro_1.scala +++ b/tests/neg-macros/delegate-match-1/Macro_1.scala @@ -1,10 +1,10 @@ -import scala.quoted._ +import scala.quoted.* inline def f: Any = ${ fImpl } private def fImpl(using Quotes): Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* Implicits.search(TypeRepr.of[A]) match { case x: ImplicitSearchSuccess => '{} diff --git a/tests/neg-macros/delegate-match-2/Macro_1.scala b/tests/neg-macros/delegate-match-2/Macro_1.scala index 4583fbf336d8..6c7e6917900e 100644 --- a/tests/neg-macros/delegate-match-2/Macro_1.scala +++ b/tests/neg-macros/delegate-match-2/Macro_1.scala @@ -1,10 +1,10 @@ -import scala.quoted._ +import scala.quoted.* inline def f: Any = ${ fImpl } private def fImpl (using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* Implicits.search(TypeRepr.of[A]) match { case x: ImplicitSearchSuccess => '{} diff --git a/tests/neg-macros/delegate-match-3/Macro_1.scala b/tests/neg-macros/delegate-match-3/Macro_1.scala index 11fb28aba16a..89e467388a6f 100644 --- a/tests/neg-macros/delegate-match-3/Macro_1.scala +++ b/tests/neg-macros/delegate-match-3/Macro_1.scala @@ -1,10 +1,10 @@ -import scala.quoted._ +import scala.quoted.* inline def f: Any = ${ fImpl } private def fImpl(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* Implicits.search(TypeRepr.of[A]) match { case x: ImplicitSearchSuccess => '{} diff --git a/tests/neg-macros/i10127-a.scala b/tests/neg-macros/i10127-a.scala index c62dab8b7ac2..3e23cf10bd30 100644 --- a/tests/neg-macros/i10127-a.scala +++ b/tests/neg-macros/i10127-a.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object T { def impl[A](using t: Type[A])(using Quotes): Expr[Unit] = { diff --git a/tests/neg-macros/i10127-b.scala b/tests/neg-macros/i10127-b.scala index 8c69ea5444c1..2e87e92efa63 100644 --- a/tests/neg-macros/i10127-b.scala +++ b/tests/neg-macros/i10127-b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* case class T(x: Type[_ <: Any]) diff --git a/tests/neg-macros/i10709/Macro_1.scala b/tests/neg-macros/i10709/Macro_1.scala index 22f77817bebe..5416bf835cb2 100644 --- a/tests/neg-macros/i10709/Macro_1.scala +++ b/tests/neg-macros/i10709/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.compiletime.summonInline object Invalid { diff --git a/tests/neg-macros/i4044a.scala b/tests/neg-macros/i4044a.scala index 4424149488d2..a2f68d149750 100644 --- a/tests/neg-macros/i4044a.scala +++ b/tests/neg-macros/i4044a.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def test(using Quotes) = { diff --git a/tests/neg-macros/i4044b.scala b/tests/neg-macros/i4044b.scala index a692b59b1be8..635dd9ce9d5f 100644 --- a/tests/neg-macros/i4044b.scala +++ b/tests/neg-macros/i4044b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def test(using Quotes) = { diff --git a/tests/neg-macros/i4396b.scala b/tests/neg-macros/i4396b.scala index f5c4eb2d7fba..cb42aadaedee 100644 --- a/tests/neg-macros/i4396b.scala +++ b/tests/neg-macros/i4396b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def test(using Quotes) = { '{ case class Foo() } // error } \ No newline at end of file diff --git a/tests/neg-macros/i4431.scala b/tests/neg-macros/i4431.scala index 2523a90d6153..c1702e25b42c 100644 --- a/tests/neg-macros/i4431.scala +++ b/tests/neg-macros/i4431.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def h(f: => Int => String): String = ${'{f(42)}} // error diff --git a/tests/neg-macros/i4493-b.scala b/tests/neg-macros/i4493-b.scala index 09470a097367..00386c0b9413 100644 --- a/tests/neg-macros/i4493-b.scala +++ b/tests/neg-macros/i4493-b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Index[K] object Index { inline def succ[K](x: K): Unit = ${ diff --git a/tests/neg-macros/i4493.scala b/tests/neg-macros/i4493.scala index b6121155716a..f600a7ee9478 100644 --- a/tests/neg-macros/i4493.scala +++ b/tests/neg-macros/i4493.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Index[K] object Index { inline def succ[K]: Unit = ${ diff --git a/tests/neg-macros/i4803e.scala b/tests/neg-macros/i4803e.scala index dd4733332895..dc966f850a50 100644 --- a/tests/neg-macros/i4803e.scala +++ b/tests/neg-macros/i4803e.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object PowerMacro { def power2(x: Expr[Double])(using Quotes) = '{ diff --git a/tests/neg-macros/i4803f.scala b/tests/neg-macros/i4803f.scala index a2420a3a619a..a081b3108dc9 100644 --- a/tests/neg-macros/i4803f.scala +++ b/tests/neg-macros/i4803f.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object PowerMacro { def powerCode(x: Expr[Double], n: Long)(using Quotes): Expr[Double] = diff --git a/tests/neg-macros/i4846.scala b/tests/neg-macros/i4846.scala index e8b666e10232..733336dacb97 100644 --- a/tests/neg-macros/i4846.scala +++ b/tests/neg-macros/i4846.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { inline def foo(inline x: Int): Int = ${ diff --git a/tests/neg-macros/i4890.scala b/tests/neg-macros/i4890.scala index d809c54e3a5f..1694a3a8debd 100644 --- a/tests/neg-macros/i4890.scala +++ b/tests/neg-macros/i4890.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { def toExpr(x: Option[String]): Expr[String] = x match { diff --git a/tests/neg-macros/i5547.scala b/tests/neg-macros/i5547.scala index 0f895e65d779..b90204b77149 100644 --- a/tests/neg-macros/i5547.scala +++ b/tests/neg-macros/i5547.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert2(condition: => Boolean): Unit = diff --git a/tests/neg-macros/i5840.scala b/tests/neg-macros/i5840.scala index 21adfa138b57..10c1446ef3c5 100644 --- a/tests/neg-macros/i5840.scala +++ b/tests/neg-macros/i5840.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { type Contextual[T] = Quotes ?=> T diff --git a/tests/neg-macros/i5954.scala b/tests/neg-macros/i5954.scala index 73af3b84b2bd..6740b837c9be 100644 --- a/tests/neg-macros/i5954.scala +++ b/tests/neg-macros/i5954.scala @@ -3,7 +3,7 @@ abstract class MatcherFactory1 { } object MatcherFactory1 { - import scala.quoted._ + import scala.quoted.* def impl2(a: MatcherFactory1)(self: Expr[a.AndNotWord]) = '{ val a: Any = $self } // error: access to value a from wrong staging level diff --git a/tests/neg-macros/i5954b.scala b/tests/neg-macros/i5954b.scala index 86f5340ca63d..086351b517b1 100644 --- a/tests/neg-macros/i5954b.scala +++ b/tests/neg-macros/i5954b.scala @@ -3,7 +3,7 @@ abstract class MatcherFactory1[A] { } object MatcherFactory1 { - import scala.quoted._ + import scala.quoted.* def impl[T](self: Expr[MatcherFactory1[T]#AndNotWord])(using Quotes) = '{ val a: Any = $self } // error: access to type T from wrong staging level diff --git a/tests/neg-macros/i5954c.scala b/tests/neg-macros/i5954c.scala index 94182d430d1d..5e9e6bbb3178 100644 --- a/tests/neg-macros/i5954c.scala +++ b/tests/neg-macros/i5954c.scala @@ -3,7 +3,7 @@ abstract class MatcherFactory1 { } object MatcherFactory1 { - import scala.quoted._ + import scala.quoted.* def impl[T](self: Expr[MatcherFactory1#AndNotWord[T]])(using Quotes) = '{ val a: Any = $self } // error: access to type T from wrong staging level diff --git a/tests/neg-macros/i6432/Macro_1.scala b/tests/neg-macros/i6432/Macro_1.scala index 8ef85c0e9b26..e2628fd45f7f 100644 --- a/tests/neg-macros/i6432/Macro_1.scala +++ b/tests/neg-macros/i6432/Macro_1.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* object Macro { extension (inline sc: StringContext) inline def foo(args: String*): Unit = ${ impl('sc) } def impl(sc: Expr[StringContext])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* sc match { case '{ StringContext(${Varargs(parts)}*) } => for (part @ Expr(s) <- parts) diff --git a/tests/neg-macros/i6432/Test_2.scala b/tests/neg-macros/i6432/Test_2.scala index f09d5f331b8c..b685ee08c1d9 100644 --- a/tests/neg-macros/i6432/Test_2.scala +++ b/tests/neg-macros/i6432/Test_2.scala @@ -1,5 +1,5 @@ object TestA { - import Macro._ + import Macro.* foo"abc${"123"}xyz${"456"}fgh" // error // error // error } \ No newline at end of file diff --git a/tests/neg-macros/i6432b/Macro_1.scala b/tests/neg-macros/i6432b/Macro_1.scala index 8ef85c0e9b26..e2628fd45f7f 100644 --- a/tests/neg-macros/i6432b/Macro_1.scala +++ b/tests/neg-macros/i6432b/Macro_1.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* object Macro { extension (inline sc: StringContext) inline def foo(args: String*): Unit = ${ impl('sc) } def impl(sc: Expr[StringContext])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* sc match { case '{ StringContext(${Varargs(parts)}*) } => for (part @ Expr(s) <- parts) diff --git a/tests/neg-macros/i6432b/Test_2.scala b/tests/neg-macros/i6432b/Test_2.scala index f968f08ccc0d..8b96022afc31 100644 --- a/tests/neg-macros/i6432b/Test_2.scala +++ b/tests/neg-macros/i6432b/Test_2.scala @@ -1,5 +1,5 @@ object TestA { - import Macro._ + import Macro.* foo"""abc${"123"}xyz${"456"}fgh""" // error // error // error } \ No newline at end of file diff --git a/tests/neg-macros/i6436.scala b/tests/neg-macros/i6436.scala index a7f0bda94419..68d53bb0978d 100644 --- a/tests/neg-macros/i6436.scala +++ b/tests/neg-macros/i6436.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def f(sc: quoted.Expr[StringContext]): Unit = { sc match { diff --git a/tests/neg-macros/i6530b.scala b/tests/neg-macros/i6530b.scala index 93462b2e302f..efc7eb5dd73c 100644 --- a/tests/neg-macros/i6530b.scala +++ b/tests/neg-macros/i6530b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { def program(using Quotes) = '{ val tpe: quoted.Type[Int] = ??? diff --git a/tests/neg-macros/i6622f.scala b/tests/neg-macros/i6622f.scala index e5d323815e79..edd46f9d66c2 100644 --- a/tests/neg-macros/i6622f.scala +++ b/tests/neg-macros/i6622f.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object Test { diff --git a/tests/neg-macros/i6739.scala b/tests/neg-macros/i6739.scala index c1a749c04fd6..2eb60cadb3ed 100644 --- a/tests/neg-macros/i6739.scala +++ b/tests/neg-macros/i6739.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def assert(expr: => Boolean): Unit = ${ assertImpl('expr) } // error: Macro cannot be implemented with an `inline` method diff --git a/tests/neg-macros/i6762.scala b/tests/neg-macros/i6762.scala index c5f1fb7c86b3..a8df289b26c2 100644 --- a/tests/neg-macros/i6762.scala +++ b/tests/neg-macros/i6762.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* type G[X] case class Foo[T](x: T) diff --git a/tests/neg-macros/i6783.scala b/tests/neg-macros/i6783.scala index 10d2e796e669..9b644cb088aa 100644 --- a/tests/neg-macros/i6783.scala +++ b/tests/neg-macros/i6783.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def test(f: (Int, Int) => Int) = ${ testImpl( diff --git a/tests/neg-macros/i6976/Macro_1.scala b/tests/neg-macros/i6976/Macro_1.scala index c12f9f12fff8..c8b407559f81 100644 --- a/tests/neg-macros/i6976/Macro_1.scala +++ b/tests/neg-macros/i6976/Macro_1.scala @@ -1,12 +1,12 @@ package playground -import scala.quoted._ +import scala.quoted.* object macros { inline def mcr(x: => Any) = ${mcrImpl('x)} def mcrImpl(body: Expr[Any])(using ctx: Quotes) : Expr[Any] = { - import ctx.reflect._ + import ctx.reflect.* body.asTerm match { case Block(_, _) => '{2} } } } diff --git a/tests/neg-macros/i6976/Test_2.scala b/tests/neg-macros/i6976/Test_2.scala index 26247b86e419..c946d2646dff 100644 --- a/tests/neg-macros/i6976/Test_2.scala +++ b/tests/neg-macros/i6976/Test_2.scala @@ -1,5 +1,5 @@ -import playground.macros._ +import playground.macros.* object Test { def main(args: Array[String]): Unit = mcr { 2 } // error diff --git a/tests/neg-macros/i6997.scala b/tests/neg-macros/i6997.scala index b5ed4e9b3ae6..d426d73ebf06 100644 --- a/tests/neg-macros/i6997.scala +++ b/tests/neg-macros/i6997.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* class Foo { def mcrImpl(body: Expr[Any])(using t: Type[_ <: Any])(using ctx: Quotes): Expr[Any] = '{ val tmp = ???.asInstanceOf[t.Underlying] // error // error diff --git a/tests/neg-macros/i6997b.scala b/tests/neg-macros/i6997b.scala index 1726cb1b6473..0ba517d97582 100644 --- a/tests/neg-macros/i6997b.scala +++ b/tests/neg-macros/i6997b.scala @@ -1,6 +1,6 @@ package playground -import scala.quoted._ +import scala.quoted.* inline def mcr(x: => Any): Any = ${mcrImpl('x)} diff --git a/tests/neg-macros/i7013.scala b/tests/neg-macros/i7013.scala index 22cbb307116a..18ba94ca9d36 100644 --- a/tests/neg-macros/i7013.scala +++ b/tests/neg-macros/i7013.scala @@ -1,4 +1,4 @@ -import quoted._ +import quoted.* def foo()(using Quotes) = { class C diff --git a/tests/neg-macros/i7013b.scala b/tests/neg-macros/i7013b.scala index 9ccdfe8e6b4f..ae772770582d 100644 --- a/tests/neg-macros/i7013b.scala +++ b/tests/neg-macros/i7013b.scala @@ -1,4 +1,4 @@ -import quoted._ +import quoted.* class Foo { class Bar diff --git a/tests/neg-macros/i7013c.scala b/tests/neg-macros/i7013c.scala index d7e19653307b..3a58ed3adfe6 100644 --- a/tests/neg-macros/i7013c.scala +++ b/tests/neg-macros/i7013c.scala @@ -1,4 +1,4 @@ -import quoted._ +import quoted.* def foo()(using Quotes) = { type C diff --git a/tests/neg-macros/i7048e.scala b/tests/neg-macros/i7048e.scala index f1f98d221c50..330c444927f0 100644 --- a/tests/neg-macros/i7048e.scala +++ b/tests/neg-macros/i7048e.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* abstract class Test { type T diff --git a/tests/neg-macros/i7052.scala b/tests/neg-macros/i7052.scala index c2d6c021316f..f6ed42c53a2a 100644 --- a/tests/neg-macros/i7052.scala +++ b/tests/neg-macros/i7052.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Test { def foo(str: String)(using Quotes) = '{ @deprecated(str, "") // error diff --git a/tests/neg-macros/i7052b.scala b/tests/neg-macros/i7052b.scala index e60dc57fc05c..b3c0836ce5b8 100644 --- a/tests/neg-macros/i7052b.scala +++ b/tests/neg-macros/i7052b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Test { def foo(str: String)(using Quotes) = '{ val qctx: Quotes = ??? diff --git a/tests/neg-macros/i7121.scala b/tests/neg-macros/i7121.scala index 5a0a3852e70f..e6d47fb23482 100644 --- a/tests/neg-macros/i7121.scala +++ b/tests/neg-macros/i7121.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class annot1[T](x: Expr[T]) extends scala.annotation.Annotation class annot2[T: Type](x: T) extends scala.annotation.Annotation diff --git a/tests/neg-macros/i7142/Macro_1.scala b/tests/neg-macros/i7142/Macro_1.scala index 3bb81b5d6d1e..282c18c8cdb0 100644 --- a/tests/neg-macros/i7142/Macro_1.scala +++ b/tests/neg-macros/i7142/Macro_1.scala @@ -1,5 +1,5 @@ package macros -import scala.quoted._ +import scala.quoted.* def oops(using Quotes) = { var v = '{0}; diff --git a/tests/neg-macros/i7142b/Macro_1.scala b/tests/neg-macros/i7142b/Macro_1.scala index 677dcb3acf5e..49b5c854dd13 100644 --- a/tests/neg-macros/i7142b/Macro_1.scala +++ b/tests/neg-macros/i7142b/Macro_1.scala @@ -1,6 +1,6 @@ package macros -import scala.quoted._ -import scala.util.control.NonLocalReturns._ +import scala.quoted.* +import scala.util.control.NonLocalReturns.* def oops(using Quotes): Expr[Int] = returning('{ { (x: Int) => ${ throwReturn('x) }} apply 0 }) diff --git a/tests/neg-macros/i7142c/Macro_1.scala b/tests/neg-macros/i7142c/Macro_1.scala index a16eb6b6f3ef..8e8ff862f1aa 100644 --- a/tests/neg-macros/i7142c/Macro_1.scala +++ b/tests/neg-macros/i7142c/Macro_1.scala @@ -1,5 +1,5 @@ package macros -import scala.quoted._ +import scala.quoted.* def oops(using Quotes) = { var v = '{0}; diff --git a/tests/neg-macros/i7142d/Macro_1.scala b/tests/neg-macros/i7142d/Macro_1.scala index 579a12da8d77..56c3844af1f6 100644 --- a/tests/neg-macros/i7142d/Macro_1.scala +++ b/tests/neg-macros/i7142d/Macro_1.scala @@ -1,5 +1,5 @@ package macros -import scala.quoted._ +import scala.quoted.* def oops(using Quotes) = { var v = '{0}; diff --git a/tests/neg-macros/i7142e/Macro_1.scala b/tests/neg-macros/i7142e/Macro_1.scala index 119340dd3d70..c29fddfacd92 100644 --- a/tests/neg-macros/i7142e/Macro_1.scala +++ b/tests/neg-macros/i7142e/Macro_1.scala @@ -1,5 +1,5 @@ package macros -import scala.quoted._ +import scala.quoted.* def oops(using Quotes) = { var v = '{0}; diff --git a/tests/neg-macros/i7142f/Macro_1.scala b/tests/neg-macros/i7142f/Macro_1.scala index 137618e6c15b..8ff86a0da424 100644 --- a/tests/neg-macros/i7142f/Macro_1.scala +++ b/tests/neg-macros/i7142f/Macro_1.scala @@ -1,5 +1,5 @@ package macros -import scala.quoted._ +import scala.quoted.* def oops(using Quotes) = { var v = '{0}; diff --git a/tests/neg-macros/i7142g/Macro_1.scala b/tests/neg-macros/i7142g/Macro_1.scala index 67fdef81a4ba..c6cec2d01046 100644 --- a/tests/neg-macros/i7142g/Macro_1.scala +++ b/tests/neg-macros/i7142g/Macro_1.scala @@ -1,5 +1,5 @@ package macros -import scala.quoted._ +import scala.quoted.* def oops(using Quotes) = { var v = '{}; diff --git a/tests/neg-macros/i7142h/Macro_1.scala b/tests/neg-macros/i7142h/Macro_1.scala index e61b8788266e..77dabfceb181 100644 --- a/tests/neg-macros/i7142h/Macro_1.scala +++ b/tests/neg-macros/i7142h/Macro_1.scala @@ -1,5 +1,5 @@ package macros -import scala.quoted._ +import scala.quoted.* var saved = Option.empty[Expr[Int]] diff --git a/tests/neg-macros/i7264d.scala b/tests/neg-macros/i7264d.scala index 457709de6c58..ee3cecad9214 100644 --- a/tests/neg-macros/i7264d.scala +++ b/tests/neg-macros/i7264d.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { def f[T2: Type](e: Expr[T2])(using Quotes) = e match { case '{ $x: *:[Int, Any] } => // error: Type argument Any does not conform to upper bound Tuple diff --git a/tests/neg-macros/i7603.scala b/tests/neg-macros/i7603.scala index cb430b648963..c781513fb1ba 100644 --- a/tests/neg-macros/i7603.scala +++ b/tests/neg-macros/i7603.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { def f[T2: Type](e: Expr[T2])(using Quotes) = e match { case '{ $x: ${'[List[$t]]} } => // error diff --git a/tests/neg-macros/i7618.scala b/tests/neg-macros/i7618.scala index 3c28caf68564..0a3056c9d825 100644 --- a/tests/neg-macros/i7618.scala +++ b/tests/neg-macros/i7618.scala @@ -1,6 +1,6 @@ package macros -import scala.quoted._ +import scala.quoted.* enum Exp { case Num(n: Int) @@ -10,7 +10,7 @@ enum Exp { } object Compiler { - import Exp._ + import Exp.* inline def compile(e: Exp, env: Map[String, Expr[Int]])(using ctx: Quotes): Expr[Int] = inline e match { case Num(n) => @@ -26,11 +26,11 @@ object Compiler { object Example { def run(): Unit = { - import Exp._ + import Exp.* val exp = Plus(Plus(Num(2), Var("x")), Num(4)) val letExp = Let("x", Num(3), exp) - Compiler.compile(letExp, Map.empty)(using Quotes.macroContext) // error // error + Compiler.compile(letExp, Map.empty)(using Quotes.macroContext) // error } } diff --git a/tests/neg-macros/i7618b.scala b/tests/neg-macros/i7618b.scala index 817618a54810..770001073272 100644 --- a/tests/neg-macros/i7618b.scala +++ b/tests/neg-macros/i7618b.scala @@ -1,6 +1,6 @@ package macros -import scala.quoted._ +import scala.quoted.* enum Exp { case Num(n: Int) @@ -10,7 +10,7 @@ enum Exp { } object Compiler { - import Exp._ + import Exp.* inline def compile(e: Exp, env: Map[String, Expr[Int]])(using ctx: Quotes): Expr[Int] = inline e match { case Num(n) => @@ -26,7 +26,7 @@ object Compiler { object Example { def run(): Unit = { - import Exp._ + import Exp.* val exp = Plus(Plus(Num(2), Var("x")), Num(4)) val letExp = Let("x", Num(3), exp) diff --git a/tests/neg-macros/i7698.scala b/tests/neg-macros/i7698.scala index b6d3c8817871..5031e47ab198 100644 --- a/tests/neg-macros/i7698.scala +++ b/tests/neg-macros/i7698.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* trait Show[T] { def show(x: T): String } def showInterpolatorImpl(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using Quotes): Expr[String] = - import quotes.reflect._ + import quotes.reflect.* argsExpr.asTerm match case '{ $arg: $t } => // error case '[ Int ] => // error diff --git a/tests/neg-macros/i7839.scala b/tests/neg-macros/i7839.scala index d353f2e633bc..9c7fa295fc35 100644 --- a/tests/neg-macros/i7839.scala +++ b/tests/neg-macros/i7839.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def transform(using dummyImplicit: DummyImplicit): Unit = ${ transformImpl } // error diff --git a/tests/neg-macros/i7892.scala b/tests/neg-macros/i7892.scala index b4f3e5fc9441..1ec8fef16ded 100644 --- a/tests/neg-macros/i7892.scala +++ b/tests/neg-macros/i7892.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* package x { class CExprResult1[T] diff --git a/tests/neg-macros/i7919.scala b/tests/neg-macros/i7919.scala index 790a2a37e727..e68965fc614f 100644 --- a/tests/neg-macros/i7919.scala +++ b/tests/neg-macros/i7919.scala @@ -1,8 +1,8 @@ -import scala.quoted._ +import scala.quoted.* object Test { def staged[T](using Quotes) = { - import quotes.reflect._ + import quotes.reflect.* given typeT: Type[T] with {} // error val tt = TypeRepr.of[T] '{ "in staged" } diff --git a/tests/neg-macros/i8045.scala b/tests/neg-macros/i8045.scala index 66f16d57849d..013a2b3205dd 100644 --- a/tests/neg-macros/i8045.scala +++ b/tests/neg-macros/i8045.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test def run(using Quotes)(tree: quotes.reflect.Tree): Unit = '{ ${ makeExpr(tree) } + 1 } // error diff --git a/tests/neg-macros/i8045b.scala b/tests/neg-macros/i8045b.scala index dd03479788a2..9ca0cbf5a62a 100644 --- a/tests/neg-macros/i8045b.scala +++ b/tests/neg-macros/i8045b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test def run(using q: Quotes)(tree: q.reflect.Tree): Unit = def nested()(using q.Nested): Expr[Int] = diff --git a/tests/neg-macros/i8052.scala b/tests/neg-macros/i8052.scala index d73cbacd6bfe..a22251ed54f5 100644 --- a/tests/neg-macros/i8052.scala +++ b/tests/neg-macros/i8052.scala @@ -1,5 +1,5 @@ -import scala.deriving._ -import scala.quoted._ +import scala.deriving.* +import scala.quoted.* object Macro2 { diff --git a/tests/neg-macros/i8749.scala b/tests/neg-macros/i8749.scala index 591a6809e268..25c9579e1d90 100644 --- a/tests/neg-macros/i8749.scala +++ b/tests/neg-macros/i8749.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object FunObject { def fun(t: String => String) = t diff --git a/tests/neg-macros/i8865.scala b/tests/neg-macros/i8865.scala index 990cbd2cdb30..7bf3f9532d10 100644 --- a/tests/neg-macros/i8865.scala +++ b/tests/neg-macros/i8865.scala @@ -1,8 +1,8 @@ -import scala.quoted._ +import scala.quoted.* object Macro { def impl[A : Type](using Quotes): Expr[A] = { - import quotes.reflect._ + import quotes.reflect.* val tpe = TypeRepr.of[A].asType '{ (a: ${tpe}) => ???} // error: tpe.Underlying cannot be used as a value type '{???} diff --git a/tests/neg-macros/i8871.scala b/tests/neg-macros/i8871.scala index e37767979288..4956061d45fa 100644 --- a/tests/neg-macros/i8871.scala +++ b/tests/neg-macros/i8871.scala @@ -1,7 +1,7 @@ -import scala.quoted._ +import scala.quoted.* object Macro { def impl[A : Type](using Quotes): Unit = { - import quotes.reflect._ + import quotes.reflect.* val tpe = TypeRepr.of[A].asType.asInstanceOf[Type[_ <: AnyRef]] '{ (a: ${tpe}) => ???} // error } diff --git a/tests/neg-macros/i8871b.scala b/tests/neg-macros/i8871b.scala index 0d4a2ad5590e..be243a8e651b 100644 --- a/tests/neg-macros/i8871b.scala +++ b/tests/neg-macros/i8871b.scala @@ -1,7 +1,7 @@ -import scala.quoted._ +import scala.quoted.* object Macro { def impl[A : Type](using Quotes) = { - import quotes.reflect._ + import quotes.reflect.* val tpe/*: Type[? <: AnyKind]*/ = TypeRepr.of[A].asType '{ f[$tpe] } // error } diff --git a/tests/neg-macros/i9014.check b/tests/neg-macros/i9014.check index be338d620c60..509eac067fc8 100644 --- a/tests/neg-macros/i9014.check +++ b/tests/neg-macros/i9014.check @@ -2,9 +2,5 @@ -- Error: tests/neg-macros/i9014/Test_2.scala:1:23 --------------------------------------------------------------------- 1 |val tests = summon[Bar] // error | ^ - | no implicit argument of type Bar was found for parameter x of method summon in object Predef. - | I found: - | - | given_Bar - | - | But given instance given_Bar does not match type Bar. + | Failed to expand! + | This location contains code that was inlined from Test_2.scala:1 diff --git a/tests/neg-macros/i9014/Macros_1.scala b/tests/neg-macros/i9014/Macros_1.scala index 599214e3bfc2..3bca2bae4dc3 100644 --- a/tests/neg-macros/i9014/Macros_1.scala +++ b/tests/neg-macros/i9014/Macros_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* trait Bar inline given Bar = ${ impl } def impl(using Quotes): Expr[Bar] = quotes.reflect.report.throwError("Failed to expand!") diff --git a/tests/neg-macros/i9014b.check b/tests/neg-macros/i9014b.check new file mode 100644 index 000000000000..a7250b66fd95 --- /dev/null +++ b/tests/neg-macros/i9014b.check @@ -0,0 +1,10 @@ + +-- Error: tests/neg-macros/i9014b/Test_2.scala:1:23 -------------------------------------------------------------------- +1 |val tests = summon[Bar] // error + | ^ + | no implicit argument of type Bar was found for parameter x of method summon in object Predef. + | I found: + | + | given_Bar + | + | But given instance given_Bar does not match type Bar. diff --git a/tests/neg-macros/i9014b/Macros_1.scala b/tests/neg-macros/i9014b/Macros_1.scala new file mode 100644 index 000000000000..0dcb45d513cb --- /dev/null +++ b/tests/neg-macros/i9014b/Macros_1.scala @@ -0,0 +1,4 @@ +import scala.quoted._ +trait Bar +transparent inline given Bar = ${ impl } +def impl(using Quotes): Expr[Bar] = quotes.reflect.report.throwError("Failed to expand!") diff --git a/tests/neg-macros/i9014b/Test_2.scala b/tests/neg-macros/i9014b/Test_2.scala new file mode 100644 index 000000000000..b23781947922 --- /dev/null +++ b/tests/neg-macros/i9014b/Test_2.scala @@ -0,0 +1 @@ +val tests = summon[Bar] // error diff --git a/tests/neg-macros/i9801/Macro_1.scala b/tests/neg-macros/i9801/Macro_1.scala index 1d544c66e64f..8308e2bf71e0 100644 --- a/tests/neg-macros/i9801/Macro_1.scala +++ b/tests/neg-macros/i9801/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def f() = () @@ -11,7 +11,7 @@ def triggerStackOverflow(n: Int): Expr[Double] = { inline def loop(inline prog: Double): Double = ${impl('prog)} def impl(prog: Expr[Double])(using Quotes) : Expr[Double] = - import quotes.reflect._ + import quotes.reflect.* try { triggerStackOverflow(0) } catch { diff --git a/tests/neg-macros/i9801b/Macro_1.scala b/tests/neg-macros/i9801b/Macro_1.scala index caaeb1ee251b..bb1272f18d30 100644 --- a/tests/neg-macros/i9801b/Macro_1.scala +++ b/tests/neg-macros/i9801b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def f() = () diff --git a/tests/neg-macros/i9972/Test_2.scala b/tests/neg-macros/i9972/Test_2.scala index 15599c80538f..70a031781f0b 100644 --- a/tests/neg-macros/i9972/Test_2.scala +++ b/tests/neg-macros/i9972/Test_2.scala @@ -1,6 +1,6 @@ package notmacro -import scala.quoted._ +import scala.quoted.* case class T[A <: AnyKind](s: String) diff --git a/tests/neg-macros/inline-macro-staged-interpreter/Macro_1.scala b/tests/neg-macros/inline-macro-staged-interpreter/Macro_1.scala index 038fab2d88b6..4e56b946207a 100644 --- a/tests/neg-macros/inline-macro-staged-interpreter/Macro_1.scala +++ b/tests/neg-macros/inline-macro-staged-interpreter/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object E { diff --git a/tests/neg-macros/inline-option/Macro_1.scala b/tests/neg-macros/inline-option/Macro_1.scala index 53754d5629ce..f2e3e453fdd2 100644 --- a/tests/neg-macros/inline-option/Macro_1.scala +++ b/tests/neg-macros/inline-option/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Macro { def impl(opt: Expr[Option[Int]]) (using Quotes): Expr[Int] = opt.valueOrError match { diff --git a/tests/neg-macros/inline-quote.scala b/tests/neg-macros/inline-quote.scala index 57e97cd1ab22..9b86864f0f3c 100644 --- a/tests/neg-macros/inline-quote.scala +++ b/tests/neg-macros/inline-quote.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { diff --git a/tests/neg-macros/inline-tuples-1/Macro_1.scala b/tests/neg-macros/inline-tuples-1/Macro_1.scala index 76ba8fcb0dc0..031fb01cabe4 100644 --- a/tests/neg-macros/inline-tuples-1/Macro_1.scala +++ b/tests/neg-macros/inline-tuples-1/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Macros { def tup1(tup: Expr[Tuple1[Int]]) (using Quotes): Expr[Int] = Expr(tup.valueOrError.productIterator.map(_.asInstanceOf[Int]).sum) diff --git a/tests/neg-macros/macro-class-not-found-1/Bar.scala b/tests/neg-macros/macro-class-not-found-1/Bar.scala index df9d90619500..feaa28c80115 100644 --- a/tests/neg-macros/macro-class-not-found-1/Bar.scala +++ b/tests/neg-macros/macro-class-not-found-1/Bar.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Bar { Foo.myMacro() // error diff --git a/tests/neg-macros/macro-class-not-found-1/Foo.scala b/tests/neg-macros/macro-class-not-found-1/Foo.scala index 554f41549544..8d834194c926 100644 --- a/tests/neg-macros/macro-class-not-found-1/Foo.scala +++ b/tests/neg-macros/macro-class-not-found-1/Foo.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { diff --git a/tests/neg-macros/macro-class-not-found-2/Bar.scala b/tests/neg-macros/macro-class-not-found-2/Bar.scala index df9d90619500..feaa28c80115 100644 --- a/tests/neg-macros/macro-class-not-found-2/Bar.scala +++ b/tests/neg-macros/macro-class-not-found-2/Bar.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Bar { Foo.myMacro() // error diff --git a/tests/neg-macros/macro-class-not-found-2/Foo.scala b/tests/neg-macros/macro-class-not-found-2/Foo.scala index 930eb7c56ed5..af56938ebf5b 100644 --- a/tests/neg-macros/macro-class-not-found-2/Foo.scala +++ b/tests/neg-macros/macro-class-not-found-2/Foo.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { diff --git a/tests/neg-macros/macros-in-same-project-1.scala b/tests/neg-macros/macros-in-same-project-1.scala index 4291d1738eb1..b3b9d29b0ac7 100644 --- a/tests/neg-macros/macros-in-same-project-1.scala +++ b/tests/neg-macros/macros-in-same-project-1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Bar { diff --git a/tests/neg-macros/macros-in-same-project-2.scala b/tests/neg-macros/macros-in-same-project-2.scala index 14b8ffc17773..60a42a090208 100644 --- a/tests/neg-macros/macros-in-same-project-2.scala +++ b/tests/neg-macros/macros-in-same-project-2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Bar { diff --git a/tests/neg-macros/macros-in-same-project-4/Bar.scala b/tests/neg-macros/macros-in-same-project-4/Bar.scala index 7e27c915b791..9e039e2ae4d1 100644 --- a/tests/neg-macros/macros-in-same-project-4/Bar.scala +++ b/tests/neg-macros/macros-in-same-project-4/Bar.scala @@ -1,5 +1,5 @@ // nopos-error -import scala.quoted._ +import scala.quoted.* object Bar { diff --git a/tests/neg-macros/macros-in-same-project-4/Foo.scala b/tests/neg-macros/macros-in-same-project-4/Foo.scala index ab32b37e1e2f..5c60fb7e387b 100644 --- a/tests/neg-macros/macros-in-same-project-4/Foo.scala +++ b/tests/neg-macros/macros-in-same-project-4/Foo.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { diff --git a/tests/neg-macros/macros-in-same-project-5/Bar.scala b/tests/neg-macros/macros-in-same-project-5/Bar.scala index adba4358f853..92cb1eb4e373 100644 --- a/tests/neg-macros/macros-in-same-project-5/Bar.scala +++ b/tests/neg-macros/macros-in-same-project-5/Bar.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Bar { diff --git a/tests/neg-macros/macros-in-same-project-5/Foo.scala b/tests/neg-macros/macros-in-same-project-5/Foo.scala index b50e017cc1c5..f3d446b85575 100644 --- a/tests/neg-macros/macros-in-same-project-5/Foo.scala +++ b/tests/neg-macros/macros-in-same-project-5/Foo.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import Bar.aMacroImplementation object Foo { diff --git a/tests/neg-macros/macros-in-same-project-6/Bar.scala b/tests/neg-macros/macros-in-same-project-6/Bar.scala index df9d90619500..feaa28c80115 100644 --- a/tests/neg-macros/macros-in-same-project-6/Bar.scala +++ b/tests/neg-macros/macros-in-same-project-6/Bar.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Bar { Foo.myMacro() // error diff --git a/tests/neg-macros/macros-in-same-project-6/Foo.scala b/tests/neg-macros/macros-in-same-project-6/Foo.scala index e538f2aff51d..251d7b1ddbda 100644 --- a/tests/neg-macros/macros-in-same-project-6/Foo.scala +++ b/tests/neg-macros/macros-in-same-project-6/Foo.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Foo { inline def myMacro(): Unit = ${ aMacroImplementation } def aMacroImplementation(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* report.error("some error", Position.ofMacroExpansion) throw new NoClassDefFoundError("Bar$") } diff --git a/tests/neg-macros/old-inline-param-macro.scala b/tests/neg-macros/old-inline-param-macro.scala index 95582fc60483..ed3daad6bde8 100644 --- a/tests/neg-macros/old-inline-param-macro.scala +++ b/tests/neg-macros/old-inline-param-macro.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def old(inline x: Int): Int = ${ oldImpl(x) } // error diff --git a/tests/neg-macros/quote-0.scala b/tests/neg-macros/quote-0.scala index 022eb5e5b3af..a4e7ef041394 100644 --- a/tests/neg-macros/quote-0.scala +++ b/tests/neg-macros/quote-0.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def test(using Quotes) = { diff --git a/tests/neg-macros/quote-1.scala b/tests/neg-macros/quote-1.scala index daabf4f00bc3..4b5efb3017e1 100644 --- a/tests/neg-macros/quote-1.scala +++ b/tests/neg-macros/quote-1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Test { diff --git a/tests/neg-macros/quote-complex-top-splice.scala b/tests/neg-macros/quote-complex-top-splice.scala index baa412174774..609e7eff5081 100644 --- a/tests/neg-macros/quote-complex-top-splice.scala +++ b/tests/neg-macros/quote-complex-top-splice.scala @@ -1,6 +1,6 @@ import Test.impl -import scala.quoted._ +import scala.quoted.* object Test { diff --git a/tests/neg-macros/quote-error-2/Macro_1.scala b/tests/neg-macros/quote-error-2/Macro_1.scala index 103780f321a4..7a98d7145698 100644 --- a/tests/neg-macros/quote-error-2/Macro_1.scala +++ b/tests/neg-macros/quote-error-2/Macro_1.scala @@ -1,4 +1,4 @@ -import quoted._ +import quoted.* object Macro_1 { inline def foo(inline b: Boolean): Unit = ${ fooImpl('b) } diff --git a/tests/neg-macros/quote-error-2/Test_2.scala b/tests/neg-macros/quote-error-2/Test_2.scala index fccefeaad1f3..f2beaffe8729 100644 --- a/tests/neg-macros/quote-error-2/Test_2.scala +++ b/tests/neg-macros/quote-error-2/Test_2.scala @@ -1,4 +1,4 @@ -import Macro_1._ +import Macro_1.* object Test_2 { foo(true) diff --git a/tests/neg-macros/quote-error/Macro_1.scala b/tests/neg-macros/quote-error/Macro_1.scala index 967257130303..668f2b99c33b 100644 --- a/tests/neg-macros/quote-error/Macro_1.scala +++ b/tests/neg-macros/quote-error/Macro_1.scala @@ -1,4 +1,4 @@ -import quoted._ +import quoted.* object Macro_1 { inline def foo(inline b: Boolean): Unit = ${fooImpl('b)} diff --git a/tests/neg-macros/quote-error/Test_2.scala b/tests/neg-macros/quote-error/Test_2.scala index fccefeaad1f3..f2beaffe8729 100644 --- a/tests/neg-macros/quote-error/Test_2.scala +++ b/tests/neg-macros/quote-error/Test_2.scala @@ -1,4 +1,4 @@ -import Macro_1._ +import Macro_1.* object Test_2 { foo(true) diff --git a/tests/neg-macros/quote-exception/Macro_1.scala b/tests/neg-macros/quote-exception/Macro_1.scala index c2d1287aea0f..2fa482a81c56 100644 --- a/tests/neg-macros/quote-exception/Macro_1.scala +++ b/tests/neg-macros/quote-exception/Macro_1.scala @@ -1,4 +1,4 @@ -import quoted._ +import quoted.* object Macro_1 { inline def foo(inline b: Boolean): Unit = ${fooImpl('b)} diff --git a/tests/neg-macros/quote-exception/Test_2.scala b/tests/neg-macros/quote-exception/Test_2.scala index 5512cd78d6d9..6ec5c6d1ed89 100644 --- a/tests/neg-macros/quote-exception/Test_2.scala +++ b/tests/neg-macros/quote-exception/Test_2.scala @@ -1,4 +1,4 @@ -import Macro_1._ +import Macro_1.* object Test_2 { foo(true) diff --git a/tests/neg-macros/quote-interpolator-core-old.scala b/tests/neg-macros/quote-interpolator-core-old.scala index cd613c584ede..cf14141febce 100644 --- a/tests/neg-macros/quote-interpolator-core-old.scala +++ b/tests/neg-macros/quote-interpolator-core-old.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* // This test checks the correct interpretation of the inlined value class diff --git a/tests/neg-macros/quote-macro-2-splices.scala b/tests/neg-macros/quote-macro-2-splices.scala index 1b25ecce07c9..9fd2a0735c82 100644 --- a/tests/neg-macros/quote-macro-2-splices.scala +++ b/tests/neg-macros/quote-macro-2-splices.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/neg-macros/quote-macro-complex-arg-0.scala b/tests/neg-macros/quote-macro-complex-arg-0.scala index da11de825897..d7be7bb692a1 100644 --- a/tests/neg-macros/quote-macro-complex-arg-0.scala +++ b/tests/neg-macros/quote-macro-complex-arg-0.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def foo(inline i: Int, dummy: Int, j: Int): Int = ${ bar(i + 1, 'j) } // error: i + 1 is not a parameter or field reference diff --git a/tests/neg-macros/quote-macro-splice.scala b/tests/neg-macros/quote-macro-splice.scala index 01f85825d4ed..f67d1b66ae39 100644 --- a/tests/neg-macros/quote-macro-splice.scala +++ b/tests/neg-macros/quote-macro-splice.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { diff --git a/tests/neg-macros/quote-open-patterns-stages.scala b/tests/neg-macros/quote-open-patterns-stages.scala index 7adf28174bd1..da4459be865c 100644 --- a/tests/neg-macros/quote-open-patterns-stages.scala +++ b/tests/neg-macros/quote-open-patterns-stages.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def f(using Quotes)(x: Expr[Any]) = x match { case '{ identity($y(x)) } => // error: access to value x from wrong staging level diff --git a/tests/neg-macros/quote-open-patterns-typer.scala b/tests/neg-macros/quote-open-patterns-typer.scala index 4380aa9fb4ff..066b34d4925b 100644 --- a/tests/neg-macros/quote-open-patterns-typer.scala +++ b/tests/neg-macros/quote-open-patterns-typer.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def f(using Quotes)(x: Expr[Any]) = x match { case '{ val a: Int = 3; $y(identity(a)) } => // error: Exprected an identifier diff --git a/tests/neg-macros/quote-pattern-implemnetation-restrictions.scala b/tests/neg-macros/quote-pattern-implemnetation-restrictions.scala index 88876cc7d922..d05f2030cd7d 100644 --- a/tests/neg-macros/quote-pattern-implemnetation-restrictions.scala +++ b/tests/neg-macros/quote-pattern-implemnetation-restrictions.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def f(x: Expr[Any])(using Quotes) = x match { diff --git a/tests/neg-macros/quote-pcp-in-arg.scala b/tests/neg-macros/quote-pcp-in-arg.scala index d864e84272c1..333527867e3a 100644 --- a/tests/neg-macros/quote-pcp-in-arg.scala +++ b/tests/neg-macros/quote-pcp-in-arg.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { inline def foo(x: Int): Int = ${ bar('{ 'x; x }) } // error diff --git a/tests/neg-macros/quote-splice-interpret-1.scala b/tests/neg-macros/quote-splice-interpret-1.scala index 72507b281215..8811b6f66e84 100644 --- a/tests/neg-macros/quote-splice-interpret-1.scala +++ b/tests/neg-macros/quote-splice-interpret-1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def isZero(inline n: Int): Boolean = ${ diff --git a/tests/neg-macros/quote-spliceNonStaged.scala b/tests/neg-macros/quote-spliceNonStaged.scala index ac5e9a4696bc..3cfecde2b8a4 100644 --- a/tests/neg-macros/quote-spliceNonStaged.scala +++ b/tests/neg-macros/quote-spliceNonStaged.scala @@ -1,5 +1,5 @@ package quotes -import scala.quoted._ +import scala.quoted.* object Quotes_1 { def printHello(using Quotes): Expr[Unit] = '{ println("Hello") } diff --git a/tests/neg-macros/quote-this-a.scala b/tests/neg-macros/quote-this-a.scala index 7a41fbbc612e..11621176526b 100644 --- a/tests/neg-macros/quote-this-a.scala +++ b/tests/neg-macros/quote-this-a.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { diff --git a/tests/neg-macros/quote-this-b.scala b/tests/neg-macros/quote-this-b.scala index 14f47c4b3735..9efaa4813eef 100644 --- a/tests/neg-macros/quote-this-b.scala +++ b/tests/neg-macros/quote-this-b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { inline def k(): Unit = ${ Foo.impl[Any](this) } // error diff --git a/tests/neg-macros/quote-this-c.scala b/tests/neg-macros/quote-this-c.scala index fb842a7aba70..ac3e457049f7 100644 --- a/tests/neg-macros/quote-this-c.scala +++ b/tests/neg-macros/quote-this-c.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { diff --git a/tests/neg-macros/quote-whitebox/Macro_1.scala b/tests/neg-macros/quote-whitebox/Macro_1.scala index 273e755426a2..a18fccbc166e 100644 --- a/tests/neg-macros/quote-whitebox/Macro_1.scala +++ b/tests/neg-macros/quote-whitebox/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { transparent inline def defaultOf(inline str: String): Any = ${ defaultOfImpl('str) } diff --git a/tests/neg-macros/quote-whitebox/Test_2.scala b/tests/neg-macros/quote-whitebox/Test_2.scala index 984e741af216..7b00dbfde325 100644 --- a/tests/neg-macros/quote-whitebox/Test_2.scala +++ b/tests/neg-macros/quote-whitebox/Test_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/neg-macros/quotedPatterns-5.scala b/tests/neg-macros/quotedPatterns-5.scala index 6d474fa3e338..4030604d19f5 100644 --- a/tests/neg-macros/quotedPatterns-5.scala +++ b/tests/neg-macros/quotedPatterns-5.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { def test(x: quoted.Expr[Int])(using Quotes): Unit = x match { case '{ type t; 4 } => Type.of[t] diff --git a/tests/neg-macros/quotedPatterns-6.scala b/tests/neg-macros/quotedPatterns-6.scala index 0ee7581732a5..b31662db8aa2 100644 --- a/tests/neg-macros/quotedPatterns-6.scala +++ b/tests/neg-macros/quotedPatterns-6.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { def test(x: quoted.Expr[Int])(using Quotes) = x match { case '{ poly[${Foo(t)}]($x); 4 } => ??? // error diff --git a/tests/neg-macros/reflect-inline/assert_1.scala b/tests/neg-macros/reflect-inline/assert_1.scala index 32abbfe3ea17..2c5b324450c5 100644 --- a/tests/neg-macros/reflect-inline/assert_1.scala +++ b/tests/neg-macros/reflect-inline/assert_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object api { extension (inline x: String) inline def stripMargin2: String = diff --git a/tests/neg-macros/reflect-inline/test_2.scala b/tests/neg-macros/reflect-inline/test_2.scala index 0be48280e8ec..687151a88c49 100644 --- a/tests/neg-macros/reflect-inline/test_2.scala +++ b/tests/neg-macros/reflect-inline/test_2.scala @@ -1,4 +1,4 @@ -import api._ +import api.* class Test { val a: String = "5" diff --git a/tests/neg-macros/splice-in-top-level-splice-1.scala b/tests/neg-macros/splice-in-top-level-splice-1.scala index 63c503caeeb3..a80617a64252 100644 --- a/tests/neg-macros/splice-in-top-level-splice-1.scala +++ b/tests/neg-macros/splice-in-top-level-splice-1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { inline def foo(): Int = ${bar(${x})} // error diff --git a/tests/neg-macros/splice-in-top-level-splice-2.scala b/tests/neg-macros/splice-in-top-level-splice-2.scala index 33bb3fddcdc1..2e395f59135b 100644 --- a/tests/neg-macros/splice-in-top-level-splice-2.scala +++ b/tests/neg-macros/splice-in-top-level-splice-2.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { inline def foo(): Int = ${$x} // error diff --git a/tests/neg-macros/splice-non-expr.scala b/tests/neg-macros/splice-non-expr.scala index 3f9b32642415..faa1be467f2c 100644 --- a/tests/neg-macros/splice-non-expr.scala +++ b/tests/neg-macros/splice-non-expr.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { def test(using Quotes) = '{ ${3} // error diff --git a/tests/neg-macros/tasty-macro-assert-1/quoted_1.scala b/tests/neg-macros/tasty-macro-assert-1/quoted_1.scala index 4eab8e37bfb2..218135527127 100644 --- a/tests/neg-macros/tasty-macro-assert-1/quoted_1.scala +++ b/tests/neg-macros/tasty-macro-assert-1/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Asserts { @@ -13,7 +13,7 @@ object Asserts { ${impl('cond)} def impl(cond: Expr[Boolean])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val tree = cond.asTerm diff --git a/tests/neg-macros/tasty-macro-assert-1/quoted_2.scala b/tests/neg-macros/tasty-macro-assert-1/quoted_2.scala index 25ef0291b120..516166f60f83 100644 --- a/tests/neg-macros/tasty-macro-assert-1/quoted_2.scala +++ b/tests/neg-macros/tasty-macro-assert-1/quoted_2.scala @@ -1,5 +1,5 @@ -import Asserts._ +import Asserts.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/neg-macros/tasty-macro-assert-2/quoted_1.scala b/tests/neg-macros/tasty-macro-assert-2/quoted_1.scala index ecf291b973da..d29c62b4b3af 100644 --- a/tests/neg-macros/tasty-macro-assert-2/quoted_1.scala +++ b/tests/neg-macros/tasty-macro-assert-2/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Asserts { @@ -13,7 +13,7 @@ object Asserts { ${ impl('cond) } def impl(cond: Expr[Boolean])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val tree = cond.asTerm diff --git a/tests/neg-macros/tasty-macro-assert-2/quoted_2.scala b/tests/neg-macros/tasty-macro-assert-2/quoted_2.scala index b43e3cc84dde..72f870d18673 100644 --- a/tests/neg-macros/tasty-macro-assert-2/quoted_2.scala +++ b/tests/neg-macros/tasty-macro-assert-2/quoted_2.scala @@ -1,5 +1,5 @@ -import Asserts._ +import Asserts.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/neg-macros/tasty-macro-error/quoted_1.scala b/tests/neg-macros/tasty-macro-error/quoted_1.scala index 74478c7bd5a6..b395ec4c240b 100644 --- a/tests/neg-macros/tasty-macro-error/quoted_1.scala +++ b/tests/neg-macros/tasty-macro-error/quoted_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def fun(x: Any): Unit = ${ impl('x) } def impl(x: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* report.error("here is the the argument is " + x.asTerm.underlyingArgument.show, x.asTerm.underlyingArgument.pos) '{} } diff --git a/tests/neg-macros/tasty-macro-error/quoted_2.scala b/tests/neg-macros/tasty-macro-error/quoted_2.scala index a79636e8e51d..b7874493752c 100644 --- a/tests/neg-macros/tasty-macro-error/quoted_2.scala +++ b/tests/neg-macros/tasty-macro-error/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/neg-macros/tasty-macro-positions/quoted_1.scala b/tests/neg-macros/tasty-macro-positions/quoted_1.scala index 01917a3f1011..b77373baa21c 100644 --- a/tests/neg-macros/tasty-macro-positions/quoted_1.scala +++ b/tests/neg-macros/tasty-macro-positions/quoted_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def fun(x: Any): Unit = ${ impl('x) } def impl(x: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val pos = x.asTerm.underlyingArgument.pos report.error("here is the the argument is " + x.asTerm.underlyingArgument.show, pos) report.error("here (+5) is the the argument is " + x.asTerm.underlyingArgument.show, Position(pos.sourceFile, pos.start + 5, pos.end + 5)) diff --git a/tests/neg-macros/tasty-macro-positions/quoted_2.scala b/tests/neg-macros/tasty-macro-positions/quoted_2.scala index 632a24446cab..033486e85194 100644 --- a/tests/neg-macros/tasty-macro-positions/quoted_2.scala +++ b/tests/neg-macros/tasty-macro-positions/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/neg-macros/tasty-string-interpolator-position-a/Macro_1.scala b/tests/neg-macros/tasty-string-interpolator-position-a/Macro_1.scala index 90cf7e6a441c..88cf424a1ebf 100644 --- a/tests/neg-macros/tasty-string-interpolator-position-a/Macro_1.scala +++ b/tests/neg-macros/tasty-string-interpolator-position-a/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.language.implicitConversions object Macro { @@ -10,7 +10,7 @@ object Macro { object FIntepolator { def apply(strCtxExpr: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* report.error("there are no parts", strCtxExpr.asTerm.underlyingArgument.pos) '{ ($strCtxExpr).s($argsExpr*) } } diff --git a/tests/neg-macros/tasty-string-interpolator-position-a/Test_2.scala b/tests/neg-macros/tasty-string-interpolator-position-a/Test_2.scala index 0b335d55c40c..3307d9994840 100644 --- a/tests/neg-macros/tasty-string-interpolator-position-a/Test_2.scala +++ b/tests/neg-macros/tasty-string-interpolator-position-a/Test_2.scala @@ -1,5 +1,5 @@ -import Macro._ +import Macro.* object Test extends App { diff --git a/tests/neg-macros/tasty-string-interpolator-position-b/Macro_1.scala b/tests/neg-macros/tasty-string-interpolator-position-b/Macro_1.scala index 0ff212d8489e..aac059d06d88 100644 --- a/tests/neg-macros/tasty-string-interpolator-position-b/Macro_1.scala +++ b/tests/neg-macros/tasty-string-interpolator-position-b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.language.implicitConversions object Macro { @@ -9,7 +9,7 @@ object Macro { object FIntepolator { def apply(strCtxExpr: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* report.error("there are no args", argsExpr.asTerm.underlyingArgument.pos) '{ ($strCtxExpr).s($argsExpr*) } } diff --git a/tests/neg-macros/tasty-string-interpolator-position-b/Test_2.scala b/tests/neg-macros/tasty-string-interpolator-position-b/Test_2.scala index 2242deada224..14728911e30d 100644 --- a/tests/neg-macros/tasty-string-interpolator-position-b/Test_2.scala +++ b/tests/neg-macros/tasty-string-interpolator-position-b/Test_2.scala @@ -1,5 +1,5 @@ -import Macro._ +import Macro.* object Test extends App { diff --git a/tests/neg-macros/toexproftuple.scala b/tests/neg-macros/toexproftuple.scala index 13b61d1ad86f..f33bfd5f6dfb 100644 --- a/tests/neg-macros/toexproftuple.scala +++ b/tests/neg-macros/toexproftuple.scala @@ -1,4 +1,4 @@ -import scala.quoted._, scala.deriving._ +import scala.quoted._, scala.deriving.* inline def mcr: Any = ${mcrImpl} def mcrImpl(using ctx: Quotes): Expr[Any] = { diff --git a/tests/neg-macros/type-splice-in-val-pattern.scala b/tests/neg-macros/type-splice-in-val-pattern.scala index 20d16bea9910..7e5e95cb7785 100644 --- a/tests/neg-macros/type-splice-in-val-pattern.scala +++ b/tests/neg-macros/type-splice-in-val-pattern.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { def f(using q: Quotes) = { val t: Type[Int] = ??? diff --git a/tests/neg-scalajs/abstract-local-js-class.scala b/tests/neg-scalajs/abstract-local-js-class.scala index 2d4bebabb048..051e8e3c66e2 100644 --- a/tests/neg-scalajs/abstract-local-js-class.scala +++ b/tests/neg-scalajs/abstract-local-js-class.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object Enclosing { def method(): Unit = { diff --git a/tests/neg-scalajs/internal-annotations.scala b/tests/neg-scalajs/internal-annotations.scala index 82cde0a31f7a..c03334c5d53d 100644 --- a/tests/neg-scalajs/internal-annotations.scala +++ b/tests/neg-scalajs/internal-annotations.scala @@ -1,6 +1,6 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ -import scala.scalajs.js.annotation.internal._ +import scala.scalajs.js.annotation.* +import scala.scalajs.js.annotation.internal.* @JSType trait A // error @JSType class B { // error diff --git a/tests/neg-scalajs/isinstanceof-js-type.scala b/tests/neg-scalajs/isinstanceof-js-type.scala index 15defc52af35..b0d8d130f710 100644 --- a/tests/neg-scalajs/isinstanceof-js-type.scala +++ b/tests/neg-scalajs/isinstanceof-js-type.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native trait NativeJSTrait extends js.Any diff --git a/tests/neg-scalajs/js-case-class-object.scala b/tests/neg-scalajs/js-case-class-object.scala index 62ea3c9852c7..ec96e38d5e9b 100644 --- a/tests/neg-scalajs/js-case-class-object.scala +++ b/tests/neg-scalajs/js-case-class-object.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native @JSGlobal case class A1(x: Int) extends js.Object // error diff --git a/tests/neg-scalajs/js-dynamic-literal.scala b/tests/neg-scalajs/js-dynamic-literal.scala index adab45cefbb1..d7d0010caae5 100644 --- a/tests/neg-scalajs/js-dynamic-literal.scala +++ b/tests/neg-scalajs/js-dynamic-literal.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* import scala.scalajs.js.Dynamic.literal object Test { diff --git a/tests/neg-scalajs/js-enums.scala b/tests/neg-scalajs/js-enums.scala index cf94e690011b..209924971286 100644 --- a/tests/neg-scalajs/js-enums.scala +++ b/tests/neg-scalajs/js-enums.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* enum MyEnum extends js.Object: // error case Foo diff --git a/tests/neg-scalajs/js-members-bad-signatures.scala b/tests/neg-scalajs/js-members-bad-signatures.scala index cb6939d2388d..35020e207681 100644 --- a/tests/neg-scalajs/js-members-bad-signatures.scala +++ b/tests/neg-scalajs/js-members-bad-signatures.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native @JSGlobal diff --git a/tests/neg-scalajs/js-native-call.scala b/tests/neg-scalajs/js-native-call.scala index 07dd3bd0f50e..17b6e5276588 100644 --- a/tests/neg-scalajs/js-native-call.scala +++ b/tests/neg-scalajs/js-native-call.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A { def foo: Int = js.native // error diff --git a/tests/neg-scalajs/js-native-members.scala b/tests/neg-scalajs/js-native-members.scala index 7d45d298e6db..9253fed5db46 100644 --- a/tests/neg-scalajs/js-native-members.scala +++ b/tests/neg-scalajs/js-native-members.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* // rhs must be `js.native` (or calling the primary constructor for constructors) diff --git a/tests/neg-scalajs/js-native-on-scala-type.scala b/tests/neg-scalajs/js-native-on-scala-type.scala index 1177213ff72f..a36d1b503adb 100644 --- a/tests/neg-scalajs/js-native-on-scala-type.scala +++ b/tests/neg-scalajs/js-native-on-scala-type.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* // With the correct amount of native load spec annotations diff --git a/tests/neg-scalajs/js-native-type-wrong-place.scala b/tests/neg-scalajs/js-native-type-wrong-place.scala index 87182ce1da92..8e888a2e2ff0 100644 --- a/tests/neg-scalajs/js-native-type-wrong-place.scala +++ b/tests/neg-scalajs/js-native-type-wrong-place.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* // Nested in Scala class or trait diff --git a/tests/neg-scalajs/js-native-val-def-override.scala b/tests/neg-scalajs/js-native-val-def-override.scala index 6f087e6ec2ec..b29f6e2412dc 100644 --- a/tests/neg-scalajs/js-native-val-def-override.scala +++ b/tests/neg-scalajs/js-native-val-def-override.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* abstract class AbstractParent { val a: Int diff --git a/tests/neg-scalajs/js-native-val-def-wrong-place.scala b/tests/neg-scalajs/js-native-val-def-wrong-place.scala index 3aaded2afcf7..6a772d4dea56 100644 --- a/tests/neg-scalajs/js-native-val-def-wrong-place.scala +++ b/tests/neg-scalajs/js-native-val-def-wrong-place.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object A { val sym = js.Symbol("foo") diff --git a/tests/neg-scalajs/js-native-val-defs.scala b/tests/neg-scalajs/js-native-val-defs.scala index af6be7a3640e..81fb65d09cd8 100644 --- a/tests/neg-scalajs/js-native-val-defs.scala +++ b/tests/neg-scalajs/js-native-val-defs.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* // rhs must be = js.native diff --git a/tests/neg-scalajs/js-native-wrong-kind.scala b/tests/neg-scalajs/js-native-wrong-kind.scala index c11d5e3555de..6f712c1aef32 100644 --- a/tests/neg-scalajs/js-native-wrong-kind.scala +++ b/tests/neg-scalajs/js-native-wrong-kind.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object Container { // setters diff --git a/tests/neg-scalajs/js-non-native-members-overloaded.scala b/tests/neg-scalajs/js-non-native-members-overloaded.scala index bf497d999d95..7f5946509a1a 100644 --- a/tests/neg-scalajs/js-non-native-members-overloaded.scala +++ b/tests/neg-scalajs/js-non-native-members-overloaded.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A extends js.Object { private def foo(i: Int): Int = i // error diff --git a/tests/neg-scalajs/js-non-native-members-qualified-private.scala b/tests/neg-scalajs/js-non-native-members-qualified-private.scala index 2d920fe85afd..d3704a79fb47 100644 --- a/tests/neg-scalajs/js-non-native-members-qualified-private.scala +++ b/tests/neg-scalajs/js-non-native-members-qualified-private.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object Enclosing1 { class A extends js.Object { diff --git a/tests/neg-scalajs/js-non-native-members.scala b/tests/neg-scalajs/js-non-native-members.scala index ceb75ea7c6cb..c2ad81348566 100644 --- a/tests/neg-scalajs/js-non-native-members.scala +++ b/tests/neg-scalajs/js-non-native-members.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A extends js.Object { def apply(arg: Int): Int = arg // error diff --git a/tests/neg-scalajs/js-trait-members-override.scala b/tests/neg-scalajs/js-trait-members-override.scala index 25d25962a8f9..00caeba68d32 100644 --- a/tests/neg-scalajs/js-trait-members-override.scala +++ b/tests/neg-scalajs/js-trait-members-override.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* abstract class A1 extends js.Object { val a1: js.UndefOr[Int] = 5 diff --git a/tests/neg-scalajs/js-trait-members-wrong-kind.scala b/tests/neg-scalajs/js-trait-members-wrong-kind.scala index 1cc7610d1610..6bae46d717f2 100644 --- a/tests/neg-scalajs/js-trait-members-wrong-kind.scala +++ b/tests/neg-scalajs/js-trait-members-wrong-kind.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* trait A extends js.Object { lazy val a1: js.UndefOr[Int] = js.undefined // error diff --git a/tests/neg-scalajs/js-trait-members.scala b/tests/neg-scalajs/js-trait-members.scala index 69d4c5a9a295..84926f60ed70 100644 --- a/tests/neg-scalajs/js-trait-members.scala +++ b/tests/neg-scalajs/js-trait-members.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* trait A extends js.Object { val a1: js.UndefOr[Int] = 5 // error diff --git a/tests/neg-scalajs/js-type-bad-parents.scala b/tests/neg-scalajs/js-type-bad-parents.scala index cd55aaa0eb4a..5960d61c2a46 100644 --- a/tests/neg-scalajs/js-type-bad-parents.scala +++ b/tests/neg-scalajs/js-type-bad-parents.scala @@ -1,7 +1,7 @@ import scala.language.dynamics import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* // AnyRef as direct parent, invalid for non-native JS types, except traits diff --git a/tests/neg-scalajs/js-type-override-equals-hashcode.scala b/tests/neg-scalajs/js-type-override-equals-hashcode.scala index 0d5a53e2a719..946fc85ceda9 100644 --- a/tests/neg-scalajs/js-type-override-equals-hashcode.scala +++ b/tests/neg-scalajs/js-type-override-equals-hashcode.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A extends js.Object { override def hashCode(): Int = 1 // error diff --git a/tests/neg-scalajs/jsconstructorof-error-in-prepjsinterop.scala b/tests/neg-scalajs/jsconstructorof-error-in-prepjsinterop.scala index 59d4d27ff086..3f4f10a67958 100644 --- a/tests/neg-scalajs/jsconstructorof-error-in-prepjsinterop.scala +++ b/tests/neg-scalajs/jsconstructorof-error-in-prepjsinterop.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native @JSGlobal class NativeJSClass extends js.Object @js.native trait NativeJSTrait extends js.Object diff --git a/tests/neg-scalajs/jsconstructorof-error-in-typer.scala b/tests/neg-scalajs/jsconstructorof-error-in-typer.scala index d70f4ef35d3f..22a523ec62fe 100644 --- a/tests/neg-scalajs/jsconstructorof-error-in-typer.scala +++ b/tests/neg-scalajs/jsconstructorof-error-in-typer.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class ScalaClass trait ScalaTrait diff --git a/tests/neg-scalajs/jsconstructortag-error-in-prepjsinterop.scala b/tests/neg-scalajs/jsconstructortag-error-in-prepjsinterop.scala index a57071259256..d9835a0223f9 100644 --- a/tests/neg-scalajs/jsconstructortag-error-in-prepjsinterop.scala +++ b/tests/neg-scalajs/jsconstructortag-error-in-prepjsinterop.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native @JSGlobal class NativeJSClass extends js.Object @js.native trait NativeJSTrait extends js.Object diff --git a/tests/neg-scalajs/jsconstructortag-error-in-typer.scala b/tests/neg-scalajs/jsconstructortag-error-in-typer.scala index 0090fa7129f4..8f22b1524392 100644 --- a/tests/neg-scalajs/jsconstructortag-error-in-typer.scala +++ b/tests/neg-scalajs/jsconstructortag-error-in-typer.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class ScalaClass trait ScalaTrait diff --git a/tests/neg-scalajs/jsexport-bad-tostring.scala b/tests/neg-scalajs/jsexport-bad-tostring.scala index 53853b1f3a65..64ec10c5e0fa 100644 --- a/tests/neg-scalajs/jsexport-bad-tostring.scala +++ b/tests/neg-scalajs/jsexport-bad-tostring.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A { @JSExport("toString") // error diff --git a/tests/neg-scalajs/jsexport-conflict-method-prop.scala b/tests/neg-scalajs/jsexport-conflict-method-prop.scala index 1b879024b9d8..0fe0d9325618 100644 --- a/tests/neg-scalajs/jsexport-conflict-method-prop.scala +++ b/tests/neg-scalajs/jsexport-conflict-method-prop.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A1 { @JSExport("a") // error diff --git a/tests/neg-scalajs/jsexport-conflicts.scala b/tests/neg-scalajs/jsexport-conflicts.scala index 1b9aa5245bfe..8a181856cdfb 100644 --- a/tests/neg-scalajs/jsexport-conflicts.scala +++ b/tests/neg-scalajs/jsexport-conflicts.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A { @JSExport diff --git a/tests/neg-scalajs/jsexport-double-definition.scala b/tests/neg-scalajs/jsexport-double-definition.scala index f9ec73439b23..be304aaf8c50 100644 --- a/tests/neg-scalajs/jsexport-double-definition.scala +++ b/tests/neg-scalajs/jsexport-double-definition.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A { @JSExport("value") // error diff --git a/tests/neg-scalajs/jsexport-double-underscore.scala b/tests/neg-scalajs/jsexport-double-underscore.scala index 35d31713d9c6..e73aa22699c7 100644 --- a/tests/neg-scalajs/jsexport-double-underscore.scala +++ b/tests/neg-scalajs/jsexport-double-underscore.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A { @JSExport(name = "__") // error diff --git a/tests/neg-scalajs/jsexport-implicit-apply.scala b/tests/neg-scalajs/jsexport-implicit-apply.scala index 80400fa6556e..83e75516837a 100644 --- a/tests/neg-scalajs/jsexport-implicit-apply.scala +++ b/tests/neg-scalajs/jsexport-implicit-apply.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A { @JSExport // error diff --git a/tests/neg-scalajs/jsexport-js-member.scala b/tests/neg-scalajs/jsexport-js-member.scala index 4178a54df88d..5426350da300 100644 --- a/tests/neg-scalajs/jsexport-js-member.scala +++ b/tests/neg-scalajs/jsexport-js-member.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native @JSGlobal diff --git a/tests/neg-scalajs/jsexport-local.scala b/tests/neg-scalajs/jsexport-local.scala index 84c830c4ca5c..a8e7ea50e4bf 100644 --- a/tests/neg-scalajs/jsexport-local.scala +++ b/tests/neg-scalajs/jsexport-local.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A { def method(): Unit = { diff --git a/tests/neg-scalajs/jsexport-misplaced-default-or-vararg.scala b/tests/neg-scalajs/jsexport-misplaced-default-or-vararg.scala index eea2d0d373fe..d22ec413bf28 100644 --- a/tests/neg-scalajs/jsexport-misplaced-default-or-vararg.scala +++ b/tests/neg-scalajs/jsexport-misplaced-default-or-vararg.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A { @JSExport // error diff --git a/tests/neg-scalajs/jsexport-non-public.scala b/tests/neg-scalajs/jsexport-non-public.scala index f7e2908b8c50..95ebd09dd0b0 100644 --- a/tests/neg-scalajs/jsexport-non-public.scala +++ b/tests/neg-scalajs/jsexport-non-public.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object Container { diff --git a/tests/neg-scalajs/jsexport-on-non-toplevel-class-object.scala b/tests/neg-scalajs/jsexport-on-non-toplevel-class-object.scala index abb4c383e814..7d127a5654ae 100644 --- a/tests/neg-scalajs/jsexport-on-non-toplevel-class-object.scala +++ b/tests/neg-scalajs/jsexport-on-non-toplevel-class-object.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A { @JSExport // error diff --git a/tests/neg-scalajs/jsexport-on-toplevel.scala b/tests/neg-scalajs/jsexport-on-toplevel.scala index ca84e2766472..84f62dd914aa 100644 --- a/tests/neg-scalajs/jsexport-on-toplevel.scala +++ b/tests/neg-scalajs/jsexport-on-toplevel.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @JSExport // error class A1 diff --git a/tests/neg-scalajs/jsexport-setter-with-bad-setter-sig.scala b/tests/neg-scalajs/jsexport-setter-with-bad-setter-sig.scala index f98bd56c9a26..1f6d3373ad00 100644 --- a/tests/neg-scalajs/jsexport-setter-with-bad-setter-sig.scala +++ b/tests/neg-scalajs/jsexport-setter-with-bad-setter-sig.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A { @JSExport // error diff --git a/tests/neg-scalajs/jsexportall-bad-names.scala b/tests/neg-scalajs/jsexportall-bad-names.scala index 7e6b8350beda..46fafad578bc 100644 --- a/tests/neg-scalajs/jsexportall-bad-names.scala +++ b/tests/neg-scalajs/jsexportall-bad-names.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @JSExportAll class A { diff --git a/tests/neg-scalajs/jsexportany-non-literal-arguments.scala b/tests/neg-scalajs/jsexportany-non-literal-arguments.scala index 199073f0f393..bbf2b21756c1 100644 --- a/tests/neg-scalajs/jsexportany-non-literal-arguments.scala +++ b/tests/neg-scalajs/jsexportany-non-literal-arguments.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object Names { val a = "Hello" diff --git a/tests/neg-scalajs/jsexportstatic-after-stat-or-non-static-field.scala b/tests/neg-scalajs/jsexportstatic-after-stat-or-non-static-field.scala index d6d956d3cdf5..9a0f834bc950 100644 --- a/tests/neg-scalajs/jsexportstatic-after-stat-or-non-static-field.scala +++ b/tests/neg-scalajs/jsexportstatic-after-stat-or-non-static-field.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class AfterVal extends js.Object diff --git a/tests/neg-scalajs/jsexportstatic-conflicts.scala b/tests/neg-scalajs/jsexportstatic-conflicts.scala index 14974ec92bfc..77f43b8988f4 100644 --- a/tests/neg-scalajs/jsexportstatic-conflicts.scala +++ b/tests/neg-scalajs/jsexportstatic-conflicts.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A extends js.Object object A { diff --git a/tests/neg-scalajs/jsexportstatic-twice-same-field.scala b/tests/neg-scalajs/jsexportstatic-twice-same-field.scala index 8764ef5a07b9..7daa5865a802 100644 --- a/tests/neg-scalajs/jsexportstatic-twice-same-field.scala +++ b/tests/neg-scalajs/jsexportstatic-twice-same-field.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class StaticContainer extends js.Object diff --git a/tests/neg-scalajs/jsexportstatic-wrong-kind.scala b/tests/neg-scalajs/jsexportstatic-wrong-kind.scala index fdf4d47b2380..f128e60fe65f 100644 --- a/tests/neg-scalajs/jsexportstatic-wrong-kind.scala +++ b/tests/neg-scalajs/jsexportstatic-wrong-kind.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class StaticContainer extends js.Object diff --git a/tests/neg-scalajs/jsexportstatic-wrong-place.scala b/tests/neg-scalajs/jsexportstatic-wrong-place.scala index c1b649cf39bd..39ca4c026c26 100644 --- a/tests/neg-scalajs/jsexportstatic-wrong-place.scala +++ b/tests/neg-scalajs/jsexportstatic-wrong-place.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A { class A1 extends js.Object diff --git a/tests/neg-scalajs/jsexporttoplevel-abstract-class-or-trait.scala b/tests/neg-scalajs/jsexporttoplevel-abstract-class-or-trait.scala index 843e1bab7386..0fe48e0862b9 100644 --- a/tests/neg-scalajs/jsexporttoplevel-abstract-class-or-trait.scala +++ b/tests/neg-scalajs/jsexporttoplevel-abstract-class-or-trait.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @JSExportTopLevel("A") // error abstract class A diff --git a/tests/neg-scalajs/jsexporttoplevel-conflicts.scala b/tests/neg-scalajs/jsexporttoplevel-conflicts.scala index e684b7940ad8..e466fad9917a 100644 --- a/tests/neg-scalajs/jsexporttoplevel-conflicts.scala +++ b/tests/neg-scalajs/jsexporttoplevel-conflicts.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object A { @JSExportTopLevel("A") diff --git a/tests/neg-scalajs/jsexporttoplevel-in-js-type.scala b/tests/neg-scalajs/jsexporttoplevel-in-js-type.scala index fe0d12597a62..3382a3a8f15d 100644 --- a/tests/neg-scalajs/jsexporttoplevel-in-js-type.scala +++ b/tests/neg-scalajs/jsexporttoplevel-in-js-type.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object JSContainer extends js.Object { @JSExportTopLevel("A") // error diff --git a/tests/neg-scalajs/jsexporttoplevel-invalid-js-identifier.scala b/tests/neg-scalajs/jsexporttoplevel-invalid-js-identifier.scala index 0b97e384d407..e9379df5330b 100644 --- a/tests/neg-scalajs/jsexporttoplevel-invalid-js-identifier.scala +++ b/tests/neg-scalajs/jsexporttoplevel-invalid-js-identifier.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @JSExportTopLevel("not-a-valid-JS-identifier-1") // error object A diff --git a/tests/neg-scalajs/jsexporttoplevel-js-native.scala b/tests/neg-scalajs/jsexporttoplevel-js-native.scala index e5b1aa69f85c..bce1496947d6 100644 --- a/tests/neg-scalajs/jsexporttoplevel-js-native.scala +++ b/tests/neg-scalajs/jsexporttoplevel-js-native.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @JSExportTopLevel("A") // error @js.native diff --git a/tests/neg-scalajs/jsexporttoplevel-local.scala b/tests/neg-scalajs/jsexporttoplevel-local.scala index 71b89955d6ce..57c03fdee495 100644 --- a/tests/neg-scalajs/jsexporttoplevel-local.scala +++ b/tests/neg-scalajs/jsexporttoplevel-local.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A { def method(): Unit = { diff --git a/tests/neg-scalajs/jsexporttoplevel-non-public.scala b/tests/neg-scalajs/jsexporttoplevel-non-public.scala index 96466ab49707..1d18b1bab3f5 100644 --- a/tests/neg-scalajs/jsexporttoplevel-non-public.scala +++ b/tests/neg-scalajs/jsexporttoplevel-non-public.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object Container { diff --git a/tests/neg-scalajs/jsexporttoplevel-non-static.scala b/tests/neg-scalajs/jsexporttoplevel-non-static.scala index 362717649380..3c02804c62b5 100644 --- a/tests/neg-scalajs/jsexporttoplevel-non-static.scala +++ b/tests/neg-scalajs/jsexporttoplevel-non-static.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class ClassContainer { @JSExportTopLevel("A") // error diff --git a/tests/neg-scalajs/jsexporttoplevel-wrong-kind.scala b/tests/neg-scalajs/jsexporttoplevel-wrong-kind.scala index f3c76d2802d8..b440c0f7750a 100644 --- a/tests/neg-scalajs/jsexporttoplevel-wrong-kind.scala +++ b/tests/neg-scalajs/jsexporttoplevel-wrong-kind.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object A { @JSExportTopLevel("a1") // error diff --git a/tests/neg-scalajs/jsglobalscope-on-non-object.scala b/tests/neg-scalajs/jsglobalscope-on-non-object.scala index e997d8fd3edc..ee5e14448835 100644 --- a/tests/neg-scalajs/jsglobalscope-on-non-object.scala +++ b/tests/neg-scalajs/jsglobalscope-on-non-object.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native @JSGlobalScope // error diff --git a/tests/neg-scalajs/jsname-argument.scala b/tests/neg-scalajs/jsname-argument.scala index 76375ebaa2f3..293433c8217f 100644 --- a/tests/neg-scalajs/jsname-argument.scala +++ b/tests/neg-scalajs/jsname-argument.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object Names { val a = "Hello" diff --git a/tests/neg-scalajs/jsname-duplicate.scala b/tests/neg-scalajs/jsname-duplicate.scala index 295c8d3f8104..8d4c67f267ce 100644 --- a/tests/neg-scalajs/jsname-duplicate.scala +++ b/tests/neg-scalajs/jsname-duplicate.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object Names { val a = js.Symbol() diff --git a/tests/neg-scalajs/jsname-on-private-members.scala b/tests/neg-scalajs/jsname-on-private-members.scala index 46b93f3d0897..12c800726711 100644 --- a/tests/neg-scalajs/jsname-on-private-members.scala +++ b/tests/neg-scalajs/jsname-on-private-members.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* class A extends js.Object { @JSName("toto1") // error diff --git a/tests/neg-scalajs/jsname-on-trait.scala b/tests/neg-scalajs/jsname-on-trait.scala index ebb4c8aa6946..f2cd689c025f 100644 --- a/tests/neg-scalajs/jsname-on-trait.scala +++ b/tests/neg-scalajs/jsname-on-trait.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native @JSGlobal diff --git a/tests/neg-scalajs/jsname-override.scala b/tests/neg-scalajs/jsname-override.scala index 16f948964417..7f50ecf1d8f3 100644 --- a/tests/neg-scalajs/jsname-override.scala +++ b/tests/neg-scalajs/jsname-override.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* abstract class A1 extends js.Object { @JSName("foo") diff --git a/tests/neg-scalajs/jsname-symbol-override.scala b/tests/neg-scalajs/jsname-symbol-override.scala index fd3bf5c79057..1a961b1ba6d4 100644 --- a/tests/neg-scalajs/jsname-symbol-override.scala +++ b/tests/neg-scalajs/jsname-symbol-override.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object Syms { val sym1 = js.Symbol() diff --git a/tests/neg-scalajs/jsname-wrong-place.scala b/tests/neg-scalajs/jsname-wrong-place.scala index 0fa8ed02a045..f91a3de1f596 100644 --- a/tests/neg-scalajs/jsname-wrong-place.scala +++ b/tests/neg-scalajs/jsname-wrong-place.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object Sym { val sym = js.Symbol() diff --git a/tests/neg-scalajs/native-load-spec-argument.scala b/tests/neg-scalajs/native-load-spec-argument.scala index c5043362147a..33144c6f934b 100644 --- a/tests/neg-scalajs/native-load-spec-argument.scala +++ b/tests/neg-scalajs/native-load-spec-argument.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object Names { val a = "Hello" diff --git a/tests/neg-scalajs/native-load-spec-duplicate.scala b/tests/neg-scalajs/native-load-spec-duplicate.scala index 49d06967d118..e0039ba626c2 100644 --- a/tests/neg-scalajs/native-load-spec-duplicate.scala +++ b/tests/neg-scalajs/native-load-spec-duplicate.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native @JSGlobalScope diff --git a/tests/neg-scalajs/native-load-spec-missing.scala b/tests/neg-scalajs/native-load-spec-missing.scala index 103993bda2b3..4f3046ef42c0 100644 --- a/tests/neg-scalajs/native-load-spec-missing.scala +++ b/tests/neg-scalajs/native-load-spec-missing.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native object A1 extends js.Object // error diff --git a/tests/neg-scalajs/native-load-spec-need-explicit-name.scala b/tests/neg-scalajs/native-load-spec-need-explicit-name.scala index da59a3d57cd5..fc08d414dd63 100644 --- a/tests/neg-scalajs/native-load-spec-need-explicit-name.scala +++ b/tests/neg-scalajs/native-load-spec-need-explicit-name.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* object A { @js.native diff --git a/tests/neg-scalajs/native-load-spec-nested.scala b/tests/neg-scalajs/native-load-spec-nested.scala index 66e6a1d4b8f6..097d58fe0a58 100644 --- a/tests/neg-scalajs/native-load-spec-nested.scala +++ b/tests/neg-scalajs/native-load-spec-nested.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native trait A1 extends js.Object { diff --git a/tests/neg-scalajs/native-load-spec-on-non-js-native.scala b/tests/neg-scalajs/native-load-spec-on-non-js-native.scala index a41bee72a7e2..b9e198286694 100644 --- a/tests/neg-scalajs/native-load-spec-on-non-js-native.scala +++ b/tests/neg-scalajs/native-load-spec-on-non-js-native.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* // Non-native JS types diff --git a/tests/neg-scalajs/native-load-spec-on-trait.scala b/tests/neg-scalajs/native-load-spec-on-trait.scala index 0dd1c925d876..7cb893e04712 100644 --- a/tests/neg-scalajs/native-load-spec-on-trait.scala +++ b/tests/neg-scalajs/native-load-spec-on-trait.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native @JSGlobal // error diff --git a/tests/neg-scalajs/non-native-js-types-inside-js-native.scala b/tests/neg-scalajs/non-native-js-types-inside-js-native.scala index c1007c9fc34d..dbfeb787be63 100644 --- a/tests/neg-scalajs/non-native-js-types-inside-js-native.scala +++ b/tests/neg-scalajs/non-native-js-types-inside-js-native.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native @JSGlobal diff --git a/tests/neg-scalajs/package-object-extends-js-any.scala b/tests/neg-scalajs/package-object-extends-js-any.scala index 9933c5696d5e..cd7b75033c54 100644 --- a/tests/neg-scalajs/package-object-extends-js-any.scala +++ b/tests/neg-scalajs/package-object-extends-js-any.scala @@ -1,4 +1,4 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* package object jspackage extends js.Object // error diff --git a/tests/neg-scalajs/reflective-calls.scala b/tests/neg-scalajs/reflective-calls.scala index b241e9c72864..750c1ab5640f 100644 --- a/tests/neg-scalajs/reflective-calls.scala +++ b/tests/neg-scalajs/reflective-calls.scala @@ -1,4 +1,4 @@ -import scala.reflect.{ClassTag, Selectable => ReflectSel} +import scala.reflect.{ClassTag, Selectable as ReflectSel} import ReflectSel.reflectiveSelectable object Test { diff --git a/tests/neg-scalajs/scala-types-inside-js-native.scala b/tests/neg-scalajs/scala-types-inside-js-native.scala index 5f155e730f7a..c4d58cd75cf4 100644 --- a/tests/neg-scalajs/scala-types-inside-js-native.scala +++ b/tests/neg-scalajs/scala-types-inside-js-native.scala @@ -1,5 +1,5 @@ import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native @JSGlobal diff --git a/tests/neg-staging/i5941/macro_1.scala b/tests/neg-staging/i5941/macro_1.scala index 7079673f6e0b..9eb20b1871c9 100644 --- a/tests/neg-staging/i5941/macro_1.scala +++ b/tests/neg-staging/i5941/macro_1.scala @@ -3,7 +3,7 @@ abstract class Lens[S, T] { def set(t: T, s: S) :S } -import scala.quoted._ +import scala.quoted.* object Lens { def apply[S, T](_get: S => T)(_set: T => S => S): Lens[S, T] = new Lens { @@ -13,8 +13,8 @@ object Lens { def impl[S: Type, T: Type](getter: Expr[S => T])(using Quotes): Expr[Lens[S, T]] = { implicit val toolbox: scala.quoted.staging.Compiler = scala.quoted.staging.Compiler.make(this.getClass.getClassLoader) - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* // obj.copy(field = value) def setterBody(obj: Expr[S], value: Expr[T], field: String): Expr[S] = Select.overloaded(obj.asTerm, "copy", Nil, NamedArg(field, value.asTerm) :: Nil, TypeBounds.empty).asExprOf[S] diff --git a/tests/neg-staging/i9692.scala b/tests/neg-staging/i9692.scala index 10991b379975..e38577f2d409 100644 --- a/tests/neg-staging/i9692.scala +++ b/tests/neg-staging/i9692.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test extends App { diff --git a/tests/neg-staging/i9693.scala b/tests/neg-staging/i9693.scala index 70bc18ac8b4a..ee34d7952df1 100644 --- a/tests/neg-staging/i9693.scala +++ b/tests/neg-staging/i9693.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test extends App { diff --git a/tests/neg-staging/quote-run-in-macro-1/quoted_1.scala b/tests/neg-staging/quote-run-in-macro-1/quoted_1.scala index 8549b2d1ad47..2551bcf76cf0 100644 --- a/tests/neg-staging/quote-run-in-macro-1/quoted_1.scala +++ b/tests/neg-staging/quote-run-in-macro-1/quoted_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Macros { diff --git a/tests/neg-staging/quote-run-in-macro-1/quoted_2.scala b/tests/neg-staging/quote-run-in-macro-1/quoted_2.scala index 9127d3d6be5d..606fbfc9339a 100644 --- a/tests/neg-staging/quote-run-in-macro-1/quoted_2.scala +++ b/tests/neg-staging/quote-run-in-macro-1/quoted_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { val x = 3 diff --git a/tests/neg-with-compiler/GenericNumLits/EvenFromDigitsImpl_1.scala b/tests/neg-with-compiler/GenericNumLits/EvenFromDigitsImpl_1.scala index 1d2e484daa5d..2c8e0d088ea8 100644 --- a/tests/neg-with-compiler/GenericNumLits/EvenFromDigitsImpl_1.scala +++ b/tests/neg-with-compiler/GenericNumLits/EvenFromDigitsImpl_1.scala @@ -1,7 +1,7 @@ import language.experimental.genericNumberLiterals import scala.util.FromDigits -import scala.quoted._ -import Even._ +import scala.quoted.* +import Even.* object EvenFromDigitsImpl: def apply(digits: Expr[String])(using Quotes): Expr[Even] = digits.value match { diff --git a/tests/neg-with-compiler/GenericNumLits/Even_1.scala b/tests/neg-with-compiler/GenericNumLits/Even_1.scala index 6dc1117f25b6..0867150dd944 100644 --- a/tests/neg-with-compiler/GenericNumLits/Even_1.scala +++ b/tests/neg-with-compiler/GenericNumLits/Even_1.scala @@ -1,6 +1,6 @@ import language.experimental.genericNumberLiterals import scala.util.FromDigits -import scala.quoted._ +import scala.quoted.* case class Even(n: Int) diff --git a/tests/neg-with-compiler/Main.scala b/tests/neg-with-compiler/Main.scala index b3b817284e4f..a2ed3c4767c1 100644 --- a/tests/neg-with-compiler/Main.scala +++ b/tests/neg-with-compiler/Main.scala @@ -6,7 +6,7 @@ package dotty.tools package dotc import core.Contexts.Context -import config.Settings.Setting._ +import config.Settings.Setting.* object Main extends Driver { def resident(compiler: Compiler): Unit = unsupported("resident") /*loop { line => diff --git a/tests/neg/6570-1.scala b/tests/neg/6570-1.scala index 046daba285b1..a8cdf6410ed5 100644 --- a/tests/neg/6570-1.scala +++ b/tests/neg/6570-1.scala @@ -1,4 +1,4 @@ -import scala.Tuple._ +import scala.Tuple.* trait Trait1 trait Trait2 diff --git a/tests/neg/6570.scala b/tests/neg/6570.scala index 069aa45313a7..d0b55fe739de 100644 --- a/tests/neg/6570.scala +++ b/tests/neg/6570.scala @@ -6,7 +6,7 @@ object Base { case Int => Trait2 } } -import Base._ +import Base.* object UpperBoundParametricVariant { trait Cov[+T] diff --git a/tests/neg/Iter3.scala b/tests/neg/Iter3.scala index 68dfdc1ac6de..d3bab8c34286 100644 --- a/tests/neg/Iter3.scala +++ b/tests/neg/Iter3.scala @@ -117,7 +117,7 @@ object Iter2 { } case class ArrayIterator[A](elems: Array[AnyRef], len: Int) extends Iterator[A] { - import ArrayIterator._ + import ArrayIterator.* private def elem(i: Int) = elems(i).asInstanceOf[A] diff --git a/tests/neg/OpaqueEscape.scala b/tests/neg/OpaqueEscape.scala index 974bb2c38aed..a6f701fd4e3b 100644 --- a/tests/neg/OpaqueEscape.scala +++ b/tests/neg/OpaqueEscape.scala @@ -1,7 +1,7 @@ object OpaqueEscape{ opaque type Wrapped = Int } -import OpaqueEscape._ +import OpaqueEscape.* abstract class EscaperBase { def unwrap(i:Wrapped):Int def wrap(i:Int):Wrapped diff --git a/tests/neg/caseclass-access.scala b/tests/neg/caseclass-access.scala index e43e6aaa5547..b14ee104ecca 100644 --- a/tests/neg/caseclass-access.scala +++ b/tests/neg/caseclass-access.scala @@ -18,7 +18,7 @@ object qualified_private { case class D private[qualified_private] (i: Int) // ok: no user-defined companion object } object QPrivTest { - import qualified_private._ + import qualified_private.* def c1: C = C(1) // error: apply is private def c2: C = c1.copy(2) // error: copy is private @@ -36,7 +36,7 @@ object qualified_protected { case class F protected[qualified_protected] (i: Int) } object QProtTest { - import qualified_protected._ + import qualified_protected.* def f1: F = F(1) def f2: F = f2.copy(2) // error: copy is protected } diff --git a/tests/neg/dynamicNoImport.scala b/tests/neg/dynamicNoImport.scala index ca12706735fa..44009d02e89d 100644 --- a/tests/neg/dynamicNoImport.scala +++ b/tests/neg/dynamicNoImport.scala @@ -5,13 +5,13 @@ object Baz extends scala.Dynamic // error package A { import scala.language.dynamics package B { - import scala.language.{ dynamics => _ } + import scala.language.dynamics as _ class Foo extends scala.Dynamic // error trait Bar extends scala.Dynamic // error object Baz extends scala.Dynamic // error package C { - import scala.language.{ dynamics => d } + import scala.language.dynamics as d class Foo extends scala.Dynamic // OK } } diff --git a/tests/neg/enum-List3.scala b/tests/neg/enum-List3.scala index 3229cdd82dec..3f0ece2ebed1 100644 --- a/tests/neg/enum-List3.scala +++ b/tests/neg/enum-List3.scala @@ -3,7 +3,7 @@ enum List[+T] { case Nil extends List[Nothing] } object Test { - import List._ + import List.* val xs = Cons(1, Cons(2, Cons(3, Nil))) def main(args: Array[String]) = println(xs) } diff --git a/tests/neg/enum-values.scala b/tests/neg/enum-values.scala index 08069251af0e..bee22094f641 100644 --- a/tests/neg/enum-values.scala +++ b/tests/neg/enum-values.scala @@ -27,7 +27,7 @@ object UnimportedExtensions: object NotAnEnum // object without a companion class def Test: Unit = - import Tag._, ListLike._, TypeCtorsK._, Extensions._ + import Tag._, ListLike._, TypeCtorsK._, Extensions.* val tags: Array[Tag[?]] = Tag.values // error val listlikes: Array[ListLike[?]] = ListLike.values // error diff --git a/tests/neg/enumsAccess.scala b/tests/neg/enumsAccess.scala index a654f0633ead..18b91b346b6a 100644 --- a/tests/neg/enumsAccess.scala +++ b/tests/neg/enumsAccess.scala @@ -15,7 +15,7 @@ object test1 { } object test2 { - import E5._ + import E5.* object E5 { type INT = Integer val defaultX = 2 @@ -34,7 +34,7 @@ object test3 { val defaultX = 2 } - import E5._ + import E5.* enum E5 { case C1(x: INT) // ok @@ -51,7 +51,7 @@ object test4 { case C3[T <: INT]() // error: illegal reference } - import E5._ + import E5.* object E5 { type INT = Integer @@ -73,7 +73,7 @@ object test5 { } object test6 { - import E5._ + import E5.* enum E5[T](x: T) { case C3() extends E5[INT](defaultX) // ok case C4() extends E5[INT](defaultX) // ok diff --git a/tests/neg/extend-java-enum-migration.scala b/tests/neg/extend-java-enum-migration.scala index ce781daf8668..0f006e032942 100644 --- a/tests/neg/extend-java-enum-migration.scala +++ b/tests/neg/extend-java-enum-migration.scala @@ -1,4 +1,4 @@ -import java.{lang => jl} +import java.{lang as jl} import language.`3.0-migration` diff --git a/tests/neg/extend-java-enum-nonstatic.scala b/tests/neg/extend-java-enum-nonstatic.scala index 5f0b6d36f8a8..efd2dcb8c6af 100644 --- a/tests/neg/extend-java-enum-nonstatic.scala +++ b/tests/neg/extend-java-enum-nonstatic.scala @@ -1,4 +1,4 @@ -import java.{lang => jl} +import java.{lang as jl} object TestSuite: def test(op: => Unit): Unit = op diff --git a/tests/neg/extend-java-enum.scala b/tests/neg/extend-java-enum.scala index 48b644cd8b24..c28ad618f1bd 100644 --- a/tests/neg/extend-java-enum.scala +++ b/tests/neg/extend-java-enum.scala @@ -1,4 +1,4 @@ -import java.{lang => jl} +import java.{lang as jl} class C1 extends jl.Enum[C1] // error: class C1 cannot extend java.lang.Enum diff --git a/tests/neg/gadt-alias-injectivity.scala b/tests/neg/gadt-alias-injectivity.scala index 34203a45f4f8..c385ee62754a 100644 --- a/tests/neg/gadt-alias-injectivity.scala +++ b/tests/neg/gadt-alias-injectivity.scala @@ -2,7 +2,7 @@ object Test { enum EQ[A, B] { case Refl[T]() extends EQ[T, T] } - import EQ._ + import EQ.* object A { type Foo[+X] = (X, X) diff --git a/tests/neg/i10511.scala b/tests/neg/i10511.scala index 4ceaae4141e4..67e5b28b5bb8 100644 --- a/tests/neg/i10511.scala +++ b/tests/neg/i10511.scala @@ -3,7 +3,7 @@ enum Bool { case False } -import Bool._ +import Bool.* type Not[B <: Bool] = B match { case True.type => False.type diff --git a/tests/neg/i10901.scala b/tests/neg/i10901.scala index 9552047c402f..19a2e3023c85 100644 --- a/tests/neg/i10901.scala +++ b/tests/neg/i10901.scala @@ -36,7 +36,7 @@ object BugExp4Point2D { case class Point2D[T1:Numeric, T2:Numeric](x:T1, y:T2) - import dsl._ + import dsl.* def main(args: Array[String]): Unit = { val x = IntT diff --git a/tests/neg/i11101.check b/tests/neg/i11101.check new file mode 100644 index 000000000000..726a1ad2a44b --- /dev/null +++ b/tests/neg/i11101.check @@ -0,0 +1,8 @@ +-- Error: tests/neg/i11101.scala:16:22 --------------------------------------------------------------------------------- +16 | summon[TC[FailHere]] // error: blow up here + | ^ + | blow up here +-- Error: tests/neg/i11101.scala:17:16 --------------------------------------------------------------------------------- +17 | TC.mkDefaultTC[FailHere] // error: blow up here + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | blow up here diff --git a/tests/neg/i11101.scala b/tests/neg/i11101.scala new file mode 100644 index 000000000000..b5e00f6a28f0 --- /dev/null +++ b/tests/neg/i11101.scala @@ -0,0 +1,17 @@ +class FailHere + +trait TC[T] +object TC { + + inline def mkDefaultTC[A]: TC[A] = inline compiletime.erasedValue[A] match { + case _: FailHere => compiletime.error("blow up here") + case _ => ??? + } + + inline given [T]: TC[T] = mkDefaultTC[T] +} + +def test = + summon[TC[Int]] // ok + summon[TC[FailHere]] // error: blow up here + TC.mkDefaultTC[FailHere] // error: blow up here diff --git a/tests/neg/i1145.scala b/tests/neg/i1145.scala index b33300b912ae..30948d7f5f01 100644 --- a/tests/neg/i1145.scala +++ b/tests/neg/i1145.scala @@ -2,7 +2,7 @@ object A { def x = 3 def y = { - import B._ + import B.* x // error: ambiguous } } diff --git a/tests/neg/i1286.scala b/tests/neg/i1286.scala index 40db9ab1d46d..a2fcfc983fbc 100644 --- a/tests/neg/i1286.scala +++ b/tests/neg/i1286.scala @@ -6,8 +6,8 @@ import io.Idontexist2 // error import scala.io.{ AnsiColor, Idontexist3 } // error -import scala.io.{ Idontexist4 => Foo } // error -import scala.io.{ Idontexist5 => _ } // error +import scala.io.{ Idontexist4 as Foo } // error +import scala.io.{ Idontexist5 as _ } // error import scala.language.dynamics import scala.language.noAutoTupling diff --git a/tests/neg/i1707.scala b/tests/neg/i1707.scala index 8a6b17ec72f4..7b0486539b7d 100644 --- a/tests/neg/i1707.scala +++ b/tests/neg/i1707.scala @@ -13,11 +13,11 @@ object DepBug { val b = a mkB } def useDep(d: Dep) { // error: procedure syntax - import d._ + import d.* a m (b) } { - import dep._ + import dep.* a m (b) // error: not found: a } dep.a m (dep b) // error (follow on) diff --git a/tests/neg/i2033.scala b/tests/neg/i2033.scala index 16b2690365c7..5e3b9e40f26d 100644 --- a/tests/neg/i2033.scala +++ b/tests/neg/i2033.scala @@ -1,5 +1,5 @@ -import java.io._ -import collection._ +import java.io.* +import collection.* object Test { def check(obj: AnyRef): Unit = { val bos = new ByteArrayOutputStream() diff --git a/tests/neg/i2378.scala b/tests/neg/i2378.scala index 529eba1e6e57..b62aa9fcef6a 100644 --- a/tests/neg/i2378.scala +++ b/tests/neg/i2378.scala @@ -17,7 +17,7 @@ trait Toolbox { } class Test(val tb: Toolbox) { - import tb._ + import tb.* implicit val cap: Cap = null def foo(tree: Tree): Int = (tree: Any) match { diff --git a/tests/neg/i2960.scala b/tests/neg/i2960.scala index 435d9f5cbed1..d4d98d9fc11a 100644 --- a/tests/neg/i2960.scala +++ b/tests/neg/i2960.scala @@ -61,7 +61,7 @@ class Text(val value: String) extends Node { } object Test { -import org.glavo.dotty._ -import org.glavo.dotty.Tag._ +import org.glavo.dotty.* +import org.glavo.dotty.Tag.* 'html{} // error } diff --git a/tests/neg/i3083.scala b/tests/neg/i3083.scala index 916124db0517..28f1cc45250c 100644 --- a/tests/neg/i3083.scala +++ b/tests/neg/i3083.scala @@ -10,7 +10,7 @@ } def expression(adder: Addition) = { - import adder._ + import adder.* add(num(1), num(2)) // error // error (not found: num) } } diff --git a/tests/neg/i3745b.scala b/tests/neg/i3745b.scala index a2148178e205..7dca6390c627 100644 --- a/tests/neg/i3745b.scala +++ b/tests/neg/i3745b.scala @@ -1 +1 @@ -import scala.collection.{ Seq, Seq => _ } // error: Seq is renamed twice +import scala.collection.{ Seq, Seq as _ } // error: Seq is renamed twice diff --git a/tests/neg/i3745c.scala b/tests/neg/i3745c.scala index fd033e877266..40daf0072e05 100644 --- a/tests/neg/i3745c.scala +++ b/tests/neg/i3745c.scala @@ -1 +1 @@ -import scala.collection.{ Seq => A, Seq => B } // error: Seq is renamed twice +import scala.collection.{ Seq as A, Seq as B } // error: Seq is renamed twice diff --git a/tests/neg/i3976.scala b/tests/neg/i3976.scala index 7ec64b6ff23f..f5c1ac4bfcc0 100644 --- a/tests/neg/i3976.scala +++ b/tests/neg/i3976.scala @@ -3,7 +3,7 @@ object Test { case A extends Hoge[List] case B extends Hoge[[X] =>> String] } - import Hoge._ + import Hoge.* A == A A == (B: Hoge[_]) @@ -22,7 +22,7 @@ object Test2 { case A extends Hoge[[F[_]] =>> F[Int]] case B extends Hoge[[F[_]] =>> F[String]] } - import Hoge._ + import Hoge.* A == A A == (B: Hoge[_]) @@ -41,7 +41,7 @@ object Test3 { case A extends Hoge[[X] =>> List] // error: wrong kind case B extends Hoge[[X] =>> [Y] =>> String] // error: wrong kind } - import Hoge._ + import Hoge.* A == A A == (B: Hoge[_]) diff --git a/tests/neg/i4986c.scala b/tests/neg/i4986c.scala index f41948c19169..31458a7e9cbb 100644 --- a/tests/neg/i4986c.scala +++ b/tests/neg/i4986c.scala @@ -1,6 +1,6 @@ package pkg -import annotation._ +import annotation.* class myAnnot extends StaticAnnotation diff --git a/tests/neg/i5455.scala b/tests/neg/i5455.scala index 0d6c601ef985..d9f755407d7c 100644 --- a/tests/neg/i5455.scala +++ b/tests/neg/i5455.scala @@ -18,7 +18,7 @@ object Library { } object User extends App { - import Library._ + import Library.* val x = Nat(3) val y = Nat(4) diff --git a/tests/neg/i5546.scala b/tests/neg/i5546.scala index e261351b9480..d9b1220a6138 100644 --- a/tests/neg/i5546.scala +++ b/tests/neg/i5546.scala @@ -16,7 +16,7 @@ object O { } object Test { - import O._ + import O.* def main(args: Array[String]): Unit = { println(Feet(3) == Meters(3)) // error: cannot compare println(Feet(3) == 3.0) // error: cannot compare diff --git a/tests/neg/i5978.scala b/tests/neg/i5978.scala index 1c81160dba0a..5dddfafb8726 100644 --- a/tests/neg/i5978.scala +++ b/tests/neg/i5978.scala @@ -13,7 +13,7 @@ object TextParser { object Testcase { def main(args: Array[String]): Unit = { - import TextParser._ + import TextParser.* val tp_v: TokenParser[Char, Position[CharSequence]] = TextParser.TP val tp_i = summon[TokenParser[Char, Position[CharSequence]]] // error diff --git a/tests/neg/i6622.scala b/tests/neg/i6622.scala index d2002ed1370f..201f5c3170a2 100644 --- a/tests/neg/i6622.scala +++ b/tests/neg/i6622.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object Test { diff --git a/tests/neg/i6622a.scala b/tests/neg/i6622a.scala index 1b716444eb63..dd244d0e77d4 100644 --- a/tests/neg/i6622a.scala +++ b/tests/neg/i6622a.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object Test { diff --git a/tests/neg/i6622b.scala b/tests/neg/i6622b.scala index 48c8a24112cc..03e8c4b1ab5f 100644 --- a/tests/neg/i6622b.scala +++ b/tests/neg/i6622b.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object Test { diff --git a/tests/neg/i6622c.scala b/tests/neg/i6622c.scala index f9483d7fabdc..9355fa73a9b1 100644 --- a/tests/neg/i6622c.scala +++ b/tests/neg/i6622c.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object Test { diff --git a/tests/neg/i6622d.scala b/tests/neg/i6622d.scala index 1592086f67a6..ce4ff61d5187 100644 --- a/tests/neg/i6622d.scala +++ b/tests/neg/i6622d.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object Test { diff --git a/tests/neg/i6622e.scala b/tests/neg/i6622e.scala index 626c15bf4ef8..5b3e1bd2e913 100644 --- a/tests/neg/i6622e.scala +++ b/tests/neg/i6622e.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object Test { diff --git a/tests/neg/i6854.scala b/tests/neg/i6854.scala index 00e960bb670b..5eb0f8bf6028 100644 --- a/tests/neg/i6854.scala +++ b/tests/neg/i6854.scala @@ -1,5 +1,5 @@ object Test { - import Lib._ + import Lib.* val xs: IArray2[Int] = IArray2(1) } diff --git a/tests/neg/i7249.scala b/tests/neg/i7249.scala index 1f1fc3c9a829..6a5a0ba4312e 100644 --- a/tests/neg/i7249.scala +++ b/tests/neg/i7249.scala @@ -1,4 +1,4 @@ -import Predef.{$conforms => _, _} +import Predef.{$conforms as _, *} trait F[H, T] diff --git a/tests/neg/i7459.scala b/tests/neg/i7459.scala index 0635c7b1dcc0..b5b20d7bc22a 100644 --- a/tests/neg/i7459.scala +++ b/tests/neg/i7459.scala @@ -5,7 +5,7 @@ object Foo { println(summon) // error } -import scala.deriving._ +import scala.deriving.* import scala.compiletime.erasedValue inline def summon[T](using t:T): T = t match { diff --git a/tests/neg/i7526.scala b/tests/neg/i7526.scala index ed37df14aa73..c3a3745b8579 100644 --- a/tests/neg/i7526.scala +++ b/tests/neg/i7526.scala @@ -12,7 +12,7 @@ def compQ(name: => String) : (n: NetApi) ?=> Tr[Nothing, n.Comp, n.Comp] = ??? object net extends NetDB with NetHelper -import net._ +import net.* given n: NetApi = net val q: Tr[Nothing, Comp, Comp] = compQ("???") // error Found: Tr[Nothing, ?1.Comp, ?1.Comp] Required: Tr[Nothing, net.Comp, net.Comp] \ No newline at end of file diff --git a/tests/neg/i7575b.scala b/tests/neg/i7575b.scala index af71c535df5f..e85606fe492a 100644 --- a/tests/neg/i7575b.scala +++ b/tests/neg/i7575b.scala @@ -1,2 +1,2 @@ -import scala.language._ +import scala.language.* class Foo() extends Dynamic // error: extension of type scala.Dynamic needs to be enabled diff --git a/tests/neg/i8896-b.scala b/tests/neg/i8896-b.scala index d86255e811ec..a2559b00b3cc 100644 --- a/tests/neg/i8896-b.scala +++ b/tests/neg/i8896-b.scala @@ -1,4 +1,4 @@ -import scala.language.`3.1` +import scala.language.future trait Foo[A] diff --git a/tests/neg/i9014.check b/tests/neg/i9014.check index 629e81f6b6af..a8e21d94e501 100644 --- a/tests/neg/i9014.check +++ b/tests/neg/i9014.check @@ -1,9 +1,4 @@ -- Error: tests/neg/i9014.scala:4:25 ----------------------------------------------------------------------------------- -4 | val tests = summon[Bar] // error +4 | val tests = summon[Bar] // error: Failed to expand! | ^ - | no implicit argument of type Bar was found for parameter x of method summon in object Predef. - | I found: - | - | Bar.given_Bar - | - | But given instance given_Bar in object Bar does not match type Bar. + | Failed to expand! diff --git a/tests/neg/i9014.scala b/tests/neg/i9014.scala index 2a82d54be9d9..a31f77bba048 100644 --- a/tests/neg/i9014.scala +++ b/tests/neg/i9014.scala @@ -1,4 +1,4 @@ trait Bar object Bar: inline given Bar = compiletime.error("Failed to expand!") - val tests = summon[Bar] // error + val tests = summon[Bar] // error: Failed to expand! diff --git a/tests/neg/i997a.scala b/tests/neg/i997a.scala index eae56400fe51..cb323e1c852b 100644 --- a/tests/neg/i997a.scala +++ b/tests/neg/i997a.scala @@ -9,7 +9,7 @@ class C { private implicit class D(x: Int) extends Super } - import O._ + import O.* println(O.CC(1)) // error: CC cannot be accessed diff --git a/tests/neg/implicitDefs.scala b/tests/neg/implicitDefs.scala index 7c1fcc21d7d6..fbf91ee5c70d 100644 --- a/tests/neg/implicitDefs.scala +++ b/tests/neg/implicitDefs.scala @@ -1,6 +1,6 @@ package test -import Predef.{any2stringadd => _, StringAdd => _, _} +import Predef.{any2stringadd as _, StringAdd as _, *} object implicitDefs { diff --git a/tests/neg/implied-for.scala b/tests/neg/implied-for.scala index 8e9e44b2e413..87f762870400 100644 --- a/tests/neg/implied-for.scala +++ b/tests/neg/implied-for.scala @@ -8,7 +8,7 @@ object A { } object Test extends App { - import A._ + import A.* import A.{given B} val x: B = b // OK diff --git a/tests/neg/import-given.scala b/tests/neg/import-given.scala index ddc3da2fa5cb..080ed1e77ec5 100644 --- a/tests/neg/import-given.scala +++ b/tests/neg/import-given.scala @@ -4,13 +4,13 @@ object A { def foo(using TC) = () } object B { - import A._ + import A.* foo // error: no implicit argument was found foo(using tc) // error: not found: tc foo(using A.tc) // ok } object C { - import A._ + import A.* import A.tc foo // ok foo(using tc) // ok diff --git a/tests/neg/inlinevals-2.scala b/tests/neg/inlinevals-2.scala new file mode 100644 index 000000000000..9a3c6829c456 --- /dev/null +++ b/tests/neg/inlinevals-2.scala @@ -0,0 +1,12 @@ +object Test { + + inline def power(x: Double, inline n: Int): Double = // ok + inline if n == 0 then ??? else ??? + + inline val N = 10 + def X = 20 + + power(2.0, N) // ok, since it's a by-name parameter + power(2.0, X) // error: cannot reduce inline if + +} diff --git a/tests/neg/inlinevals-3.scala b/tests/neg/inlinevals-3.scala new file mode 100644 index 000000000000..8fa7a4270e4a --- /dev/null +++ b/tests/neg/inlinevals-3.scala @@ -0,0 +1,12 @@ +object Test { + + inline def power(x: Double, inline n: Int): Double = // ok + inline if n == 0 then ??? else ??? + + inline val N = 10 + def X = 20 + + power(2.0, N) // ok, since it's an inline parameter + power(2.0, X) // error: cannot reduce inline if + +} diff --git a/tests/neg/inlinevals-4.scala b/tests/neg/inlinevals-4.scala new file mode 100644 index 000000000000..b4d4bfdfb579 --- /dev/null +++ b/tests/neg/inlinevals-4.scala @@ -0,0 +1,13 @@ +object Test { + + inline def power(x: Double, inline n: Int): Double = // ok + inline if n == 0 then ??? else ??? + + inline val N = 10 + def X = 20 + + inline val M = X // error: rhs must be constant expression + + inline val xs = List(1, 2, 3) // error: must be a constant expression + +} diff --git a/tests/neg/inlinevals.scala b/tests/neg/inlinevals.scala index d3bd16df8ac1..02732975be80 100644 --- a/tests/neg/inlinevals.scala +++ b/tests/neg/inlinevals.scala @@ -2,9 +2,6 @@ object Test { def power0(x: Double, inline n: Int): Double = ??? // error: inline modifier can only be used for parameters of inline methods - inline def power(x: Double, inline n: Int): Double = // ok - inline if n == 0 then ??? else ??? - inline val N = 10 def X = 20 @@ -15,13 +12,6 @@ object Test { inline def bar: Int } - power(2.0, N) // ok, since it's a by-name parameter - power(2.0, X) // error: cannot reduce inline if - - inline val M = X // error: rhs must be constant expression - - inline val xs = List(1, 2, 3) // error: must be a constant expression - inline def foo(x: Int) = { def f(inline xs: List[Int]) = xs // error: inline modifier can only be used for parameters of inline methods diff --git a/tests/neg/mirror-implicit-scope.scala b/tests/neg/mirror-implicit-scope.scala index 88e909506bed..d8e5048fcd30 100644 --- a/tests/neg/mirror-implicit-scope.scala +++ b/tests/neg/mirror-implicit-scope.scala @@ -1,4 +1,4 @@ -import scala.deriving._ +import scala.deriving.* object Test { class SomeClass diff --git a/tests/neg/missing-implicit-2.scala b/tests/neg/missing-implicit-2.scala index bec1013dbd29..7a76cef05862 100644 --- a/tests/neg/missing-implicit-2.scala +++ b/tests/neg/missing-implicit-2.scala @@ -1,4 +1,4 @@ -import Predef.{byte2Byte => _, _} +import Predef.{byte2Byte as _, *} import scala.concurrent.Future val f = Future[Unit] { } // error diff --git a/tests/neg/missing-implicit-3.scala b/tests/neg/missing-implicit-3.scala index 618a33d88101..387efdb1b48d 100644 --- a/tests/neg/missing-implicit-3.scala +++ b/tests/neg/missing-implicit-3.scala @@ -1,4 +1,4 @@ -import Predef.{byte2Byte => _, _} +import Predef.{byte2Byte as _, *} import math.Numeric val DAYS = scala.concurrent.duration.DAYS diff --git a/tests/neg/missing-implicit.scala b/tests/neg/missing-implicit.scala index 2467fb3d8c20..3968eef97b22 100644 --- a/tests/neg/missing-implicit.scala +++ b/tests/neg/missing-implicit.scala @@ -1,4 +1,4 @@ -import Predef.{byte2Byte => _, _} +import Predef.{byte2Byte as _, *} import math.Numeric def consume[T: Numeric](xs: List[T], limit: T): List[T] = xs match diff --git a/tests/neg/multi-param-derives.scala b/tests/neg/multi-param-derives.scala index d428df806a9c..1e228bf38bcf 100644 --- a/tests/neg/multi-param-derives.scala +++ b/tests/neg/multi-param-derives.scala @@ -1,4 +1,4 @@ -import scala.deriving._ +import scala.deriving.* object Test extends App { { diff --git a/tests/neg/nopredef.scala b/tests/neg/nopredef.scala index 0079be41ee10..0a22e200805a 100644 --- a/tests/neg/nopredef.scala +++ b/tests/neg/nopredef.scala @@ -1,4 +1,4 @@ -import Predef.{assert => _} +import Predef.{assert as _} object Test { assert("asdf" == "asdf") // error: not found assert diff --git a/tests/neg/opaque-bounds.scala b/tests/neg/opaque-bounds.scala index 299d56c3e6e1..3eb03117e469 100644 --- a/tests/neg/opaque-bounds.scala +++ b/tests/neg/opaque-bounds.scala @@ -36,7 +36,7 @@ object Access { } object User { - import Access._ + import Access.* case class Item(rights: Permissions) diff --git a/tests/neg/opaque-id.scala b/tests/neg/opaque-id.scala index 8a46380762fb..e2ad769622d1 100644 --- a/tests/neg/opaque-id.scala +++ b/tests/neg/opaque-id.scala @@ -6,7 +6,7 @@ object Test { } } object Test2 { - import Test._ + import Test.* val x: T[Int] = 2 // error val y: Int = x // error } diff --git a/tests/neg/opaque-immutable-array.scala b/tests/neg/opaque-immutable-array.scala index 82e55eb21f5d..479477f37b6a 100644 --- a/tests/neg/opaque-immutable-array.scala +++ b/tests/neg/opaque-immutable-array.scala @@ -43,7 +43,7 @@ object ia { def xs: IArray[Long] = ??? } object Test { - import ia._ + import ia.* xs.length // error: not a member xs.apply(2) // error: not a member diff --git a/tests/neg/opaque.scala b/tests/neg/opaque.scala index f702b0047f2e..9478683e9345 100644 --- a/tests/neg/opaque.scala +++ b/tests/neg/opaque.scala @@ -49,7 +49,7 @@ object logs { } object Test { - import logs._ + import logs.* val l = Logarithm(2.0) val d: Double = l // error: found: Logarithm, required: Double val l2: Logarithm = 1.0 // error: found: Double, required: Logarithm diff --git a/tests/neg/overrides.scala b/tests/neg/overrides.scala index 590a7db61f6a..48f3260721e9 100644 --- a/tests/neg/overrides.scala +++ b/tests/neg/overrides.scala @@ -27,7 +27,7 @@ package p1 { } } package p2 { // all being in the same package compiles fine - import p1._ + import p1.* abstract class T2 extends T1 { class A { bug() diff --git a/tests/neg/parser-stability-10.scala b/tests/neg/parser-stability-10.scala index 005476163a3d..6414f63af360 100644 --- a/tests/neg/parser-stability-10.scala +++ b/tests/neg/parser-stability-10.scala @@ -8,7 +8,7 @@ def unapply(i1: Int)(i6: List[Int]): Int = { } } // error object i5 { - import collection.mutable._ + import collection.mutable.* try { ??? mutable { case i1(i5, i3, i4) => i5 }} // error } // error \ No newline at end of file diff --git a/tests/neg/parser-stability-23.scala b/tests/neg/parser-stability-23.scala index 2b46f582e819..d63059288b63 100644 --- a/tests/neg/parser-stability-23.scala +++ b/tests/neg/parser-stability-23.scala @@ -1,3 +1,3 @@ object i0 { - import Ordering.{ implicitly => } (true: Boolean) match { case _: i1 => true } // error // error // error + import Ordering.{ implicitly as } (true: Boolean) match { case _: i1 as true } // error // error // error } diff --git a/tests/neg/power2.scala b/tests/neg/power2.scala new file mode 100644 index 000000000000..cd7019b47b0d --- /dev/null +++ b/tests/neg/power2.scala @@ -0,0 +1,14 @@ +object Test { + + transparent inline def power(x: Double, n: Int): Double = + if (n == 0) 1.0 + else if (n == 1) x + else { + val y = power(x, n / 2) + if (n % 2 == 0) y * y else y * y * x + } + + def main(args: Array[String]): Unit = { + println(power(2.0, args.length)) // error: maximal number of inlines exceeded + } +} diff --git a/tests/neg/renaming-imports.scala b/tests/neg/renaming-imports.scala new file mode 100644 index 000000000000..35d661bac68b --- /dev/null +++ b/tests/neg/renaming-imports.scala @@ -0,0 +1,14 @@ +object a: + def * = 1 + def other = 2 + +def test = + object foo: + var x = 0 + import foo as f // error + f.x + + import a.`*` + println(*) // ok + println(other) // error +end test diff --git a/tests/neg/rootImplicits.scala b/tests/neg/rootImplicits.scala index f2f39392597f..f3cfd4b8a42b 100644 --- a/tests/neg/rootImplicits.scala +++ b/tests/neg/rootImplicits.scala @@ -1,6 +1,6 @@ package test -import Predef.{any2stringadd => _, StringAdd => _, _} +import Predef.{any2stringadd as _, StringAdd as _, *} object rootImplicits { diff --git a/tests/neg/shapeless-hcons.scala b/tests/neg/shapeless-hcons.scala index a38effea5d13..701c5c35a9a3 100644 --- a/tests/neg/shapeless-hcons.scala +++ b/tests/neg/shapeless-hcons.scala @@ -18,7 +18,7 @@ sealed trait HNil extends HList { case object HNil extends HNil } -import shapeless._ +import shapeless.* package test { diff --git a/tests/neg/singleton-ops-any.scala b/tests/neg/singleton-ops-any.scala index 2f4112dbe5e1..0d7c05b55fec 100644 --- a/tests/neg/singleton-ops-any.scala +++ b/tests/neg/singleton-ops-any.scala @@ -1,4 +1,4 @@ -import scala.compiletime.ops.any._ +import scala.compiletime.ops.any.* object Test { val t32: 1 == 1 = true diff --git a/tests/neg/singleton-ops-boolean.scala b/tests/neg/singleton-ops-boolean.scala index 407560cfde57..c7b132851191 100644 --- a/tests/neg/singleton-ops-boolean.scala +++ b/tests/neg/singleton-ops-boolean.scala @@ -1,4 +1,4 @@ -import scala.compiletime.ops.boolean._ +import scala.compiletime.ops.boolean.* object Test { val t0: ![true] = false diff --git a/tests/neg/singleton-ops-int.scala b/tests/neg/singleton-ops-int.scala index 8b0288dd0ea9..d2fd3a73afcd 100644 --- a/tests/neg/singleton-ops-int.scala +++ b/tests/neg/singleton-ops-int.scala @@ -1,4 +1,4 @@ -import scala.compiletime.ops.int._ +import scala.compiletime.ops.int.* object Test { summon[2 + 3 =:= 6 - 1] diff --git a/tests/neg/singleton-ops-match-type-scrutinee.scala b/tests/neg/singleton-ops-match-type-scrutinee.scala index ed749fa4718d..3b2e71f5bfa1 100644 --- a/tests/neg/singleton-ops-match-type-scrutinee.scala +++ b/tests/neg/singleton-ops-match-type-scrutinee.scala @@ -1,4 +1,4 @@ -import scala.compiletime.ops.int._ +import scala.compiletime.ops.int.* object Test { type Max2[A <: Int, B <: Int] <: Int = (A < B) match { diff --git a/tests/neg/singleton-ops-recursive-match-type.scala b/tests/neg/singleton-ops-recursive-match-type.scala index ca7161e8fcbf..311e397b2e1f 100644 --- a/tests/neg/singleton-ops-recursive-match-type.scala +++ b/tests/neg/singleton-ops-recursive-match-type.scala @@ -1,4 +1,4 @@ -import scala.compiletime.ops.int._ +import scala.compiletime.ops.int.* object Test { type GCD[A <: Int, B <: Int] <: Int = B match { diff --git a/tests/neg/singleton-ops-string.scala b/tests/neg/singleton-ops-string.scala index 9d3b83808092..46093121d3c4 100644 --- a/tests/neg/singleton-ops-string.scala +++ b/tests/neg/singleton-ops-string.scala @@ -1,4 +1,4 @@ -import scala.compiletime.ops.string._ +import scala.compiletime.ops.string.* object Test { val t0: "Hello " + "world" = "Hello world" diff --git a/tests/neg/singleton-ops-type-alias.scala b/tests/neg/singleton-ops-type-alias.scala index 6b32ca93e338..da24cbe29a79 100644 --- a/tests/neg/singleton-ops-type-alias.scala +++ b/tests/neg/singleton-ops-type-alias.scala @@ -1,4 +1,4 @@ -import scala.compiletime.ops.boolean._ +import scala.compiletime.ops.boolean.* object Test { type Xor[A <: Boolean, B <: Boolean] = (A && ![B]) || (![A] && B) diff --git a/tests/neg/t6810.scala b/tests/neg/t6810.scala index ff353bb08f1d..1a31a7b9926f 100644 --- a/tests/neg/t6810.scala +++ b/tests/neg/t6810.scala @@ -18,7 +18,7 @@ trait t6810 { val B = s""" """ // or the same for interpolated strings - import System.{lineSeparator => EOL} + import System.{lineSeparator as EOL} val `\u000A` = EOL // backquoted identifiers are arbitrary string literals // anypos-error so as not to interfere with the following bad syntax val ` @@ -27,7 +27,8 @@ trait t6810 { val firebreak = 42 // help parser recovery, could also use rbrace val a = '\u000D' // similar treatment of CR - val b = ' ' // anypos-error CR seen as EOL by scanner; FSR, error only on open quote, unlike `y` + val b = ' +' // anypos-error CR seen as EOL by scanner; FSR, error only on open quote, unlike `y` println(); // scanner firewall val c = '\r' // traditionally } diff --git a/tests/neg/t7239.scala b/tests/neg/t7239.scala index f3a379b4eba5..046fa39fa9ae 100644 --- a/tests/neg/t7239.scala +++ b/tests/neg/t7239.scala @@ -21,12 +21,12 @@ object Test { BrokenMethod().filter(_ => true) // ok locally { - import addWithFilter._ + import addWithFilter.* BrokenMethod().withFilter((_: (Int, String)) => true) // error } locally { - import addWithFilter._ + import addWithFilter.* // adaptToMemberWithArgs sets the type of the tree `x` // to ErrorType (while in silent mode, so the error is not // reported. Later, when the fallback from `withFilter` diff --git a/tests/neg/tagging.scala b/tests/neg/tagging.scala index addf283aec05..548770870981 100644 --- a/tests/neg/tagging.scala +++ b/tests/neg/tagging.scala @@ -38,7 +38,7 @@ object tagging { trait Fathom } object test { - import tagging._ + import tagging.* val x: Double @@ Meter = (1e7).tag[Meter] val y: Double @@ Foot = (123.0).tag[Foot] diff --git a/tests/neg/toplevel-privates/Test_2.scala b/tests/neg/toplevel-privates/Test_2.scala index c2120e2fbd86..4514e820f8f3 100644 --- a/tests/neg/toplevel-privates/Test_2.scala +++ b/tests/neg/toplevel-privates/Test_2.scala @@ -1,6 +1,6 @@ package q -import p._ +import p.* val x1 = x // error: not found diff --git a/tests/neg/unsound-union-gadt.scala b/tests/neg/unsound-union-gadt.scala index 9412f1581e1a..703d4a56e3dc 100644 --- a/tests/neg/unsound-union-gadt.scala +++ b/tests/neg/unsound-union-gadt.scala @@ -3,7 +3,7 @@ object Test { case StrLit() extends Expr[String] case IntLit() extends Expr[Int] } - import Expr._ + import Expr.* def foo[T](e: Expr[T]) = e match { case _: (StrLit | IntLit) => diff --git a/tests/new/imports-pos.scala b/tests/new/imports-pos.scala index f6a55e5e07e7..a9b90dbf4527 100644 --- a/tests/new/imports-pos.scala +++ b/tests/new/imports-pos.scala @@ -1,9 +1,9 @@ package test; -import java.lang.{System => S} +import java.lang.System as S object test { - import S.out.{print => p, println => print} + import S.out.{print as p, println as print} val foo = 1; diff --git a/tests/new/looping-jsig.scala b/tests/new/looping-jsig.scala index 6e3313c463bc..18777ed121b4 100644 --- a/tests/new/looping-jsig.scala +++ b/tests/new/looping-jsig.scala @@ -1,4 +1,4 @@ -import scala.collection.mutable._ +import scala.collection.mutable.* trait BugTrack { trait B[+T] diff --git a/tests/patmat/3455.scala b/tests/patmat/3455.scala index 720b45bc08a7..0359c280d585 100644 --- a/tests/patmat/3455.scala +++ b/tests/patmat/3455.scala @@ -7,7 +7,7 @@ trait AxisCompanion { } object Axis extends AxisCompanion class Axis { - import Axis._ + import Axis.* def test( f: Format ) = f match { case Format.Integer => "Int" } diff --git a/tests/patmat/enum-HList.scala b/tests/patmat/enum-HList.scala index c019cb6cc78c..476b4a3284af 100644 --- a/tests/patmat/enum-HList.scala +++ b/tests/patmat/enum-HList.scala @@ -4,7 +4,7 @@ enum HLst { } object Test { - import HLst._ + import HLst.* def length(hl: HLst): Int = hl match { case HCons(_, tl) => 1 + length(tl) case HNil => 0 diff --git a/tests/patmat/enum-Tree.scala b/tests/patmat/enum-Tree.scala index 25993f459875..fca17947c719 100644 --- a/tests/patmat/enum-Tree.scala +++ b/tests/patmat/enum-Tree.scala @@ -9,7 +9,7 @@ enum Tree[T] { } object Test { - import Tree._ + import Tree.* def eval[T](e: Tree[T]): T = e match { case True => true diff --git a/tests/patmat/enum-approx.scala b/tests/patmat/enum-approx.scala index b29d5ad9d148..7f1f88db99a4 100644 --- a/tests/patmat/enum-approx.scala +++ b/tests/patmat/enum-approx.scala @@ -19,7 +19,7 @@ object Test { assert(Fun.ConstNullSimple.f == null) } - import Fun._ + import Fun.* def f[T, U >: Null](f: Fun[T, U]): T => U = f match { case Identity(g) => g diff --git a/tests/patmat/enum/patmat-enum.scala b/tests/patmat/enum/patmat-enum.scala index ec5c90255f7a..a22d5a5a5ed5 100644 --- a/tests/patmat/enum/patmat-enum.scala +++ b/tests/patmat/enum/patmat-enum.scala @@ -9,7 +9,7 @@ object Test1 { } object Test2 { - import Day._ + import Day.* val day: Day = ??? day match { diff --git a/tests/patmat/enumColor.scala b/tests/patmat/enumColor.scala index 60d610d0d7cf..10156b906393 100644 --- a/tests/patmat/enumColor.scala +++ b/tests/patmat/enumColor.scala @@ -4,7 +4,7 @@ object Test { def f(color: Color) = { - import Color._ + import Color.* color match { case Red | Green | Blue => } diff --git a/tests/patmat/i10085.scala b/tests/patmat/i10085.scala index 314f4253cde8..84b34a334ac8 100644 --- a/tests/patmat/i10085.scala +++ b/tests/patmat/i10085.scala @@ -2,13 +2,13 @@ enum Bool: case True case False -import Bool._ +import Bool.* enum SBool[B <: Bool]: case STrue extends SBool[True.type] case SFalse extends SBool[False.type] -import SBool._ +import SBool.* def f(b: SBool[True.type]): Unit = b match case STrue => () diff --git a/tests/patmat/i3938.scala b/tests/patmat/i3938.scala index 0a6395b0a727..6658903d033d 100644 --- a/tests/patmat/i3938.scala +++ b/tests/patmat/i3938.scala @@ -21,7 +21,7 @@ class Foo { class Test { val foo = new Foo - import foo.bar._ + import foo.bar.* def h(a: A) = { a match { diff --git a/tests/patmat/i7186.scala b/tests/patmat/i7186.scala index d34945bed756..d828cc78b070 100644 --- a/tests/patmat/i7186.scala +++ b/tests/patmat/i7186.scala @@ -1,4 +1,4 @@ -import MIPS._ +import MIPS.* import deriving.Mirror.SumOf @@ -79,14 +79,14 @@ enum PseudoUnary { case class Comment(msg: String) object printMips { - import MIPS._ - import Misc._ - import PseudoZero._ - import PseudoUnary._ - import ZeroAddr._ - import OneAddr._ - import TwoAddr._ - import ThreeAddr._ + import MIPS.* + import Misc.* + import PseudoZero.* + import PseudoUnary.* + import ZeroAddr.* + import OneAddr.* + import TwoAddr.* + import ThreeAddr.* private val endl = System.lineSeparator diff --git a/tests/patmat/i8922.scala b/tests/patmat/i8922.scala index 946b1834998f..132cb359e6aa 100644 --- a/tests/patmat/i8922.scala +++ b/tests/patmat/i8922.scala @@ -15,8 +15,8 @@ enum Expr { } object Interpreter: - import Expr._ - import TokenType._ + import Expr.* + import TokenType.* def eval(expr: Expr): String | Int | Double | Boolean | Unit = expr match diff --git a/tests/patmat/i8922c.scala b/tests/patmat/i8922c.scala index 63d968c80345..ef5b72ec993d 100644 --- a/tests/patmat/i8922c.scala +++ b/tests/patmat/i8922c.scala @@ -15,8 +15,8 @@ enum Expr { } object Interpreter: - import Expr._ - import TokenType._ + import Expr.* + import TokenType.* def eval(expr: Expr): String | Int | Double | Boolean | Unit = expr match diff --git a/tests/patmat/i9489.scala b/tests/patmat/i9489.scala index ef24a4b4c553..234c2f7e9f05 100644 --- a/tests/patmat/i9489.scala +++ b/tests/patmat/i9489.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def summonTypedType[T : Type](using Quotes): String = Type.of[T] match { case '[Boolean] => "Boolean" diff --git a/tests/patmat/i9489b.scala b/tests/patmat/i9489b.scala index c75b125122ad..ee5e3d35a5bf 100644 --- a/tests/patmat/i9489b.scala +++ b/tests/patmat/i9489b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def summonTypedType[T : Type](using Quotes): String = '{ ??? : T } match { case '{ $_ : Boolean } => "Boolean" diff --git a/tests/patmat/i9841.scala b/tests/patmat/i9841.scala index 928cacd999e8..31e5b89aeeb2 100644 --- a/tests/patmat/i9841.scala +++ b/tests/patmat/i9841.scala @@ -6,7 +6,7 @@ object Impl { } trait Impl[T <: Txn[T], K] { - import Impl._ + import Impl.* def put[A](): Unit = { val opt: Option[Entry[T, A]] = ??? diff --git a/tests/patmat/planets.scala b/tests/patmat/planets.scala index 2c4f31b17ca3..d6ee4b5d00ef 100644 --- a/tests/patmat/planets.scala +++ b/tests/patmat/planets.scala @@ -14,7 +14,7 @@ enum Planet(mass: Double, radius: Double) { } object Test { def main(args: Array[String]) = { - import Planet._ + import Planet.* assert(valueOf("SATURN") == SATURN) val earthWeight = 100 val mass = earthWeight/EARTH.surfaceGravity diff --git a/tests/patmat/sealed-java-enums.scala b/tests/patmat/sealed-java-enums.scala index 2daf93f3088d..33d6ea495907 100644 --- a/tests/patmat/sealed-java-enums.scala +++ b/tests/patmat/sealed-java-enums.scala @@ -1,5 +1,5 @@ import java.lang.Thread.State -import java.lang.Thread.State._ +import java.lang.Thread.State.* object Test { def f(state: State) = state match { diff --git a/tests/patmat/t11620b.scala b/tests/patmat/t11620b.scala index 40fb444b0499..a71f9ee4ade5 100644 --- a/tests/patmat/t11620b.scala +++ b/tests/patmat/t11620b.scala @@ -5,7 +5,7 @@ object Length { case object StateColumn extends Length } -import Length._ +import Length.* case class Indent[T <: Length](length: T) diff --git a/tests/patmat/t2442/t2442.scala b/tests/patmat/t2442/t2442.scala index b0a0f3cd4145..4350a489576e 100644 --- a/tests/patmat/t2442/t2442.scala +++ b/tests/patmat/t2442/t2442.scala @@ -1,5 +1,5 @@ class Test { - import MyEnum._ + import MyEnum.* def f(e: MyEnum) = e match { case ONE => println("one") @@ -7,7 +7,7 @@ class Test { // missing case --> exhaustivity warning! } - import MySecondEnum._ + import MySecondEnum.* def g(e: MySecondEnum) = e match { case RED => println("red") // missing case --> exhaustivity warning! diff --git a/tests/patmat/t4661.scala b/tests/patmat/t4661.scala index e87490457ddf..6e13298bef4f 100644 --- a/tests/patmat/t4661.scala +++ b/tests/patmat/t4661.scala @@ -20,7 +20,7 @@ trait Prefix { } class TestPrefix(val p: Prefix) { - import p._ + import p.* def test(b: Bar) = b match { case b: Bar => case b: BarOne => // unreachable diff --git a/tests/patmat/t4661b.scala b/tests/patmat/t4661b.scala index 84bb802036da..ee95ff08ca07 100644 --- a/tests/patmat/t4661b.scala +++ b/tests/patmat/t4661b.scala @@ -6,7 +6,7 @@ class C { } class Test(val c: C) { - import c._ + import c.* def test(f: Foo) = f match { // not exhaustive case f: One => case f: Two => diff --git a/tests/patmat/t6146.scala b/tests/patmat/t6146.scala index b5bde826b1c1..e2d1070110ec 100644 --- a/tests/patmat/t6146.scala +++ b/tests/patmat/t6146.scala @@ -15,7 +15,7 @@ trait AxisCompanion { } object Axis extends AxisCompanion class Axis { - import Axis._ + import Axis.* def test( f: Format ) = f match { case Format.Integer => "Int" // case Format.Time( hours, millis ) => "Time" @@ -47,7 +47,7 @@ object O1 extends T1[Any] { case object Shorty extends O1.O2.Format class Test1 { - import O1.O2._ + import O1.O2.* val FI: Format.Integer.type = Format.Integer def test( f: Format ) = { val ff: f.type = f diff --git a/tests/patmat/t6582_exhaust_big.scala b/tests/patmat/t6582_exhaust_big.scala index dd639eb56ee0..4c0b45b49f7a 100644 --- a/tests/patmat/t6582_exhaust_big.scala +++ b/tests/patmat/t6582_exhaust_big.scala @@ -23,7 +23,7 @@ object Z { } object Test { - import Z._ + import Z.* def foo(z: Z) = z match { case Z0 | Z1() | Z2 | Z3() | Z4 | Z5() | Z6 | Z7() | Z8 | Z9() | Z10 | Z12 | Z13() | Z14 | Z15() | Z16 | Z17() | Z18 | Z19() diff --git a/tests/patmat/t7285.scala b/tests/patmat/t7285.scala index d40df7fe8919..e79b8c334bd2 100644 --- a/tests/patmat/t7285.scala +++ b/tests/patmat/t7285.scala @@ -46,7 +46,7 @@ object Test4 { case object Up extends Base } - import Test4.Base._ + import Test4.Base.* def foo(d1: Base, d2: Base) = (d1, d2) match { case (Up, Up) | (Down, Down) => false diff --git a/tests/patmat/t7285a.scala b/tests/patmat/t7285a.scala index 49f6b663b28c..9cb33bf47ca2 100644 --- a/tests/patmat/t7285a.scala +++ b/tests/patmat/t7285a.scala @@ -73,7 +73,7 @@ object Test4 { } } - import Test4.Base._ + import Test4.Base.* def foo(d1: Base, d2: Base) = (d1, d2) match { case (Up, Up) | (Down, Down) => false diff --git a/tests/patmat/t9672.scala b/tests/patmat/t9672.scala index fe068f3d5e78..d29d270acddc 100644 --- a/tests/patmat/t9672.scala +++ b/tests/patmat/t9672.scala @@ -18,7 +18,7 @@ object SimpleExpr extends Hierarchy with If with Word with IntExpr //object OtherExpr extends Hierarchy with If with IntExpr object Demo extends App { - import SimpleExpr._ + import SimpleExpr.* def func(expr: Expr) = expr match { case If(cond, yes, no) => cond case Word(name) => name diff --git a/tests/pending/pos/cps-async-failure.scala b/tests/pending/pos/cps-async-failure.scala index 9f8da4c7f8b8..bf6a586123b2 100644 --- a/tests/pending/pos/cps-async-failure.scala +++ b/tests/pending/pos/cps-async-failure.scala @@ -1,10 +1,10 @@ -import scala.quoted._ +import scala.quoted.* trait App[F[_],CT]: this: Base[F,CT] => - import quotes.reflect._ + import quotes.reflect.* trait AA diff --git a/tests/pending/pos/overloaded_extractor_and_regular_def.scala b/tests/pending/pos/overloaded_extractor_and_regular_def.scala index 72b9f65d8480..fb11826528e3 100644 --- a/tests/pending/pos/overloaded_extractor_and_regular_def.scala +++ b/tests/pending/pos/overloaded_extractor_and_regular_def.scala @@ -24,7 +24,7 @@ class Universe extends TreesApi { object Test extends App { def foo(tapi: TreesApi): Unit = { - import tapi._ + import tapi.* def bar(tree: Tree): Unit = { val Apply(x) = tree } diff --git a/tests/pending/pos/t7232b/Test.scala b/tests/pending/pos/t7232b/Test.scala index 6377e26becc5..b1399c84e988 100644 --- a/tests/pending/pos/t7232b/Test.scala +++ b/tests/pending/pos/t7232b/Test.scala @@ -1,5 +1,5 @@ object Test { - import pack._ + import pack.* Foo.list().packList() } diff --git a/tests/pending/pos/t8146b.scala b/tests/pending/pos/t8146b.scala index 1a65ed518e4c..bc693ccfc7a2 100644 --- a/tests/pending/pos/t8146b.scala +++ b/tests/pending/pos/t8146b.scala @@ -42,7 +42,7 @@ object syntax { class HListBench { - import syntax._ + import syntax.* implicit def columnShape[T, Level <: ShapeLevel]: Shape[Level, Column[T], T, Column[T]] = ??? implicit def provenShape[T, P](implicit shape: Shape[_ <: FlatShapeLevel, T, _, P]): Shape[FlatShapeLevel, ProvenShape[T], T, P] = ??? diff --git a/tests/pending/run/concurrent-stream.scala b/tests/pending/run/concurrent-stream.scala index 8946a85fd182..bdf9b05861a4 100644 --- a/tests/pending/run/concurrent-stream.scala +++ b/tests/pending/run/concurrent-stream.scala @@ -17,7 +17,7 @@ object Test { } def testCons(cons: (Int, => Stream[Int]) => Stream[Int]): Unit = { - import scala.actors.Actor._ + import scala.actors.Actor.* val stream = slowRange(0, 10, cons) val main = self diff --git a/tests/pending/run/elidable-opt.scala b/tests/pending/run/elidable-opt.scala index 7f3b8011dbeb..62d19acc7dfe 100644 --- a/tests/pending/run/elidable-opt.scala +++ b/tests/pending/run/elidable-opt.scala @@ -1,5 +1,5 @@ -import annotation._ -import elidable._ +import annotation.* +import elidable.* trait T { @elidable(FINEST) def f1(): Unit diff --git a/tests/pending/run/elidable.scala b/tests/pending/run/elidable.scala index 7f3b8011dbeb..62d19acc7dfe 100644 --- a/tests/pending/run/elidable.scala +++ b/tests/pending/run/elidable.scala @@ -1,5 +1,5 @@ -import annotation._ -import elidable._ +import annotation.* +import elidable.* trait T { @elidable(FINEST) def f1(): Unit diff --git a/tests/pending/run/imain.scala b/tests/pending/run/imain.scala index cc939e39fd6d..ac8a44d87d75 100644 --- a/tests/pending/run/imain.scala +++ b/tests/pending/run/imain.scala @@ -1,6 +1,6 @@ object Test { - import scala.tools.nsc._ - import interpreter._ + import scala.tools.nsc.* + import interpreter.* import java.io.PrintWriter class NullOutputStream extends OutputStream { def write(b: Int): Unit = { } } diff --git a/tests/pending/run/partialfun.scala b/tests/pending/run/partialfun.scala index 68f8c8c92682..fcbcd2386f81 100644 --- a/tests/pending/run/partialfun.scala +++ b/tests/pending/run/partialfun.scala @@ -1,5 +1,5 @@ -import collection._ -import collection.generic._ +import collection.* +import collection.generic.* object Test { def collectIDA[A, B, Repr, That](_this: TraversableLike[A, Repr])(pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = { diff --git a/tests/pending/run/patmat-behavior.scala b/tests/pending/run/patmat-behavior.scala index 0129a23e10a9..35df7d31230d 100644 --- a/tests/pending/run/patmat-behavior.scala +++ b/tests/pending/run/patmat-behavior.scala @@ -29,7 +29,7 @@ package s { object G11 { def unapplySeq[A](x: C11[A]): Option[(A, Seq[A])] = ??? } object G21 { def unapplySeq[A](x: C21[A]): Option[(A, A, Seq[A])] = ??? } } -import s._ +import s.* package pos { object Test { diff --git a/tests/pending/run/patmat-exprs.scala b/tests/pending/run/patmat-exprs.scala index 78e1811169bc..daebb1a1513e 100644 --- a/tests/pending/run/patmat-exprs.scala +++ b/tests/pending/run/patmat-exprs.scala @@ -1,10 +1,10 @@ -import scala.language.{ implicitConversions } +import scala.language.implicitConversions import runtime.ScalaRunTime object Test { val p = new Pattern { } - import p._ + import p.* implicit object IntOps extends NumericOps[Int] { def zero = 0 def one = 1 @@ -108,7 +108,7 @@ trait Pattern { trait Expr[T] { - import Expr._ + import Expr.* /** Evaluates value of the expression. */ def eval(context: Any => Any): T diff --git a/tests/pending/run/patmatnew.scala b/tests/pending/run/patmatnew.scala index 218e60671199..d81f8698258e 100644 --- a/tests/pending/run/patmatnew.scala +++ b/tests/pending/run/patmatnew.scala @@ -1,5 +1,5 @@ -import scala.language.{ postfixOps } +import scala.language.postfixOps object Test { diff --git a/tests/pending/run/pf-catch.scala b/tests/pending/run/pf-catch.scala index 4f515357242c..8eccfeb5ea25 100644 --- a/tests/pending/run/pf-catch.scala +++ b/tests/pending/run/pf-catch.scala @@ -1,5 +1,5 @@ -import scala.language.{ postfixOps } +import scala.language.postfixOps object Test { def shortName(x: AnyRef) = x.getClass.getName split '.' last type Handler[+T] = PartialFunction[Throwable, T] diff --git a/tests/pending/run/private-inline.scala b/tests/pending/run/private-inline.scala index 60fef9efca30..b2cec09355e4 100644 --- a/tests/pending/run/private-inline.scala +++ b/tests/pending/run/private-inline.scala @@ -34,7 +34,7 @@ object Test { def main(args: Array[String]): Unit = { val a = new A - import a._ + import a.* println(f1a() + f1b() + f2a() + f2b()) // Don't know how else to test this: all these should have been diff --git a/tests/pending/run/reflection-names.scala b/tests/pending/run/reflection-names.scala index a297b85825b5..dd145653adef 100644 --- a/tests/pending/run/reflection-names.scala +++ b/tests/pending/run/reflection-names.scala @@ -1,8 +1,8 @@ -import scala.tools.nsc._ +import scala.tools.nsc.* object Test { val global = new Global(new Settings()) - import global._ + import global.* val x1 = "abc" drop 1 // "bc": String val x2 = TermName("abc") drop 1 // "bc": TermName diff --git a/tests/pending/run/sequenceComparisons.scala b/tests/pending/run/sequenceComparisons.scala index b0564aad4d2c..14eceaf18b9e 100644 --- a/tests/pending/run/sequenceComparisons.scala +++ b/tests/pending/run/sequenceComparisons.scala @@ -100,7 +100,7 @@ object Test { def runSeqs() = { for (s1f <- seqMakers ; s2f <- seqMakers ; testData <- List(test1)) { - import testData._ + import testData.* val scrut = s1f(seq) for (Method(f, (trueList, falseList), descr) <- methodList) { diff --git a/tests/pending/run/settings-parse.scala b/tests/pending/run/settings-parse.scala index 2754feb97208..b35ddf1a3d89 100644 --- a/tests/pending/run/settings-parse.scala +++ b/tests/pending/run/settings-parse.scala @@ -1,6 +1,6 @@ import scala.language.postfixOps -import scala.tools.nsc._ +import scala.tools.nsc.* object Test { val tokens = List("", "-deprecation", "foo.scala") diff --git a/tests/pending/run/synchronized.scala b/tests/pending/run/synchronized.scala index d5f6d8651087..af8fda306ddb 100644 --- a/tests/pending/run/synchronized.scala +++ b/tests/pending/run/synchronized.scala @@ -20,7 +20,7 @@ object Util { } class C1 { - import Util._ + import Util.* val lock = new AnyRef @@ -108,7 +108,7 @@ class C1 { } object O1 { - import Util._ + import Util.* val lock = new AnyRef @@ -196,7 +196,7 @@ object O1 { } trait T { - import Util._ + import Util.* val Tclass = Class.forName("T$class") diff --git a/tests/pending/run/t1195-old.scala b/tests/pending/run/t1195-old.scala index f80734c22868..ce9d132d425e 100644 --- a/tests/pending/run/t1195-old.scala +++ b/tests/pending/run/t1195-old.scala @@ -1,5 +1,5 @@ -import scala.language.{ existentials } +import scala.language.existentials object Test { def f() = { case class Bar(x: Int); Bar } diff --git a/tests/pending/run/t1427.scala b/tests/pending/run/t1427.scala index 4784fad8ba52..f6c7914acae7 100644 --- a/tests/pending/run/t1427.scala +++ b/tests/pending/run/t1427.scala @@ -1,5 +1,5 @@ -import scala.language.{ higherKinds } +import scala.language.higherKinds class Bob[K[_]] { def foo(other: Any) = other match { diff --git a/tests/pending/run/t1500.scala b/tests/pending/run/t1500.scala index 743a9216727c..3af1bb5daf13 100644 --- a/tests/pending/run/t1500.scala +++ b/tests/pending/run/t1500.scala @@ -1,30 +1,30 @@ -import scala.tools.nsc._ +import scala.tools.nsc.* object Test { - + /** * Type inference overlooks constraints posed by type parameters in annotations on types. */ - + val testCode = """ - + class posingAs[A] extends annotation.TypeConstraint - + def resolve[A,B](x: A @posingAs[B]): B = x.asInstanceOf[B] - + val x = resolve(7: @posingAs[Any]) - + """ - + def main(args: Array[String]): Unit = { - + val settings = new Settings() settings.classpath.value = System.getProperty("java.class.path") val tool = new interpreter.IMain(settings) val global = tool.global - import global._ - import definitions._ + import global.* + import definitions.* object checker extends AnnotationChecker { @@ -35,11 +35,11 @@ object Test { } } - + global.addAnnotationChecker(checker) - + tool.interpret(testCode) - + } } diff --git a/tests/pending/run/t1501.scala b/tests/pending/run/t1501.scala index 7a9a695d883d..c91f9467259c 100644 --- a/tests/pending/run/t1501.scala +++ b/tests/pending/run/t1501.scala @@ -1,15 +1,15 @@ -import scala.tools.nsc._ +import scala.tools.nsc._ object Test { - + /** * ... */ - + val testCode = """ - + class xyz[A] extends annotation.TypeConstraint - + def loopWhile[T](cond: =>Boolean)(body: =>(Unit @xyz[T])): Unit @ xyz[T] = {{ if (cond) {{ body @@ -24,17 +24,17 @@ object Test { (): @xyz[Int] }} }} - + """ - + def main(args: Array[String]): Unit = { val settings = new Settings() settings.classpath.value = System.getProperty("java.class.path") val tool = new interpreter.IMain(settings) val global = tool.global - import global._ - import definitions._ + import global.* + import definitions.* object checker extends AnnotationChecker { @@ -45,11 +45,11 @@ object Test { } } - + global.addAnnotationChecker(checker) - + tool.interpret(testCode) - + } } diff --git a/tests/pending/run/t3346e.scala b/tests/pending/run/t3346e.scala index e74f29f8935d..c7646d6837fd 100644 --- a/tests/pending/run/t3346e.scala +++ b/tests/pending/run/t3346e.scala @@ -16,7 +16,7 @@ class QuickSort[Coll](a: Coll) { def quickSortAnything[T](implicit ev0: Coll => TraversableLike[T, Coll], cbf: CanBuildFrom[Coll, T, Coll], n: Ordering[T]): Coll = { - import n._ + import n.* if (a.size < 2) { a } else { @@ -55,7 +55,7 @@ object MyEnhancements { object Test extends App { - import MyEnhancements._ + import MyEnhancements.* println("qwe".quickSort) println(Array(2, 0).quickSort.toList) diff --git a/tests/pending/run/t4426.scala b/tests/pending/run/t4426.scala index 1cbd42da252d..1f6a6afc759d 100644 --- a/tests/pending/run/t4426.scala +++ b/tests/pending/run/t4426.scala @@ -1,4 +1,4 @@ -import scala.tools.nsc._ +import scala.tools.nsc.* object Test { val x = { diff --git a/tests/pending/run/t4461.scala b/tests/pending/run/t4461.scala index 0fd82265bb6e..fbe4fe2ffb26 100644 --- a/tests/pending/run/t4461.scala +++ b/tests/pending/run/t4461.scala @@ -1,5 +1,5 @@ -import scala.collection.mutable._ -import scala.collection.script._ +import scala.collection.mutable.* +import scala.collection.script.* // #4461 diff --git a/tests/pending/run/t5018.scala b/tests/pending/run/t5018.scala index 147d69cf867a..49dbeb32ef65 100644 --- a/tests/pending/run/t5018.scala +++ b/tests/pending/run/t5018.scala @@ -1,8 +1,8 @@ -import java.io._ -import collection._ +import java.io.* +import collection.* diff --git a/tests/pending/run/t5134.scala b/tests/pending/run/t5134.scala index 384442fda289..2bfd4969f0c6 100644 --- a/tests/pending/run/t5134.scala +++ b/tests/pending/run/t5134.scala @@ -1,4 +1,4 @@ -import language._ +import language.* object Test extends App { def b = new AnyRef { diff --git a/tests/pending/run/t5500.scala b/tests/pending/run/t5500.scala index 881a83ca9bd7..c15c216fc485 100644 --- a/tests/pending/run/t5500.scala +++ b/tests/pending/run/t5500.scala @@ -1,4 +1,4 @@ -import scala.{specialized => spec} +import scala.{specialized as spec} class C1[@spec(Int, AnyRef) A, @spec(Int, AnyRef) B](v:A, w:B) diff --git a/tests/pending/run/t5500b.scala b/tests/pending/run/t5500b.scala index 0d8edc094775..16f360d2b1d1 100644 --- a/tests/pending/run/t5500b.scala +++ b/tests/pending/run/t5500b.scala @@ -1,4 +1,4 @@ -import scala.{specialized => spec} +import scala.{specialized as spec} class C1A[ @spec(Double, Int, AnyRef) A, diff --git a/tests/pending/run/t6308.scala b/tests/pending/run/t6308.scala index 62983abe57f9..f03ccd8ea4e4 100644 --- a/tests/pending/run/t6308.scala +++ b/tests/pending/run/t6308.scala @@ -1,4 +1,4 @@ -import scala.{specialized => sp} +import scala.{specialized as sp} // NOTE: `{ val c = caller; print(""); c }` is used instead of a simple `caller`, // because we want to prevent tail-call optimization from eliding the stack- diff --git a/tests/pending/run/t6327.scala b/tests/pending/run/t6327.scala index 7683101f1424..e5fabb613aeb 100644 --- a/tests/pending/run/t6327.scala +++ b/tests/pending/run/t6327.scala @@ -1,4 +1,4 @@ -import language._ +import language.* object Test extends App { diff --git a/tests/pending/run/t657.scala b/tests/pending/run/t657.scala index ea2b008b3831..f936f6350431 100644 --- a/tests/pending/run/t657.scala +++ b/tests/pending/run/t657.scala @@ -1,5 +1,5 @@ -import scala.language.{ implicitConversions } +import scala.language.implicitConversions abstract class BaseList { type Node <: NodeImpl; implicit def convertNode(ni : NodeImpl): BaseList.this.Node = ni.asInstanceOf[Node]; diff --git a/tests/pending/run/t6935.scala b/tests/pending/run/t6935.scala index fdaf02e5ce3b..6a5a1971f667 100644 --- a/tests/pending/run/t6935.scala +++ b/tests/pending/run/t6935.scala @@ -1,7 +1,7 @@ object Test { def main(args: Array[String]): Unit = { - import java.io._ + import java.io.* val bytes = new ByteArrayOutputStream() val out = new ObjectOutputStream(bytes) out.writeObject(()) diff --git a/tests/pending/run/t7700.scala b/tests/pending/run/t7700.scala index 76d16b808c52..06340a738b4e 100644 --- a/tests/pending/run/t7700.scala +++ b/tests/pending/run/t7700.scala @@ -1,4 +1,4 @@ -import scala.annotation._ +import scala.annotation.* trait C[@specialized U] { @unspecialized diff --git a/tests/pending/run/t7715.scala b/tests/pending/run/t7715.scala index 0ad39130163e..6c39786725c8 100644 --- a/tests/pending/run/t7715.scala +++ b/tests/pending/run/t7715.scala @@ -1,6 +1,6 @@ import PartialFunction.cond -import util._ +import util.* object Test extends App { diff --git a/tests/pending/run/tasty-comments/quoted_1.scala b/tests/pending/run/tasty-comments/quoted_1.scala index 60de1ef1c2d5..7501fe0d3cec 100644 --- a/tests/pending/run/tasty-comments/quoted_1.scala +++ b/tests/pending/run/tasty-comments/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -7,7 +7,7 @@ object Macros { ${ impl('t) } def impl[T](x: Expr[T])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val tree = x.asTerm tree.symbol.comment.map(_.raw) match { diff --git a/tests/pending/run/tasty-comments/quoted_2.scala b/tests/pending/run/tasty-comments/quoted_2.scala index e426a5f4cd22..66b757033937 100644 --- a/tests/pending/run/tasty-comments/quoted_2.scala +++ b/tests/pending/run/tasty-comments/quoted_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/pending/run/treePrint.scala b/tests/pending/run/treePrint.scala index 8bbf645faebb..eef4f59a5a79 100644 --- a/tests/pending/run/treePrint.scala +++ b/tests/pending/run/treePrint.scala @@ -1,8 +1,8 @@ /** Testing compact tree printers. */ object Test { - import scala.tools.nsc._ - import interpreter._ + import scala.tools.nsc.* + import interpreter.* import java.io.{ OutputStream, BufferedReader, StringReader, PrintWriter, Writer, OutputStreamWriter} val code = """ diff --git a/tests/plugins/custom/analyzer/Analyzer_1.scala b/tests/plugins/custom/analyzer/Analyzer_1.scala index 8c7cea47f0f6..1a42119f8878 100644 --- a/tests/plugins/custom/analyzer/Analyzer_1.scala +++ b/tests/plugins/custom/analyzer/Analyzer_1.scala @@ -8,21 +8,21 @@ package analyzer import scala.language.implicitConversions -import dotty.tools.dotc._ -import core._ +import dotty.tools.dotc.* +import core.* import Contexts.Context -import plugins._ +import plugins.* import Phases.Phase import ast.tpd import transform.MegaPhase.MiniPhase -import Decorators._ +import Decorators.* import Symbols.{Symbol, requiredPackage} import Constants.Constant -import Types._ +import Types.* import transform.{PickleQuotes, FirstTransform} class SetDefTree extends PluginPhase { - import tpd._ + import tpd.* override val phaseName: String = SetDefTree.name override def runsAfter: Set[String] = Set(PickleQuotes.name) @@ -42,7 +42,7 @@ object SetDefTree { } class InitChecker extends PluginPhase with StandardPlugin { - import tpd._ + import tpd.* val name: String = "initChecker" override val description: String = "checks that under -Yretain-trees we may get tree for all symbols" diff --git a/tests/plugins/custom/analyzer/Hello_3.scala b/tests/plugins/custom/analyzer/Hello_3.scala index 9585a8fbe7e7..1d9db0dcad1b 100644 --- a/tests/plugins/custom/analyzer/Hello_3.scala +++ b/tests/plugins/custom/analyzer/Hello_3.scala @@ -1,6 +1,6 @@ package hello -import lib._ +import lib.* case class Student(name: String) diff --git a/tests/plugins/neg/divideZero-research/plugin_1.scala b/tests/plugins/neg/divideZero-research/plugin_1.scala index 411d01e7d26b..20dfa536b2a3 100644 --- a/tests/plugins/neg/divideZero-research/plugin_1.scala +++ b/tests/plugins/neg/divideZero-research/plugin_1.scala @@ -1,14 +1,14 @@ -import dotty.tools.dotc._ -import core._ +import dotty.tools.dotc.* +import core.* import Contexts.Context -import plugins._ +import plugins.* import Phases.Phase import ast.tpd import transform.MegaPhase.MiniPhase -import Decorators._ +import Decorators.* import Symbols.{Symbol, requiredClass} import Constants.Constant -import StdNames._ +import StdNames.* class DivideZero extends MiniPhase with ResearchPlugin { val name: String = "divideZero" diff --git a/tests/plugins/neg/divideZero/plugin_1.scala b/tests/plugins/neg/divideZero/plugin_1.scala index 0ca48c3e4a32..ef8e077fd14d 100644 --- a/tests/plugins/neg/divideZero/plugin_1.scala +++ b/tests/plugins/neg/divideZero/plugin_1.scala @@ -1,15 +1,15 @@ -import dotty.tools.dotc._ -import core._ +import dotty.tools.dotc.* +import core.* import Contexts.Context -import plugins._ +import plugins.* import Phases.Phase import ast.tpd import transform.MegaPhase.MiniPhase -import Decorators._ +import Decorators.* import Symbols.{Symbol, requiredClass} import Constants.Constant import transform.{Pickler, PickleQuotes} -import StdNames._ +import StdNames.* class DivideZero extends PluginPhase with StandardPlugin { val name: String = "divideZero" diff --git a/tests/pos-custom-args/erased/i7868.scala b/tests/pos-custom-args/erased/i7868.scala index 2753cf444af4..c8034adf993d 100644 --- a/tests/pos-custom-args/erased/i7868.scala +++ b/tests/pos-custom-args/erased/i7868.scala @@ -1,5 +1,5 @@ import language.experimental.namedTypeArguments -import scala.compiletime._ +import scala.compiletime.* final case class Coproduct[+Set, +Value, Index <: Int](value: Value & Set, index: Index) @@ -33,7 +33,7 @@ object Coproduct { } object Test extends App { - import Coproduct._ + import Coproduct.* // Error: No singleton value available for scala.compiletime.S[scala.compiletime.S[(0 : Int)]]. val c = from[Set = Int +: String +: Seq[Double] +: Nothing](Nil) diff --git a/tests/pos-custom-args/erased/i7878.scala b/tests/pos-custom-args/erased/i7878.scala index d47bb32f1a65..18005e81eab3 100644 --- a/tests/pos-custom-args/erased/i7878.scala +++ b/tests/pos-custom-args/erased/i7878.scala @@ -1,8 +1,8 @@ object Boom { - import scala.compiletime._ + import scala.compiletime.* trait Fail[A <: Int, B <: Int] - erased inline given fail[X <: Int, Y <: Int]: Fail[X, Y] = { + erased transparent inline given fail[X <: Int, Y <: Int]: Fail[X, Y] = { scala.compiletime.summonFrom { case t: Fail[X, y] if constValue[y] < constValue[Y] => ??? } diff --git a/tests/pos-custom-args/i5498-postfixOps.scala b/tests/pos-custom-args/i5498-postfixOps.scala index bfde706b963b..c85239c7440f 100644 --- a/tests/pos-custom-args/i5498-postfixOps.scala +++ b/tests/pos-custom-args/i5498-postfixOps.scala @@ -1,9 +1,9 @@ -import scala.concurrent.duration._ +import scala.concurrent.duration.* import scala.language.postfixOps def test() = { 1 second - Seq(1, 2) filter (List(1,2) contains) -} \ No newline at end of file + Seq(1, 2) filter (List(1,2) contains) toList +} diff --git a/tests/pos-custom-args/matchtype.scala b/tests/pos-custom-args/matchtype.scala index 16f284d3b434..746301622864 100644 --- a/tests/pos-custom-args/matchtype.scala +++ b/tests/pos-custom-args/matchtype.scala @@ -1,4 +1,4 @@ -import compiletime._ +import compiletime.* object Test { type T[X] = X match { case String => Int diff --git a/tests/pos-custom-args/phantom-Eq.scala b/tests/pos-custom-args/phantom-Eq.scala index beb6397d0ad7..3bd16323524f 100644 --- a/tests/pos-custom-args/phantom-Eq.scala +++ b/tests/pos-custom-args/phantom-Eq.scala @@ -1,5 +1,5 @@ object PhantomEq { - import EqUtil._ + import EqUtil.* "ghi" === "jkl" 3 === 4 diff --git a/tests/pos-custom-args/phantom-Eq2/Phantom-Eq_2.scala b/tests/pos-custom-args/phantom-Eq2/Phantom-Eq_2.scala index c3f3254f6144..87c6cc2275f1 100644 --- a/tests/pos-custom-args/phantom-Eq2/Phantom-Eq_2.scala +++ b/tests/pos-custom-args/phantom-Eq2/Phantom-Eq_2.scala @@ -1,7 +1,7 @@ /* This is a version of ../pos/phantom.scala that tests phantom clases with separate compilation */ object PhantomEq { - import EqUtil._ + import EqUtil.* "ghi" === "jkl" 3 === 4 diff --git a/tests/pos-custom-args/phantom-Evidence.scala b/tests/pos-custom-args/phantom-Evidence.scala index 4c416a7aa237..414f96f3ef33 100644 --- a/tests/pos-custom-args/phantom-Evidence.scala +++ b/tests/pos-custom-args/phantom-Evidence.scala @@ -1,6 +1,6 @@ /** In this implementation variant of =:= (called =::=) we erase all instantiations and definitions of =::= */ object WithNormalState { - import Utils._ + import Utils.* trait State sealed trait On extends State diff --git a/tests/pos-custom-args/semanticdb/inline-unapply/Macro_1.scala b/tests/pos-custom-args/semanticdb/inline-unapply/Macro_1.scala index dc431c14ef14..0c15284141cb 100644 --- a/tests/pos-custom-args/semanticdb/inline-unapply/Macro_1.scala +++ b/tests/pos-custom-args/semanticdb/inline-unapply/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Succ: diff --git a/tests/pos-custom-args/semanticdb/macro-pos/example_1.scala b/tests/pos-custom-args/semanticdb/macro-pos/example_1.scala index f7750d9f0795..08e57680c74d 100644 --- a/tests/pos-custom-args/semanticdb/macro-pos/example_1.scala +++ b/tests/pos-custom-args/semanticdb/macro-pos/example_1.scala @@ -1,4 +1,4 @@ -import quoted._ +import quoted.* object CodeImpl { def codeExpr(using Quotes): Expr[String] = '{""} diff --git a/tests/pos-custom-args/semanticdb/macro-pos/example_2.scala b/tests/pos-custom-args/semanticdb/macro-pos/example_2.scala index 2273d60a54d4..0e11dae6718d 100644 --- a/tests/pos-custom-args/semanticdb/macro-pos/example_2.scala +++ b/tests/pos-custom-args/semanticdb/macro-pos/example_2.scala @@ -1,4 +1,4 @@ -import quoted._ +import quoted.* object TestImpl { transparent inline def fun (inline arg: String): String = diff --git a/tests/pos/i7580.scala b/tests/pos-deep-subtype/i7580.scala similarity index 100% rename from tests/pos/i7580.scala rename to tests/pos-deep-subtype/i7580.scala diff --git a/tests/pos-deep-subtype/inductive-implicits-bench.scala b/tests/pos-deep-subtype/inductive-implicits-bench.scala index 0df40e8cc286..aff8bffd8024 100644 --- a/tests/pos-deep-subtype/inductive-implicits-bench.scala +++ b/tests/pos-deep-subtype/inductive-implicits-bench.scala @@ -54,7 +54,7 @@ package shapeless { } } -import shapeless._ +import shapeless.* object Test extends App { val sel = Selector[L, Boolean] diff --git a/tests/pos-java-interop-separate/i8588/Test_2.scala b/tests/pos-java-interop-separate/i8588/Test_2.scala index 28efb9ef38b6..3174c6487b8f 100644 --- a/tests/pos-java-interop-separate/i8588/Test_2.scala +++ b/tests/pos-java-interop-separate/i8588/Test_2.scala @@ -1,4 +1,4 @@ -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* object Test { ConfigFactory_1.parseMap(Map("a" -> 1).asJava) ConfigFactory_1.parseMap(Map("a" -> "", "b" -> true).asJava) diff --git a/tests/pos-java-interop/i10301/Bar.java b/tests/pos-java-interop/i10301/Bar.java new file mode 100644 index 000000000000..1f4ae43c0202 --- /dev/null +++ b/tests/pos-java-interop/i10301/Bar.java @@ -0,0 +1 @@ +public interface Bar {} diff --git a/tests/pos-java-interop/i10301/Foo.java b/tests/pos-java-interop/i10301/Foo.java new file mode 100644 index 000000000000..23043c19c9b6 --- /dev/null +++ b/tests/pos-java-interop/i10301/Foo.java @@ -0,0 +1 @@ +public interface Foo {} diff --git a/tests/pos-java-interop/i10301/Quux.java b/tests/pos-java-interop/i10301/Quux.java new file mode 100644 index 000000000000..b5863669f89c --- /dev/null +++ b/tests/pos-java-interop/i10301/Quux.java @@ -0,0 +1,4 @@ +public class Quux { + public void baz(A x) {} + public void baz(B x) {} +} diff --git a/tests/pos-java-interop/i10301/Test.scala b/tests/pos-java-interop/i10301/Test.scala new file mode 100644 index 000000000000..e96c97e029c8 --- /dev/null +++ b/tests/pos-java-interop/i10301/Test.scala @@ -0,0 +1,5 @@ +trait Test { + def q: Quux + def f: Foo + q.baz[Foo](f) +} diff --git a/tests/pos-java-interop/t2377/a.scala b/tests/pos-java-interop/t2377/a.scala index bda59ce0dba5..c45086686103 100644 --- a/tests/pos-java-interop/t2377/a.scala +++ b/tests/pos-java-interop/t2377/a.scala @@ -1,4 +1,4 @@ -import Q._ +import Q.* class Bop(var workUnit: WorkUnit) { def addStages(stageBuilder: Stage.Builder): Unit = { diff --git a/tests/pos-macros/asExprOf.scala b/tests/pos-macros/asExprOf.scala index dd0c4e57a2d0..5d0be15227a0 100644 --- a/tests/pos-macros/asExprOf.scala +++ b/tests/pos-macros/asExprOf.scala @@ -1,7 +1,7 @@ -import scala.quoted._ +import scala.quoted.* def test(using Quotes)(x: Expr[_]) = { - import quotes.reflect._ + import quotes.reflect.* x.asTerm.asExprOf[Any] } diff --git a/tests/pos-macros/classesInInlinedParam.scala b/tests/pos-macros/classesInInlinedParam.scala new file mode 100644 index 000000000000..355d29cc8e29 --- /dev/null +++ b/tests/pos-macros/classesInInlinedParam.scala @@ -0,0 +1,27 @@ +inline def f(inline thunk: Any): Unit = thunk +transparent inline def g(inline thunk: Any): Unit = thunk + +def test: Unit = + f { + class C1(val i: Int) + val c = C1(1) + c.i + } + + f { + case class C2(i: Int) + val c = C2(2) + c.i + } + + g { + class C3(val i: Int) + val c = C3(3) + c.i + } + + g { + case class C4(i: Int) + val c = C4(4) + c.i + } \ No newline at end of file diff --git a/tests/pos-macros/f64Pow5Split/Macro.scala b/tests/pos-macros/f64Pow5Split/Macro.scala index 0e9fd5e84616..22b2525f36fd 100644 --- a/tests/pos-macros/f64Pow5Split/Macro.scala +++ b/tests/pos-macros/f64Pow5Split/Macro.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/pos-macros/forced-inline-typeChecks.scala b/tests/pos-macros/forced-inline-typeChecks.scala new file mode 100644 index 000000000000..5f5f53347728 --- /dev/null +++ b/tests/pos-macros/forced-inline-typeChecks.scala @@ -0,0 +1,8 @@ +class Test: + def test: Unit = + assert2(scala.compiletime.testing.typeChecks(stripMargin("|1 + 1"))) + + inline def stripMargin(inline x: String): String = x + + transparent inline def assert2(inline assertion: Boolean): Unit = + if !assertion then scala.runtime.Scala3RunTime.assertFailed() diff --git a/tests/pos-macros/i10050.scala b/tests/pos-macros/i10050.scala index 5a80ce7aa7cf..218200f9781e 100644 --- a/tests/pos-macros/i10050.scala +++ b/tests/pos-macros/i10050.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def test[T: Type](x: Expr[Any])(using Quotes): Unit = diff --git a/tests/pos-macros/i10107b/Macro_1.scala b/tests/pos-macros/i10107b/Macro_1.scala index 6fecabf4d1a6..aa9fc8dc8aae 100644 --- a/tests/pos-macros/i10107b/Macro_1.scala +++ b/tests/pos-macros/i10107b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def isTrue: Boolean = ${ isTrueImpl } def isTrueImpl(using Quotes) = { diff --git a/tests/pos-macros/i10127.scala b/tests/pos-macros/i10127.scala index ccd710728d21..13551d697c34 100644 --- a/tests/pos-macros/i10127.scala +++ b/tests/pos-macros/i10127.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object T { def impl[A](using Type[A])(using Quotes): Expr[Unit] = { diff --git a/tests/pos-macros/i10151/Macro_1.scala b/tests/pos-macros/i10151/Macro_1.scala index f5170c83da12..c7a2b9a301c2 100644 --- a/tests/pos-macros/i10151/Macro_1.scala +++ b/tests/pos-macros/i10151/Macro_1.scala @@ -1,6 +1,6 @@ package x -import scala.quoted._ +import scala.quoted.* trait CB[T]: def map[S](f: T=>S): CB[S] = ??? @@ -22,7 +22,7 @@ object X: } def processImpl[T:Type](f:Expr[T])(using Quotes):Expr[CB[T]] = - import quotes.reflect._ + import quotes.reflect.* def transform(term:Term):Term = term match diff --git a/tests/pos-macros/i10211/Macro_1.scala b/tests/pos-macros/i10211/Macro_1.scala index ebf9b76ff77e..ecca6c9dbbec 100644 --- a/tests/pos-macros/i10211/Macro_1.scala +++ b/tests/pos-macros/i10211/Macro_1.scala @@ -1,6 +1,6 @@ package x -import scala.quoted._ +import scala.quoted.* trait CB[T]: def map[S](f: T=>S): CB[S] = ??? @@ -36,7 +36,7 @@ object X: } def processImpl[T:Type](f:Expr[T])(using Quotes):Expr[CB[T]] = - import quotes.reflect._ + import quotes.reflect.* def transform(term:Term):Term = term match diff --git a/tests/pos-macros/i10573/Macro_1.scala b/tests/pos-macros/i10573/Macro_1.scala index 7c49a8e5ca13..86b1fb5c3881 100644 --- a/tests/pos-macros/i10573/Macro_1.scala +++ b/tests/pos-macros/i10573/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* trait A { def foo: Int } diff --git a/tests/pos-macros/i10771/MacroA_1.scala b/tests/pos-macros/i10771/MacroA_1.scala index 88da14fe31ac..7d1ff0880e8e 100644 --- a/tests/pos-macros/i10771/MacroA_1.scala +++ b/tests/pos-macros/i10771/MacroA_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* case class MyQuoted(val ast: String, runtimeQuotes: List[String]) diff --git a/tests/pos-macros/i10771/MacroB_1.scala b/tests/pos-macros/i10771/MacroB_1.scala index e9bfe73fb1a2..b9bb934c5187 100644 --- a/tests/pos-macros/i10771/MacroB_1.scala +++ b/tests/pos-macros/i10771/MacroB_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object PullAst: def applyImpl(quoted: Expr[MyQuoted])(using qctx: Quotes): Expr[String] = diff --git a/tests/pos-macros/i10910/Macro_1.scala b/tests/pos-macros/i10910/Macro_1.scala index ae5643b1a9ea..a2378b70ac7d 100644 --- a/tests/pos-macros/i10910/Macro_1.scala +++ b/tests/pos-macros/i10910/Macro_1.scala @@ -1,6 +1,6 @@ package x -import scala.quoted._ +import scala.quoted.* trait CB[T]: def map[S](f: T=>S): CB[S] = ??? @@ -17,7 +17,7 @@ object X: } def processImpl[T:Type](f:Expr[T])(using qctx: Quotes):Expr[CB[T]] = - import quotes.reflect._ + import quotes.reflect.* def transform(term:Term): Either[Term, Term] = term match diff --git a/tests/pos-macros/i10910/Test_2.scala b/tests/pos-macros/i10910/Test_2.scala index 056e496ace3f..0016e931f27c 100644 --- a/tests/pos-macros/i10910/Test_2.scala +++ b/tests/pos-macros/i10910/Test_2.scala @@ -1,4 +1,4 @@ -import x._ +import x.* class Writer[A] { diff --git a/tests/pos-macros/i3898/quoted_1.scala b/tests/pos-macros/i3898/quoted_1.scala index 2b8870420795..464083c997d5 100644 --- a/tests/pos-macros/i3898/quoted_1.scala +++ b/tests/pos-macros/i3898/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def ff(args: Any*): String = ${impl('args)} def impl(args: Expr[Seq[Any]])(using Quotes): Expr[String] = '{""} diff --git a/tests/pos-macros/i3898b/quoted_1.scala b/tests/pos-macros/i3898b/quoted_1.scala index 78d88158c05c..df7946f6b8bf 100644 --- a/tests/pos-macros/i3898b/quoted_1.scala +++ b/tests/pos-macros/i3898b/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def ff(x: Int, inline y: Int): String = ${impl('x)} def impl(x: Expr[Int])(using Quotes): Expr[String] = '{""} diff --git a/tests/pos-macros/i3912-1/i3912_1.scala b/tests/pos-macros/i3912-1/i3912_1.scala index 949c4fb6fc8b..fede57b62b0b 100644 --- a/tests/pos-macros/i3912-1/i3912_1.scala +++ b/tests/pos-macros/i3912-1/i3912_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def foo(): Int = { ${ impl() } } diff --git a/tests/pos-macros/i3912-1/i3912_2.scala b/tests/pos-macros/i3912-1/i3912_2.scala index d933fef2935c..00125c49be99 100644 --- a/tests/pos-macros/i3912-1/i3912_2.scala +++ b/tests/pos-macros/i3912-1/i3912_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* class Test { val a: Unit = foo() diff --git a/tests/pos-macros/i3912-2/i3912_1.scala b/tests/pos-macros/i3912-2/i3912_1.scala index 7c8e6af936d3..aaf232ea05a4 100644 --- a/tests/pos-macros/i3912-2/i3912_1.scala +++ b/tests/pos-macros/i3912-2/i3912_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def foo2(): Unit = ${ impl() } diff --git a/tests/pos-macros/i3912-2/i3912_2.scala b/tests/pos-macros/i3912-2/i3912_2.scala index 8530ba3ffe62..dda259b399ee 100644 --- a/tests/pos-macros/i3912-2/i3912_2.scala +++ b/tests/pos-macros/i3912-2/i3912_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* class Test { val a2: Unit = foo2() diff --git a/tests/pos-macros/i3912-3/i3912_1.scala b/tests/pos-macros/i3912-3/i3912_1.scala index 5af4c931b05a..eb29e6090d7c 100644 --- a/tests/pos-macros/i3912-3/i3912_1.scala +++ b/tests/pos-macros/i3912-3/i3912_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def foo3(): Int = { diff --git a/tests/pos-macros/i3912-3/i3912_2.scala b/tests/pos-macros/i3912-3/i3912_2.scala index a029cdff8165..06c2e0628b5f 100644 --- a/tests/pos-macros/i3912-3/i3912_2.scala +++ b/tests/pos-macros/i3912-3/i3912_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* class Test { val a3: Unit = foo3() diff --git a/tests/pos-macros/i4023/Macro_1.scala b/tests/pos-macros/i4023/Macro_1.scala index 34551e3123fc..6b04716a6402 100644 --- a/tests/pos-macros/i4023/Macro_1.scala +++ b/tests/pos-macros/i4023/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def ff[T: Type](x: T): T = ${ impl('x) } def impl[T](x: Expr[T]): Expr[T] = x diff --git a/tests/pos-macros/i4023b/Macro_1.scala b/tests/pos-macros/i4023b/Macro_1.scala index 223758cf393d..b2c51eb82107 100644 --- a/tests/pos-macros/i4023b/Macro_1.scala +++ b/tests/pos-macros/i4023b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def ff[T](implicit t: Type[T]): Int = ${ impl[T] } def impl[T](using Quotes): Expr[Int] = '{4} diff --git a/tests/pos-macros/i4023c/Macro_1.scala b/tests/pos-macros/i4023c/Macro_1.scala index 31bdc14379ad..d8c08cd853ce 100644 --- a/tests/pos-macros/i4023c/Macro_1.scala +++ b/tests/pos-macros/i4023c/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def ff[T](x: T): T = ${ impl('x) } def impl[T](x: Expr[T])(implicit t: Type[T], qctx: Quotes): Expr[T] = '{ $x: T } diff --git a/tests/pos-macros/i4350.scala b/tests/pos-macros/i4350.scala index f8a642de360d..4b733d4e7835 100644 --- a/tests/pos-macros/i4350.scala +++ b/tests/pos-macros/i4350.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo[T: Type](using Quotes) { '{null.asInstanceOf[T]} diff --git a/tests/pos-macros/i4380a.scala b/tests/pos-macros/i4380a.scala index ed015ef4b13c..74195faf8dab 100644 --- a/tests/pos-macros/i4380a.scala +++ b/tests/pos-macros/i4380a.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { diff --git a/tests/pos-macros/i4380b.scala b/tests/pos-macros/i4380b.scala index f24b17a558b7..dba65da6c0d3 100644 --- a/tests/pos-macros/i4380b.scala +++ b/tests/pos-macros/i4380b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Test(using Quotes) { def step(k: (String => Expr[Unit])): Expr[Unit] = '{} diff --git a/tests/pos-macros/i4396a.scala b/tests/pos-macros/i4396a.scala index 8a8e0190a6bf..20575a0c8ad4 100644 --- a/tests/pos-macros/i4396a.scala +++ b/tests/pos-macros/i4396a.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def test(using Quotes) = { '{ Option(4) match { case Some(a) => a; case None => 1 }} } diff --git a/tests/pos-macros/i4414.scala b/tests/pos-macros/i4414.scala index b0e3b06d9460..58ca5f7c3389 100644 --- a/tests/pos-macros/i4414.scala +++ b/tests/pos-macros/i4414.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { given Quotes = ??? diff --git a/tests/pos-macros/i4514.scala b/tests/pos-macros/i4514.scala index e13e47a407f4..e4dfd7050eac 100644 --- a/tests/pos-macros/i4514.scala +++ b/tests/pos-macros/i4514.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { inline def foo[X](x: X): Unit = ${fooImpl('x)} def fooImpl[X: Type](x: X)(using Quotes): Expr[Unit] = '{} diff --git a/tests/pos-macros/i4539.scala b/tests/pos-macros/i4539.scala index a1a6bf98359d..2f17ecec19da 100644 --- a/tests/pos-macros/i4539.scala +++ b/tests/pos-macros/i4539.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def test(using Quotes) = { val q = Type.of[String] Type.of[String] diff --git a/tests/pos-macros/i4539b.scala b/tests/pos-macros/i4539b.scala index 8cf1b40352ab..1d3245b05e84 100644 --- a/tests/pos-macros/i4539b.scala +++ b/tests/pos-macros/i4539b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def test(using Quotes): Unit = { def f = { { diff --git a/tests/pos-macros/i4734/Macro_1.scala b/tests/pos-macros/i4734/Macro_1.scala index aff918025a77..513c6a9e59b5 100644 --- a/tests/pos-macros/i4734/Macro_1.scala +++ b/tests/pos-macros/i4734/Macro_1.scala @@ -1,5 +1,5 @@ import scala.annotation.tailrec -import scala.quoted._ +import scala.quoted.* object Macros { inline def unrolledForeach(f: Int => Int): Int = diff --git a/tests/pos-macros/i4734/Test_2.scala b/tests/pos-macros/i4734/Test_2.scala index 4ee69acc363f..4097f9f6c8a5 100644 --- a/tests/pos-macros/i4734/Test_2.scala +++ b/tests/pos-macros/i4734/Test_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/pos-macros/i4773.scala b/tests/pos-macros/i4773.scala index 188d36642d1c..d97311c97aa1 100644 --- a/tests/pos-macros/i4773.scala +++ b/tests/pos-macros/i4773.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { inline def foo2(): Unit = ${foo2Impl()} diff --git a/tests/pos-macros/i4774a.scala b/tests/pos-macros/i4774a.scala index c117c7dcd0d9..e0ce93f9c843 100644 --- a/tests/pos-macros/i4774a.scala +++ b/tests/pos-macros/i4774a.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Test { def loop[T](x: Expr[T])(implicit t: Type[T], qctx: Quotes): Expr[T] = '{ diff --git a/tests/pos-macros/i4774b.scala b/tests/pos-macros/i4774b.scala index e384f8edcccf..18a76bc81811 100644 --- a/tests/pos-macros/i4774b.scala +++ b/tests/pos-macros/i4774b.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Test { def loop[T](x: Expr[T])(implicit t: Type[T], qctx: Quotes): Expr[T] = '{ diff --git a/tests/pos-macros/i4774c.scala b/tests/pos-macros/i4774c.scala index 3fba38cdecc9..00980c060117 100644 --- a/tests/pos-macros/i4774c.scala +++ b/tests/pos-macros/i4774c.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Test { def loop[T](x: Expr[T])(implicit t: Type[T], qctx: Quotes): Expr[T] = '{ val y = $x; ${loop('y)} } diff --git a/tests/pos-macros/i4774d.scala b/tests/pos-macros/i4774d.scala index e9662c12d8e3..27ff4e3cf71d 100644 --- a/tests/pos-macros/i4774d.scala +++ b/tests/pos-macros/i4774d.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Test { def loop[T](x: Expr[T])(implicit t: Type[T], qctx: Quotes): Expr[T] = diff --git a/tests/pos-macros/i4774e.scala b/tests/pos-macros/i4774e.scala index df057bf326d2..61969cf024fa 100644 --- a/tests/pos-macros/i4774e.scala +++ b/tests/pos-macros/i4774e.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Test { def loop[T](x: Expr[T])(implicit t: Type[T], qctx: Quotes): Expr[T] = diff --git a/tests/pos-macros/i4774f.scala b/tests/pos-macros/i4774f.scala index 17174fc2a35a..59d21eb2d2d4 100644 --- a/tests/pos-macros/i4774f.scala +++ b/tests/pos-macros/i4774f.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Test { def loop[T](x: Expr[T])(implicit t: Type[T], qctx: Quotes): Expr[T] = diff --git a/tests/pos-macros/i4891.scala b/tests/pos-macros/i4891.scala index c0c58a65cc91..7c46be84ec52 100644 --- a/tests/pos-macros/i4891.scala +++ b/tests/pos-macros/i4891.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { def foo(using Quotes): Expr[Option[String]] = '{None} diff --git a/tests/pos-macros/i5547.scala b/tests/pos-macros/i5547.scala index 646039635847..4e9f34701f3a 100644 --- a/tests/pos-macros/i5547.scala +++ b/tests/pos-macros/i5547.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert1(condition: => Boolean): Unit = diff --git a/tests/pos-macros/i5954.scala b/tests/pos-macros/i5954.scala index 6632dfb8e2db..ca024effc25e 100644 --- a/tests/pos-macros/i5954.scala +++ b/tests/pos-macros/i5954.scala @@ -3,7 +3,7 @@ abstract class MatcherFactory1 { } object MatcherFactory1 { - import scala.quoted._ + import scala.quoted.* def impl(self: Expr[MatcherFactory1#AndNotWord])(using Quotes) = '{ val a: Any = $self } diff --git a/tests/pos-macros/i5954b.scala b/tests/pos-macros/i5954b.scala index 8f3fcb8b2657..4bd2c0d41d50 100644 --- a/tests/pos-macros/i5954b.scala +++ b/tests/pos-macros/i5954b.scala @@ -3,7 +3,7 @@ abstract class MatcherFactory1 { } object MatcherFactory1 { - import scala.quoted._ + import scala.quoted.* def impl(self: Expr[MatcherFactory1#AndNotWord[Int]])(using Quotes) = '{ val a: Any = $self } diff --git a/tests/pos-macros/i5954c.scala b/tests/pos-macros/i5954c.scala index 2f40717740e8..63d47787e894 100644 --- a/tests/pos-macros/i5954c.scala +++ b/tests/pos-macros/i5954c.scala @@ -3,7 +3,7 @@ abstract class MatcherFactory1[A] { } object MatcherFactory1 { - import scala.quoted._ + import scala.quoted.* def impl(self: Expr[MatcherFactory1[Int]#AndNotWord])(using Quotes) = '{ val a: Any = $self } diff --git a/tests/pos-macros/i5954d.scala b/tests/pos-macros/i5954d.scala index f1d7506fd003..8b3b31a36c22 100644 --- a/tests/pos-macros/i5954d.scala +++ b/tests/pos-macros/i5954d.scala @@ -3,7 +3,7 @@ abstract class MatcherFactory1 { } object MatcherFactory1 { - import scala.quoted._ + import scala.quoted.* def impl(self: Expr[MatcherFactory1#AndNotWord])(using Quotes) = '{ val a: Any = $self } diff --git a/tests/pos-macros/i5962.scala b/tests/pos-macros/i5962.scala index 973c3f42f155..594bbed1451f 100644 --- a/tests/pos-macros/i5962.scala +++ b/tests/pos-macros/i5962.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class MatchFactory1[T, S[_]] { def f: Int = 2 diff --git a/tests/pos-macros/i6008.scala b/tests/pos-macros/i6008.scala index 9005a9625254..1367a74086ca 100644 --- a/tests/pos-macros/i6008.scala +++ b/tests/pos-macros/i6008.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class C { type T = Int diff --git a/tests/pos-macros/i6140.scala b/tests/pos-macros/i6140.scala index 4dba5cbbeba6..64c02c57577a 100644 --- a/tests/pos-macros/i6140.scala +++ b/tests/pos-macros/i6140.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* sealed trait Trait[T] { type t = T } diff --git a/tests/pos-macros/i6142.scala b/tests/pos-macros/i6142.scala index 38b4a960be4f..919a0c9eeeae 100644 --- a/tests/pos-macros/i6142.scala +++ b/tests/pos-macros/i6142.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object O { def foo(using Quotes) = { diff --git a/tests/pos-macros/i6171/Macro_1.scala b/tests/pos-macros/i6171/Macro_1.scala index e996206bc24f..1ae349a26ec4 100644 --- a/tests/pos-macros/i6171/Macro_1.scala +++ b/tests/pos-macros/i6171/Macro_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert(x: => Any): Unit = ${ assertImpl('x) } def assertImpl(x: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* x.asTerm.underlyingArgument '{ () } } diff --git a/tests/pos-macros/i6171/Test_2.scala b/tests/pos-macros/i6171/Test_2.scala index 778dd129fcf8..095c699dd107 100644 --- a/tests/pos-macros/i6171/Test_2.scala +++ b/tests/pos-macros/i6171/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import scalatest._ + import scalatest.* def main(args: Array[String]): Unit = { assert(new Some(5)) diff --git a/tests/pos-macros/i6210/Macros_1.scala b/tests/pos-macros/i6210/Macros_1.scala index 6c995b7c4b95..232443935d08 100644 --- a/tests/pos-macros/i6210/Macros_1.scala +++ b/tests/pos-macros/i6210/Macros_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def test[A, B]: Any = diff --git a/tests/pos-macros/i6214.scala b/tests/pos-macros/i6214.scala index beb394a70950..530d3ffe9edf 100644 --- a/tests/pos-macros/i6214.scala +++ b/tests/pos-macros/i6214.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { def res(x: quoted.Expr[Int])(using Quotes): quoted.Expr[Int] = x match { case '{ val a: Int = $y; 1} => y // owner of `y` is `res` diff --git a/tests/pos-macros/i6253.scala b/tests/pos-macros/i6253.scala index 1409d2312127..62d77d6c7b8d 100644 --- a/tests/pos-macros/i6253.scala +++ b/tests/pos-macros/i6253.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { def impl(self: Expr[StringContext])(using Quotes): Expr[String] = self match { case '{ StringContext() } => '{""} diff --git a/tests/pos-macros/i6435.scala b/tests/pos-macros/i6435.scala index 23038c40ae5b..82310cfdc55a 100644 --- a/tests/pos-macros/i6435.scala +++ b/tests/pos-macros/i6435.scala @@ -1,5 +1,5 @@ class Foo { - import scala.quoted._ + import scala.quoted.* def f(sc: quoted.Expr[StringContext])(using Quotes): Unit = { diff --git a/tests/pos-macros/i6535/Macro_1.scala b/tests/pos-macros/i6535/Macro_1.scala index a00360a2dddb..de8b4f643323 100644 --- a/tests/pos-macros/i6535/Macro_1.scala +++ b/tests/pos-macros/i6535/Macro_1.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert(condition: => Boolean): Unit = ${ assertImpl('condition) } def assertImpl(cond: Expr[Boolean])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* import ValDef.let cond.asTerm.underlyingArgument match { diff --git a/tests/pos-macros/i6535/Test_2.scala b/tests/pos-macros/i6535/Test_2.scala index 0969d8d42c2c..db78642cc15d 100644 --- a/tests/pos-macros/i6535/Test_2.scala +++ b/tests/pos-macros/i6535/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import scalatest._ + import scalatest.* def neverRuns(f: => Unit): Boolean = true diff --git a/tests/pos-macros/i6588.scala b/tests/pos-macros/i6588.scala index 214dd999ff63..f831dc5c1bf3 100644 --- a/tests/pos-macros/i6588.scala +++ b/tests/pos-macros/i6588.scala @@ -1,6 +1,6 @@ -import scala.quoted._ +import scala.quoted.* -inline def foo[T:Type]: Int = 10 +inline def foo[T<:AnyKind:Type]: Int = 10 def main(using Quotes) = { type S = Int diff --git a/tests/pos-macros/i6783.scala b/tests/pos-macros/i6783.scala index 35a199fdb2bc..9fbbe749b320 100644 --- a/tests/pos-macros/i6783.scala +++ b/tests/pos-macros/i6783.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def testImpl(f: Expr[(Int, Int) => Int])(using Quotes): Expr[Int] = Expr.betaReduce('{$f(1, 2)}) diff --git a/tests/pos-macros/i6803b/Macro_1.scala b/tests/pos-macros/i6803b/Macro_1.scala index f533e360b248..29ec437dd763 100644 --- a/tests/pos-macros/i6803b/Macro_1.scala +++ b/tests/pos-macros/i6803b/Macro_1.scala @@ -1,7 +1,7 @@ package blah import scala.language.implicitConversions -import scala.quoted._ +import scala.quoted.* object AsObject { final class LineNo(val lineNo: Int) @@ -9,7 +9,7 @@ object AsObject { def unsafe(i: Int): LineNo = new LineNo(i) inline given x: LineNo = ${impl} private def impl(using Quotes) : Expr[LineNo] = { - import quotes.reflect._ + import quotes.reflect.* '{unsafe(${Expr(Position.ofMacroExpansion.startLine)})} } } diff --git a/tests/pos-macros/i6803b/Test_2.scala b/tests/pos-macros/i6803b/Test_2.scala index 562d780d9162..a0bbc3b4fa3c 100644 --- a/tests/pos-macros/i6803b/Test_2.scala +++ b/tests/pos-macros/i6803b/Test_2.scala @@ -1,4 +1,4 @@ -import blah._ +import blah.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/pos-macros/i6997c.scala b/tests/pos-macros/i6997c.scala index 443cb0de44a3..ec0b56fbfc7f 100644 --- a/tests/pos-macros/i6997c.scala +++ b/tests/pos-macros/i6997c.scala @@ -1,6 +1,6 @@ package playground -import scala.quoted._ +import scala.quoted.* inline def mcr(x: => Any): Any = ${mcrImpl('x)} diff --git a/tests/pos-macros/i6998.scala b/tests/pos-macros/i6998.scala index dc0e0357099d..032a58b795e2 100644 --- a/tests/pos-macros/i6998.scala +++ b/tests/pos-macros/i6998.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def foo(using Quotes) : Unit = { val '{ $f : (Int => Double) } = ??? : Expr[Any] diff --git a/tests/pos-macros/i7011/Macros_1.scala b/tests/pos-macros/i7011/Macros_1.scala index 2854ccffe103..cf3dd3f4971b 100644 --- a/tests/pos-macros/i7011/Macros_1.scala +++ b/tests/pos-macros/i7011/Macros_1.scala @@ -1,9 +1,9 @@ -import scala.quoted._ +import scala.quoted.* inline def mcr(body: => Any): Unit = ${mcrImpl('body)} def mcrImpl[T](body: Expr[Any])(using Quotes) : Expr[Any] = { - import quotes.reflect._ + import quotes.reflect.* val bTree = body.asTerm val under = bTree.underlyingArgument diff --git a/tests/pos-macros/i7030/Macros_1.scala b/tests/pos-macros/i7030/Macros_1.scala index 9a4b8e277bed..72e59e651491 100644 --- a/tests/pos-macros/i7030/Macros_1.scala +++ b/tests/pos-macros/i7030/Macros_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def inner(exprs: Any): Any = ${innerImpl('exprs)} def innerImpl(exprs: Expr[Any])(using Quotes): Expr[Any] = @@ -6,6 +6,6 @@ def innerImpl(exprs: Expr[Any])(using Quotes): Expr[Any] = inline def outer(expr: => Any): Any = ${outerImpl('expr)} def outerImpl(body: Expr[Any])(using Quotes): Expr[Any] = { - import quotes.reflect._ + import quotes.reflect.* body.asTerm.underlyingArgument.asExpr } diff --git a/tests/pos-macros/i7046.scala b/tests/pos-macros/i7046.scala index 8f296ad0fb43..a2e7972bb743 100644 --- a/tests/pos-macros/i7046.scala +++ b/tests/pos-macros/i7046.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def mcr: Any = ${mcrImpl} def mcrImpl(using ctx: Quotes): Expr[Any] = { diff --git a/tests/pos-macros/i7048.scala b/tests/pos-macros/i7048.scala index a9a889bb4853..b7431edbbfef 100644 --- a/tests/pos-macros/i7048.scala +++ b/tests/pos-macros/i7048.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* trait IsExpr[T] { type Underlying diff --git a/tests/pos-macros/i7048b.scala b/tests/pos-macros/i7048b.scala index e4e78c2ae5ea..3989391d0dc8 100644 --- a/tests/pos-macros/i7048b.scala +++ b/tests/pos-macros/i7048b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* trait IsExpr { type Underlying diff --git a/tests/pos-macros/i7048c.scala b/tests/pos-macros/i7048c.scala index 15c14e6a83d7..a783ab622c1e 100644 --- a/tests/pos-macros/i7048c.scala +++ b/tests/pos-macros/i7048c.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* trait IsExpr { type Underlying diff --git a/tests/pos-macros/i7048d.scala b/tests/pos-macros/i7048d.scala index ee9ce70de927..242169be5085 100644 --- a/tests/pos-macros/i7048d.scala +++ b/tests/pos-macros/i7048d.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* trait IsExpr { class Underlying diff --git a/tests/pos-macros/i7048e.scala b/tests/pos-macros/i7048e.scala index 43636f199d89..c590525351ed 100644 --- a/tests/pos-macros/i7048e.scala +++ b/tests/pos-macros/i7048e.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* abstract class Test { type T diff --git a/tests/pos-macros/i7052.scala b/tests/pos-macros/i7052.scala index c6eaf7a01776..e7b56f964294 100644 --- a/tests/pos-macros/i7052.scala +++ b/tests/pos-macros/i7052.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Test { def foo(str: Expr[String])(using Quotes) = '{ @deprecated($str, "") diff --git a/tests/pos-macros/i7110a/Macro_1.scala b/tests/pos-macros/i7110a/Macro_1.scala index 98b2dbe09eba..a979c79e342c 100644 --- a/tests/pos-macros/i7110a/Macro_1.scala +++ b/tests/pos-macros/i7110a/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/pos-macros/i7110a/Test_2.scala b/tests/pos-macros/i7110a/Test_2.scala index c901785a7bf1..42b27f8c0da7 100644 --- a/tests/pos-macros/i7110a/Test_2.scala +++ b/tests/pos-macros/i7110a/Test_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/pos-macros/i7110b/Macro_1.scala b/tests/pos-macros/i7110b/Macro_1.scala index 9bc5998c4860..c068a7c96aab 100644 --- a/tests/pos-macros/i7110b/Macro_1.scala +++ b/tests/pos-macros/i7110b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/pos-macros/i7110b/Test_2.scala b/tests/pos-macros/i7110b/Test_2.scala index b4ee47b71e14..efee3942815f 100644 --- a/tests/pos-macros/i7110b/Test_2.scala +++ b/tests/pos-macros/i7110b/Test_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/pos-macros/i7110c/Macro_1.scala b/tests/pos-macros/i7110c/Macro_1.scala index 119175f84ace..8a0a833001ae 100644 --- a/tests/pos-macros/i7110c/Macro_1.scala +++ b/tests/pos-macros/i7110c/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/pos-macros/i7110c/Test_2.scala b/tests/pos-macros/i7110c/Test_2.scala index efb82b88f669..eef6bca90d42 100644 --- a/tests/pos-macros/i7110c/Test_2.scala +++ b/tests/pos-macros/i7110c/Test_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/pos-macros/i7110d/Macro_1.scala b/tests/pos-macros/i7110d/Macro_1.scala index fc1d8e1b0478..fb59a2a22d2c 100644 --- a/tests/pos-macros/i7110d/Macro_1.scala +++ b/tests/pos-macros/i7110d/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/pos-macros/i7110d/Test_2.scala b/tests/pos-macros/i7110d/Test_2.scala index 5582ec55a133..b29bc73aba59 100644 --- a/tests/pos-macros/i7110d/Test_2.scala +++ b/tests/pos-macros/i7110d/Test_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/pos-macros/i7110e/Macro_1.scala b/tests/pos-macros/i7110e/Macro_1.scala index f9470255366d..08bd2cc03e47 100644 --- a/tests/pos-macros/i7110e/Macro_1.scala +++ b/tests/pos-macros/i7110e/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/pos-macros/i7110e/Test_2.scala b/tests/pos-macros/i7110e/Test_2.scala index 881ce247c65c..a3917270a614 100644 --- a/tests/pos-macros/i7110e/Test_2.scala +++ b/tests/pos-macros/i7110e/Test_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/pos-macros/i7110f/Macro_1.scala b/tests/pos-macros/i7110f/Macro_1.scala index 98b2dbe09eba..a979c79e342c 100644 --- a/tests/pos-macros/i7110f/Macro_1.scala +++ b/tests/pos-macros/i7110f/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/pos-macros/i7110f/Test_2.scala b/tests/pos-macros/i7110f/Test_2.scala index c901785a7bf1..42b27f8c0da7 100644 --- a/tests/pos-macros/i7110f/Test_2.scala +++ b/tests/pos-macros/i7110f/Test_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/pos-macros/i7204.scala b/tests/pos-macros/i7204.scala index 51a9141f56c3..ad7a27670de8 100644 --- a/tests/pos-macros/i7204.scala +++ b/tests/pos-macros/i7204.scala @@ -1,8 +1,8 @@ -import scala.quoted._ +import scala.quoted.* object Foo { def impl(using Quotes) : Unit = { - import quotes.reflect._ + import quotes.reflect.* val Select(_, _) = (??? : Term) } } diff --git a/tests/pos-macros/i7262.scala b/tests/pos-macros/i7262.scala index 23b0af1f3fde..b4cfd7463280 100644 --- a/tests/pos-macros/i7262.scala +++ b/tests/pos-macros/i7262.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { def f[T](t: Type[T])(using Quotes) = t match { case '[ Int *: EmptyTuple ] => diff --git a/tests/pos-macros/i7264.scala b/tests/pos-macros/i7264.scala index 3e15b16d5a1b..c87409561bee 100644 --- a/tests/pos-macros/i7264.scala +++ b/tests/pos-macros/i7264.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { def f[T2](t: Type[T2])(using Quotes) = t match { case '[ *:[Int, t2] ] => diff --git a/tests/pos-macros/i7264b.scala b/tests/pos-macros/i7264b.scala index feaee449e0ce..e0d72ad1a27b 100644 --- a/tests/pos-macros/i7264b.scala +++ b/tests/pos-macros/i7264b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { def f[T2: Type](e: Expr[T2])(using Quotes) = e match { case '{ $x: *:[Int, t] } => diff --git a/tests/pos-macros/i7264c.scala b/tests/pos-macros/i7264c.scala index c61e4e31535e..0248c1da37e2 100644 --- a/tests/pos-macros/i7264c.scala +++ b/tests/pos-macros/i7264c.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { def f[T2: Type](e: Expr[T2])(using Quotes) = e match { case '{ $x: t0 } => diff --git a/tests/pos-macros/i7358.scala b/tests/pos-macros/i7358.scala index 0c8f18b1b84b..58df7ebbb875 100644 --- a/tests/pos-macros/i7358.scala +++ b/tests/pos-macros/i7358.scala @@ -1,7 +1,7 @@ package test -import scala.quoted._ -import scala.compiletime._ +import scala.quoted.* +import scala.compiletime.* transparent inline def summonT[Tp <: Tuple](using Quotes): Tuple = inline erasedValue[Tp] match { case _ : EmptyTuple => Tuple() diff --git a/tests/pos-macros/i7405.scala b/tests/pos-macros/i7405.scala index ba5596c046f7..0fd81f7366fe 100644 --- a/tests/pos-macros/i7405.scala +++ b/tests/pos-macros/i7405.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { def f(using Quotes): Expr[Any] = { '{ diff --git a/tests/pos-macros/i7405b.scala b/tests/pos-macros/i7405b.scala index c11dc9b91516..df7218608e88 100644 --- a/tests/pos-macros/i7405b.scala +++ b/tests/pos-macros/i7405b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { def f(using Quotes): Expr[Any] = { diff --git a/tests/pos-macros/i7513/Macro_1.scala b/tests/pos-macros/i7513/Macro_1.scala index e0add6b02552..3feb00c1e435 100644 --- a/tests/pos-macros/i7513/Macro_1.scala +++ b/tests/pos-macros/i7513/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* trait Quoted { def foo: Int diff --git a/tests/pos-macros/i7513b/Macro_1.scala b/tests/pos-macros/i7513b/Macro_1.scala index 4b71f53de8e6..91531bd20c83 100644 --- a/tests/pos-macros/i7513b/Macro_1.scala +++ b/tests/pos-macros/i7513b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* trait Quoted { val foo: Int diff --git a/tests/pos-macros/i7513c/Macro_1.scala b/tests/pos-macros/i7513c/Macro_1.scala index 40504e3e24d4..025c4b62adb1 100644 --- a/tests/pos-macros/i7513c/Macro_1.scala +++ b/tests/pos-macros/i7513c/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { trait Quoted { diff --git a/tests/pos-macros/i7519.scala b/tests/pos-macros/i7519.scala index c0af9b9971d3..b3fe924aa03b 100644 --- a/tests/pos-macros/i7519.scala +++ b/tests/pos-macros/i7519.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.annotation.StaticAnnotation object Test { diff --git a/tests/pos-macros/i7519b.scala b/tests/pos-macros/i7519b.scala index 580a200a4589..a9a74ad58b12 100644 --- a/tests/pos-macros/i7519b.scala +++ b/tests/pos-macros/i7519b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.annotation.StaticAnnotation class Annot(in: Int) extends StaticAnnotation diff --git a/tests/pos-macros/i7521.scala b/tests/pos-macros/i7521.scala index 66a6ebf22e06..330565f2dbe4 100644 --- a/tests/pos-macros/i7521.scala +++ b/tests/pos-macros/i7521.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.annotation.StaticAnnotation object Test { diff --git a/tests/pos-macros/i7558/Macro_1.scala b/tests/pos-macros/i7558/Macro_1.scala new file mode 100644 index 000000000000..312017bbdc66 --- /dev/null +++ b/tests/pos-macros/i7558/Macro_1.scala @@ -0,0 +1,8 @@ +import scala.quoted._ + +inline def mcr(expr: => Any): Any = ${mcrImpl('expr)} + +def mcrImpl(expr: Expr[Any])(using Quotes): Expr[Any] = + import quotes.reflect._ + expr.asTerm.tpe.widen.show + expr diff --git a/tests/pos-macros/i7558/Test_2.scala b/tests/pos-macros/i7558/Test_2.scala new file mode 100644 index 000000000000..b7113215dfd2 --- /dev/null +++ b/tests/pos-macros/i7558/Test_2.scala @@ -0,0 +1 @@ +def eq[T](p: T) = mcr(p) diff --git a/tests/pos-macros/i7887.scala b/tests/pos-macros/i7887.scala index 61bfb573b869..da3768e404c4 100644 --- a/tests/pos-macros/i7887.scala +++ b/tests/pos-macros/i7887.scala @@ -1,5 +1,5 @@ def typed[A](using t: quoted.Type[A], q: quoted.Quotes): Unit = { - import q.reflect._ + import q.reflect.* '{ type T = A ${'{???}.asExprOf[T]} diff --git a/tests/pos-macros/i7997.scala b/tests/pos-macros/i7997.scala index 09036b23230e..70611665c2c7 100644 --- a/tests/pos-macros/i7997.scala +++ b/tests/pos-macros/i7997.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def oops(using Quotes) = { val q = '{ class Foo { val x = 3; ${ val v = 'x; '{} } }} } diff --git a/tests/pos-macros/i8045.scala b/tests/pos-macros/i8045.scala index 3cc2db538fba..15a233192295 100644 --- a/tests/pos-macros/i8045.scala +++ b/tests/pos-macros/i8045.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test def run(using Quotes)(tree: quotes.reflect.Tree): Unit = def makeExpr(tree: quotes.reflect.Tree): Expr[Int] = ??? diff --git a/tests/pos-macros/i8045b.scala b/tests/pos-macros/i8045b.scala index 71a0086de286..96b185ea4f52 100644 --- a/tests/pos-macros/i8045b.scala +++ b/tests/pos-macros/i8045b.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test def run(using q: Quotes)(tree: q.reflect.Tree): Unit = def makeExpr(tree: q.reflect.Tree): Expr[Int] = ??? diff --git a/tests/pos-macros/i8052.scala b/tests/pos-macros/i8052.scala index e671c52846a8..53d49e1f2c88 100644 --- a/tests/pos-macros/i8052.scala +++ b/tests/pos-macros/i8052.scala @@ -1,5 +1,5 @@ -import scala.deriving._ -import scala.quoted._ +import scala.deriving.* +import scala.quoted.* object Macro2 { diff --git a/tests/pos-macros/i8100.scala b/tests/pos-macros/i8100.scala index 898cfcd4e89c..0cf80fe920ee 100644 --- a/tests/pos-macros/i8100.scala +++ b/tests/pos-macros/i8100.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class M { type E diff --git a/tests/pos-macros/i8302.scala b/tests/pos-macros/i8302.scala index ef930c2e9570..4aeb3e1fdc76 100644 --- a/tests/pos-macros/i8302.scala +++ b/tests/pos-macros/i8302.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def foo[T](using Quotes, Type[T]): Expr[Any] = '{ (q: Quotes) ?=> type TT = T diff --git a/tests/pos-macros/i8325/Macro_1.scala b/tests/pos-macros/i8325/Macro_1.scala index b3f14e80157c..18466e17b3df 100644 --- a/tests/pos-macros/i8325/Macro_1.scala +++ b/tests/pos-macros/i8325/Macro_1.scala @@ -1,6 +1,6 @@ package a -import scala.quoted._ +import scala.quoted.* object A: @@ -12,7 +12,7 @@ object A: def pure[A](a:A):A = ??? def transformImplExpr[A:Type](using Quotes)(expr: Expr[A]): Expr[A] = { - import quotes.reflect._ + import quotes.reflect.* expr.asTerm match { case Inlined(x,y,z) => transformImplExpr(z.asExpr.asInstanceOf[Expr[A]]) case Apply(fun,args) => '{ A.pure(${Apply(fun,args).asExpr.asInstanceOf[Expr[A]]}) } diff --git a/tests/pos-macros/i8325b/Macro_1.scala b/tests/pos-macros/i8325b/Macro_1.scala index aa4255f6f3a0..181efa260f9b 100644 --- a/tests/pos-macros/i8325b/Macro_1.scala +++ b/tests/pos-macros/i8325b/Macro_1.scala @@ -1,6 +1,6 @@ package a -import scala.quoted._ +import scala.quoted.* object A: @@ -12,7 +12,7 @@ object A: def pure[A](a:A):A = ??? def transformImplExpr[A:Type](using Quotes)(expr: Expr[A]): Expr[A] = { - import quotes.reflect._ + import quotes.reflect.* expr.asTerm match { case Inlined(x,y,z) => transformImplExpr(z.asExpr.asInstanceOf[Expr[A]]) case r@Apply(fun,args) => '{ diff --git a/tests/pos-macros/i8521/Macro_1.scala b/tests/pos-macros/i8521/Macro_1.scala index 63aed53debb9..04c5e57109e3 100644 --- a/tests/pos-macros/i8521/Macro_1.scala +++ b/tests/pos-macros/i8521/Macro_1.scala @@ -1,10 +1,10 @@ -import scala.quoted._ +import scala.quoted.* object Foo { inline def foo[T <: AnyKind]: String = ${ bar[T] } def bar[T <: AnyKind : Type](using Quotes): Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* def packageToName(sym: Symbol): Unit = { if sym.isPackageDef then diff --git a/tests/pos-macros/i8651a.scala b/tests/pos-macros/i8651a.scala index 24cad01570d4..fb3827ea202e 100644 --- a/tests/pos-macros/i8651a.scala +++ b/tests/pos-macros/i8651a.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def coroutineImpl(using Quotes): Expr[Any] = '{ new { diff --git a/tests/pos-macros/i8651b.scala b/tests/pos-macros/i8651b.scala index a7d2a9a72016..31d73271ff40 100644 --- a/tests/pos-macros/i8651b.scala +++ b/tests/pos-macros/i8651b.scala @@ -4,12 +4,12 @@ abstract class Coroutine[+T] { object Macros { - import scala.quoted._ + import scala.quoted.* inline def coroutine[T](inline body: Any): Coroutine[T] = ${ coroutineImpl('{body}) } def coroutineImpl[T: Type](expr: Expr[_ <: Any])(using Quotes): Expr[Coroutine[T]] = { - import quotes.reflect._ + import quotes.reflect.* '{ new Coroutine[T] { diff --git a/tests/pos-macros/i8858/Macro_1.scala b/tests/pos-macros/i8858/Macro_1.scala new file mode 100644 index 000000000000..8eb0182c2779 --- /dev/null +++ b/tests/pos-macros/i8858/Macro_1.scala @@ -0,0 +1,9 @@ +import scala.quoted._ + +inline def mcr(inline x: Any): Any = ${ mcrImpl('x) } +def mcrImpl(expr: Expr[Any])(using Quotes): Expr[Any] = + import quotes.reflect._ + expr.asTerm match + case Inlined(_, _, id1) => + println(id1.tpe.widen.show) + '{()} diff --git a/tests/pos-macros/i8858/Test_2.scala b/tests/pos-macros/i8858/Test_2.scala new file mode 100644 index 000000000000..21acefdd2ccc --- /dev/null +++ b/tests/pos-macros/i8858/Test_2.scala @@ -0,0 +1,3 @@ +trait Foo[A] + +def check[T](x: Foo[T]) = mcr(x) diff --git a/tests/pos-macros/i8865.scala b/tests/pos-macros/i8865.scala index ed4b5ae48033..586f87b8ddec 100644 --- a/tests/pos-macros/i8865.scala +++ b/tests/pos-macros/i8865.scala @@ -1,8 +1,8 @@ -import scala.quoted._ +import scala.quoted.* object Macro { def impl[A : Type](using Quotes): Expr[A] = { - import quotes.reflect._ + import quotes.reflect.* TypeRepr.of[A].asType match case '[tpe] => '{ (a: tpe) => ???} '{???} diff --git a/tests/pos-macros/i8866/Macro_1.scala b/tests/pos-macros/i8866/Macro_1.scala index d6f33392e211..d533a6269884 100644 --- a/tests/pos-macros/i8866/Macro_1.scala +++ b/tests/pos-macros/i8866/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object OtherMacro { @@ -12,7 +12,7 @@ object OtherMacro { object Macro { def impl(using Quotes): Expr[Int] = { - import quotes.reflect._ + import quotes.reflect.* ValDef.let( Symbol.spliceOwner, diff --git a/tests/pos-macros/i8866b/Macro_1.scala b/tests/pos-macros/i8866b/Macro_1.scala index 71e00123ba56..9f2f543c1a8b 100644 --- a/tests/pos-macros/i8866b/Macro_1.scala +++ b/tests/pos-macros/i8866b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Other { inline def apply = 5 @@ -7,7 +7,7 @@ object Other { object Macro { def impl(using Quotes): Expr[Int] = { - import quotes.reflect._ + import quotes.reflect.* ValDef.let( Symbol.spliceOwner, diff --git a/tests/pos-macros/i8866c/Macro_1.scala b/tests/pos-macros/i8866c/Macro_1.scala index 53118b4580ce..57800ef11c7f 100644 --- a/tests/pos-macros/i8866c/Macro_1.scala +++ b/tests/pos-macros/i8866c/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def f(xs: Boolean*): Unit = ??? diff --git a/tests/pos-macros/i8879/Macro_1.scala b/tests/pos-macros/i8879/Macro_1.scala index ec667c654888..4b1a478fa70e 100644 --- a/tests/pos-macros/i8879/Macro_1.scala +++ b/tests/pos-macros/i8879/Macro_1.scala @@ -2,12 +2,12 @@ case class Foo[A](a: A) object Test { - import scala.quoted._ + import scala.quoted.* def impl[T](t: T)(using Quotes, Type[T]): Expr[Any] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* val foo = TypeRepr.of[Foo[String]] val symbol = foo.typeSymbol.memberField("a") diff --git a/tests/pos-macros/i8945.scala b/tests/pos-macros/i8945.scala index 5bb028355e9f..5dded16f0160 100644 --- a/tests/pos-macros/i8945.scala +++ b/tests/pos-macros/i8945.scala @@ -6,7 +6,7 @@ trait Context { } class MacroImpl(val c: Context) { - import c.universe._ + import c.universe.* def mono: Literal = ??? } diff --git a/tests/pos-macros/i9020-a/Macro_1.scala b/tests/pos-macros/i9020-a/Macro_1.scala index 124a1604ca9f..da490f40c01a 100644 --- a/tests/pos-macros/i9020-a/Macro_1.scala +++ b/tests/pos-macros/i9020-a/Macro_1.scala @@ -5,7 +5,7 @@ trait Show[T] { object Show { inline def deriveWithMacro[T]: Show[T] = ${ impl[T] } - import quoted._ + import quoted.* def impl[T](using ctx: Quotes, tpe: Type[T]): Expr[Show[T]] = '{ new Show[T] { diff --git a/tests/pos-macros/i9020-b/Macro_1.scala b/tests/pos-macros/i9020-b/Macro_1.scala index 503eb48d0fa5..569eeaf452ae 100644 --- a/tests/pos-macros/i9020-b/Macro_1.scala +++ b/tests/pos-macros/i9020-b/Macro_1.scala @@ -5,7 +5,7 @@ trait Show[T] { object Show { inline def deriveWithMacro[T]: Show[T] = ${ impl[T] } - import quoted._ + import quoted.* def impl[T](using ctx: Quotes, tpe: Type[T]): Expr[Show[T]] = '{ new Show[tpe.Underlying] { diff --git a/tests/pos-macros/i9240/Macro_1.scala b/tests/pos-macros/i9240/Macro_1.scala index 1323e016e9a8..9e019d351643 100644 --- a/tests/pos-macros/i9240/Macro_1.scala +++ b/tests/pos-macros/i9240/Macro_1.scala @@ -1,13 +1,13 @@ -import scala.quoted._ +import scala.quoted.* inline def diveInto[T]: String = ${ diveIntoImpl[T]() } def diveIntoImpl[T]()(implicit qctx: Quotes, ttype: Type[T]): Expr[String] = - import quotes.reflect._ + import quotes.reflect.* Expr( unwindType(TypeRepr.of[T]) ) def unwindType(using Quotes)(aType: quotes.reflect.TypeRepr): String = - import quotes.reflect._ + import quotes.reflect.* aType match { case AppliedType(t,tob) => diff --git a/tests/pos-macros/i9251/Macro_1.scala b/tests/pos-macros/i9251/Macro_1.scala index f055d1f595a8..4b1b467bff22 100644 --- a/tests/pos-macros/i9251/Macro_1.scala +++ b/tests/pos-macros/i9251/Macro_1.scala @@ -1,6 +1,6 @@ package cps -import scala.quoted._ +import scala.quoted.* trait CpsMonad[F[_]] @@ -19,7 +19,7 @@ object Async { def checkPrintTypeImpl[F[_]:Type,T:Type](f: Expr[T])(using Quotes): Expr[Unit] = - import quotes.reflect._ + import quotes.reflect.* val fu = f.asTerm fu match diff --git a/tests/pos-macros/i9254/Macros_1.scala b/tests/pos-macros/i9254/Macros_1.scala index 69a78b865d6f..aa2c71c8a343 100644 --- a/tests/pos-macros/i9254/Macros_1.scala +++ b/tests/pos-macros/i9254/Macros_1.scala @@ -1,6 +1,6 @@ package cps -import scala.quoted._ +import scala.quoted.* trait CpsMonad[F[_]] @@ -27,7 +27,7 @@ object Async { } def transformImpl[F[_]:Type,T:Type](f: Expr[T])(using Quotes): Expr[Unit] = - import quotes.reflect._ + import quotes.reflect.* def uninline(t:Term):Term = t match diff --git a/tests/pos-macros/i9296/Macros_1.scala b/tests/pos-macros/i9296/Macros_1.scala index 240cd97eabae..4e1a66dfb373 100644 --- a/tests/pos-macros/i9296/Macros_1.scala +++ b/tests/pos-macros/i9296/Macros_1.scala @@ -1,7 +1,7 @@ package a -import scala.quoted._ -import scala.concurrent._ +import scala.quoted.* +import scala.concurrent.* object M { @@ -10,7 +10,7 @@ object M { def resolveInMacrosImpl[F[_]:Type,T:Type](f:Expr[Future[T]])(using qctx:Quotes):Expr[ Conversion[Future[T],F[T]]]={ - import quotes.reflect._ + import quotes.reflect.* val conversion = TypeIdent(Symbol.classSymbol("scala.Conversion")).tpe val inFuture = f.asTerm.tpe.widen val tType = TypeRepr.of[T] diff --git a/tests/pos-macros/i9296/Test_2.scala b/tests/pos-macros/i9296/Test_2.scala index 8e22c5ae841b..94dc9e501792 100644 --- a/tests/pos-macros/i9296/Test_2.scala +++ b/tests/pos-macros/i9296/Test_2.scala @@ -1,14 +1,15 @@ package a import scala.language.implicitConversions -import scala.concurrent._ +import scala.concurrent.* trait CB[T] -given myConversion[T]: Conversion[Future[T],CB[T]] = (ft => ???) object O { + given myConversion[T]: Conversion[Future[T],CB[T]] = (ft => ???) + def main(argvs: Array[String]): Unit = { val p = Promise[Int]() //val cbp = summon[Conversion[Future[Int],CB[Int]]] //works diff --git a/tests/pos-macros/i9321/macros.scala b/tests/pos-macros/i9321/macros.scala index 96fa2663f240..8eeb11f7a03b 100644 --- a/tests/pos-macros/i9321/macros.scala +++ b/tests/pos-macros/i9321/macros.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* type Foo type F[X] diff --git a/tests/pos-macros/i9465.scala b/tests/pos-macros/i9465.scala index 6141cbea5927..1f313c3f90f4 100644 --- a/tests/pos-macros/i9465.scala +++ b/tests/pos-macros/i9465.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* trait Coll[A] { type C[X] // must be abstract diff --git a/tests/pos-macros/i9484/C.scala b/tests/pos-macros/i9484/C.scala index e4c6185c705d..f83e69f3c724 100644 --- a/tests/pos-macros/i9484/C.scala +++ b/tests/pos-macros/i9484/C.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object C { inline def m: Any = ${ mExpr } diff --git a/tests/pos-macros/i9484/L.scala b/tests/pos-macros/i9484/L.scala index ce9c12566eb6..a30f210a0cc2 100644 --- a/tests/pos-macros/i9484/L.scala +++ b/tests/pos-macros/i9484/L.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object L { val m = C.m diff --git a/tests/pos-macros/i9484/Q.scala b/tests/pos-macros/i9484/Q.scala index 411ca6bca67a..28f8574180e2 100644 --- a/tests/pos-macros/i9484/Q.scala +++ b/tests/pos-macros/i9484/Q.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Q { inline def f(): Any = ${ fExpr } diff --git a/tests/pos-macros/i9484b/C.scala b/tests/pos-macros/i9484b/C.scala index 987bd6a40136..5ced384a7a72 100644 --- a/tests/pos-macros/i9484b/C.scala +++ b/tests/pos-macros/i9484b/C.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object C { inline def m: Any = ${ mExpr } diff --git a/tests/pos-macros/i9484b/Q.scala b/tests/pos-macros/i9484b/Q.scala index 94b2bd60bb45..5a23a10e0257 100644 --- a/tests/pos-macros/i9484b/Q.scala +++ b/tests/pos-macros/i9484b/Q.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Q { inline def f(inline f: Any): Any = ${ Q2.fExpr('f) } diff --git a/tests/pos-macros/i9518/Macro_1.scala b/tests/pos-macros/i9518/Macro_1.scala index c5507da6ba4b..126bfbe7e8eb 100644 --- a/tests/pos-macros/i9518/Macro_1.scala +++ b/tests/pos-macros/i9518/Macro_1.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* trait CB[T] inline def shift : Unit = ${ shiftTerm } def shiftTerm(using Quotes): Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val nTree = '{ ??? : CB[Int] }.asTerm val tp1 = TypeRepr.of[CB[Int]] val tp2 = TypeRepr.of[([X] =>> CB[X])[Int]] diff --git a/tests/pos-macros/i9570.scala b/tests/pos-macros/i9570.scala index 90d3aa85081f..295969813df6 100644 --- a/tests/pos-macros/i9570.scala +++ b/tests/pos-macros/i9570.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -8,7 +8,7 @@ object Macros { case object HNil extends HList private def sizeImpl(e: Expr[HList], n:Int)(using qctx:Quotes): Expr[Int] = { - import quotes.reflect._ + import quotes.reflect.* e match { case '{HCons(_,$t)} => // error if run with fatal warinings in BootstrappedOnlyCompilationTests sizeImpl(t,n+1) diff --git a/tests/pos-macros/i9687/Macro_1.scala b/tests/pos-macros/i9687/Macro_1.scala index 267b4cbe8bc6..cd7d2c6c38ae 100644 --- a/tests/pos-macros/i9687/Macro_1.scala +++ b/tests/pos-macros/i9687/Macro_1.scala @@ -1,6 +1,6 @@ package x -import scala.quoted._ +import scala.quoted.* object FastPath { @@ -23,7 +23,7 @@ object X { } def transformImpl[A:Type](x:Expr[A])(using Quotes):Expr[A] = { - import quotes.reflect._ + import quotes.reflect.* val slowPath = '{ SlowPath }.asTerm val fastPath = '{ FastPath }.asTerm val transformer = new TreeMap() { diff --git a/tests/pos-macros/i9802/Macro_1.scala b/tests/pos-macros/i9802/Macro_1.scala index a3e7760a5644..19cb6cadfd22 100644 --- a/tests/pos-macros/i9802/Macro_1.scala +++ b/tests/pos-macros/i9802/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def fun(inline prog: Double): Double = ${impl('prog)} diff --git a/tests/pos-macros/i9812.scala b/tests/pos-macros/i9812.scala index e09db34fea2a..6fb314d8db30 100644 --- a/tests/pos-macros/i9812.scala +++ b/tests/pos-macros/i9812.scala @@ -1,5 +1,5 @@ // compile with -Ycheck:reifyQuotes -Ystop-after:reifyQuotes -import quoted._ +import quoted.* sealed abstract class SomeEnum object SomeEnum: diff --git a/tests/pos-macros/i9894/Macro_1.scala b/tests/pos-macros/i9894/Macro_1.scala index 7135cb6a7029..02bab94d209f 100644 --- a/tests/pos-macros/i9894/Macro_1.scala +++ b/tests/pos-macros/i9894/Macro_1.scala @@ -1,6 +1,6 @@ package x -import scala.quoted._ +import scala.quoted.* trait CB[T]: def map[S](f: T=>S): CB[S] = ??? @@ -21,7 +21,7 @@ object X: } def processImpl[T:Type](f:Expr[T])(using Quotes):Expr[CB[T]] = - import quotes.reflect._ + import quotes.reflect.* def transform(term:Term):Term = term match diff --git a/tests/pos-macros/macro-classloaders/Macro.scala b/tests/pos-macros/macro-classloaders/Macro.scala index 947edf652bfa..28e1b8f83319 100644 --- a/tests/pos-macros/macro-classloaders/Macro.scala +++ b/tests/pos-macros/macro-classloaders/Macro.scala @@ -1,6 +1,6 @@ import java.net.URLClassLoader -import scala.quoted._ +import scala.quoted.* object Macro { self => inline def f: Any = ${ impl } diff --git a/tests/pos-macros/macro-docs.scala b/tests/pos-macros/macro-docs.scala index 8d741ff07e06..f3cd6e3ef00a 100644 --- a/tests/pos-macros/macro-docs.scala +++ b/tests/pos-macros/macro-docs.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object MacrosMD_ToExpr { diff --git a/tests/pos-macros/macro-with-type/Macro_1.scala b/tests/pos-macros/macro-with-type/Macro_1.scala index 73bf4bae895d..9010f0f11313 100644 --- a/tests/pos-macros/macro-with-type/Macro_1.scala +++ b/tests/pos-macros/macro-with-type/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def ff: Unit = ${impl(Type.of[Int])} def impl(t: Type[Int])(using Quotes): Expr[Unit] = '{} diff --git a/tests/pos-macros/macros-in-same-project-1/Foo.scala b/tests/pos-macros/macros-in-same-project-1/Foo.scala index e463e43fe840..653150d5dcd5 100644 --- a/tests/pos-macros/macros-in-same-project-1/Foo.scala +++ b/tests/pos-macros/macros-in-same-project-1/Foo.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { diff --git a/tests/pos-macros/macros-in-same-project-2/Foo.scala b/tests/pos-macros/macros-in-same-project-2/Foo.scala index 7f77c8e356fd..f326d6031b93 100644 --- a/tests/pos-macros/macros-in-same-project-2/Foo.scala +++ b/tests/pos-macros/macros-in-same-project-2/Foo.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { diff --git a/tests/pos-macros/macros-in-same-project-3/Bar.scala b/tests/pos-macros/macros-in-same-project-3/Bar.scala index 26bbb440fac8..09870ba91305 100644 --- a/tests/pos-macros/macros-in-same-project-3/Bar.scala +++ b/tests/pos-macros/macros-in-same-project-3/Bar.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Bar { diff --git a/tests/pos-macros/macros-in-same-project-3/Foo.scala b/tests/pos-macros/macros-in-same-project-3/Foo.scala index c2d88908dcb4..d6c3dd285c6d 100644 --- a/tests/pos-macros/macros-in-same-project-3/Foo.scala +++ b/tests/pos-macros/macros-in-same-project-3/Foo.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { diff --git a/tests/pos-macros/macros-in-same-project-4/Bar.scala b/tests/pos-macros/macros-in-same-project-4/Bar.scala index 9bcb16bdc9ac..4633d3183a59 100644 --- a/tests/pos-macros/macros-in-same-project-4/Bar.scala +++ b/tests/pos-macros/macros-in-same-project-4/Bar.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Bar { diff --git a/tests/pos-macros/nil-liftable.scala b/tests/pos-macros/nil-liftable.scala index 490291bc48f7..a3277510d7bf 100644 --- a/tests/pos-macros/nil-liftable.scala +++ b/tests/pos-macros/nil-liftable.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Test: given NilToExpr: ToExpr[Nil.type] with { diff --git a/tests/pos-macros/power-macro/Macro_1.scala b/tests/pos-macros/power-macro/Macro_1.scala index b809890370d1..009947d4fe1f 100644 --- a/tests/pos-macros/power-macro/Macro_1.scala +++ b/tests/pos-macros/power-macro/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object PowerMacro { diff --git a/tests/pos-macros/power-macro/PowerInlined-1_2.scala b/tests/pos-macros/power-macro/PowerInlined-1_2.scala index ec46c956cc28..a223887ae53c 100644 --- a/tests/pos-macros/power-macro/PowerInlined-1_2.scala +++ b/tests/pos-macros/power-macro/PowerInlined-1_2.scala @@ -1,5 +1,5 @@ object PowerInlined1 { - import PowerMacro._ + import PowerMacro.* power(1, 5.0) // 1 quotes to unpickle } diff --git a/tests/pos-macros/power-macro/PowerInlined-1k_2.scala b/tests/pos-macros/power-macro/PowerInlined-1k_2.scala index 26ea6bf8308a..5fca8f856e0d 100644 --- a/tests/pos-macros/power-macro/PowerInlined-1k_2.scala +++ b/tests/pos-macros/power-macro/PowerInlined-1k_2.scala @@ -1,5 +1,5 @@ object PowerInlined1k { - import PowerMacro._ + import PowerMacro.* // FIXME Sometimes stack overflows in CI // power(9223372036854775807L, 5.0) // 125 quotes to unpickle diff --git a/tests/pos-macros/quote-1.scala b/tests/pos-macros/quote-1.scala index 23107f72053b..381e5476de0a 100644 --- a/tests/pos-macros/quote-1.scala +++ b/tests/pos-macros/quote-1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Test(using Quotes) { diff --git a/tests/pos-macros/quote-aliases.scala b/tests/pos-macros/quote-aliases.scala index e6c0e50593fb..ab236c99b6d6 100644 --- a/tests/pos-macros/quote-aliases.scala +++ b/tests/pos-macros/quote-aliases.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test: diff --git a/tests/pos-macros/quote-bind-T.scala b/tests/pos-macros/quote-bind-T.scala index 99553e5ed742..51aafbd3d085 100644 --- a/tests/pos-macros/quote-bind-T.scala +++ b/tests/pos-macros/quote-bind-T.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Test { def matchX[T](x: Expr[T])(using Type[T], Quotes): Expr[T] = '{ diff --git a/tests/pos-macros/quote-lift.scala b/tests/pos-macros/quote-lift.scala index 92dd80ef1941..62aae9895da1 100644 --- a/tests/pos-macros/quote-lift.scala +++ b/tests/pos-macros/quote-lift.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* class Test(using Quotes) { '{ ${implicitly[ToExpr[Int]].apply(1)} } { - import ToExpr._ + import ToExpr.* '{ ${summon[ToExpr[Int]].apply(1)} } diff --git a/tests/pos-macros/quote-liftable-list-2.scala b/tests/pos-macros/quote-liftable-list-2.scala index 713b1f771766..54c247aa5607 100644 --- a/tests/pos-macros/quote-liftable-list-2.scala +++ b/tests/pos-macros/quote-liftable-list-2.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { diff --git a/tests/pos-macros/quote-liftable-list-3.scala b/tests/pos-macros/quote-liftable-list-3.scala index 1aeba2c365c8..537ad9ef19c9 100644 --- a/tests/pos-macros/quote-liftable-list-3.scala +++ b/tests/pos-macros/quote-liftable-list-3.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { diff --git a/tests/pos-macros/quote-liftable-list.scala b/tests/pos-macros/quote-liftable-list.scala index a670855fcd07..64f40b4f27ee 100644 --- a/tests/pos-macros/quote-liftable-list.scala +++ b/tests/pos-macros/quote-liftable-list.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { diff --git a/tests/pos-macros/quote-liftable.scala b/tests/pos-macros/quote-liftable.scala index 034a13c51f6a..f50728521a75 100644 --- a/tests/pos-macros/quote-liftable.scala +++ b/tests/pos-macros/quote-liftable.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def test(using Quotes) = { diff --git a/tests/pos-macros/quote-matching-implicit-types.scala b/tests/pos-macros/quote-matching-implicit-types.scala index e75749dbc4ab..aae9fd5ebaec 100644 --- a/tests/pos-macros/quote-matching-implicit-types.scala +++ b/tests/pos-macros/quote-matching-implicit-types.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { diff --git a/tests/pos-macros/quote-nested-object/Macro_1.scala b/tests/pos-macros/quote-nested-object/Macro_1.scala index 6894a8409641..19746c270840 100644 --- a/tests/pos-macros/quote-nested-object/Macro_1.scala +++ b/tests/pos-macros/quote-nested-object/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/pos-macros/quote-nested-object/Test_2.scala b/tests/pos-macros/quote-nested-object/Test_2.scala index bcc073c6061a..6c0a9628b0bd 100644 --- a/tests/pos-macros/quote-nested-object/Test_2.scala +++ b/tests/pos-macros/quote-nested-object/Test_2.scala @@ -1,5 +1,5 @@ object PowerInlined1 { - import Macro.Implementation._ + import Macro.Implementation.* plus(0, 2) plus(1, 3) diff --git a/tests/pos-macros/quote-nested.scala b/tests/pos-macros/quote-nested.scala index 7a35c482c989..98cba9efdb9a 100644 --- a/tests/pos-macros/quote-nested.scala +++ b/tests/pos-macros/quote-nested.scala @@ -1,5 +1,5 @@ import scala.annotation.tailrec -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/pos-macros/quote-no-splices.scala b/tests/pos-macros/quote-no-splices.scala index 6ed98ff4c048..76ccc30c26dc 100644 --- a/tests/pos-macros/quote-no-splices.scala +++ b/tests/pos-macros/quote-no-splices.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { def foo(using Quotes): Unit = { val expr ='{ diff --git a/tests/pos-macros/quote-non-static-macro.scala b/tests/pos-macros/quote-non-static-macro.scala index 6896b57f7d47..5c63b7f1a634 100644 --- a/tests/pos-macros/quote-non-static-macro.scala +++ b/tests/pos-macros/quote-non-static-macro.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { inline def foo: Unit = ${Foo.impl} diff --git a/tests/pos-macros/quote-this.scala b/tests/pos-macros/quote-this.scala index ea9173c5d0c7..20f3ff2f5b3b 100644 --- a/tests/pos-macros/quote-this.scala +++ b/tests/pos-macros/quote-this.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo { def a(using Quotes): Expr[Int] = '{1} diff --git a/tests/pos-macros/quote-type-with-param.scala b/tests/pos-macros/quote-type-with-param.scala index b7ab6ca11426..4f6da9aa1940 100644 --- a/tests/pos-macros/quote-type-with-param.scala +++ b/tests/pos-macros/quote-type-with-param.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def f(using Quotes): Unit = '{ type T[X] = List[X] } diff --git a/tests/pos-macros/quote-whitebox-2/Macro_1.scala b/tests/pos-macros/quote-whitebox-2/Macro_1.scala index 351f6c1216ba..8113cedbc113 100644 --- a/tests/pos-macros/quote-whitebox-2/Macro_1.scala +++ b/tests/pos-macros/quote-whitebox-2/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/pos-macros/quote-whitebox-2/Test_2.scala b/tests/pos-macros/quote-whitebox-2/Test_2.scala index da5757f22d79..12137c5749f3 100644 --- a/tests/pos-macros/quote-whitebox-2/Test_2.scala +++ b/tests/pos-macros/quote-whitebox-2/Test_2.scala @@ -1,4 +1,4 @@ -import Macro._ +import Macro.* object Test { diff --git a/tests/pos-macros/quoted-inline-quote.scala b/tests/pos-macros/quoted-inline-quote.scala index dc8a5d9ad8b5..7fc216e169d3 100644 --- a/tests/pos-macros/quoted-inline-quote.scala +++ b/tests/pos-macros/quoted-inline-quote.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Foo(using Quotes) { inline def foo(x: Expr[String])(using Quotes) = '{ println(${x}) } diff --git a/tests/pos-macros/quoted-pattern-type.scala b/tests/pos-macros/quoted-pattern-type.scala index 4cf7e0f43bab..0a3e0f279df1 100644 --- a/tests/pos-macros/quoted-pattern-type.scala +++ b/tests/pos-macros/quoted-pattern-type.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Lib { diff --git a/tests/pos-macros/quoted-splice-pattern-applied.scala b/tests/pos-macros/quoted-splice-pattern-applied.scala index b6f5065905cd..9547282b8cbd 100644 --- a/tests/pos-macros/quoted-splice-pattern-applied.scala +++ b/tests/pos-macros/quoted-splice-pattern-applied.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def f(x: Expr[Int])(using Quotes) = x match { case '{ ${f}($a: Int): Int } => diff --git a/tests/pos-macros/quoted-var.scala b/tests/pos-macros/quoted-var.scala index 847151733674..2ebfdac77d6e 100644 --- a/tests/pos-macros/quoted-var.scala +++ b/tests/pos-macros/quoted-var.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Var[T] diff --git a/tests/pos-macros/quotedPatterns-4.scala b/tests/pos-macros/quotedPatterns-4.scala index 9ac6c1f1245a..309b026e3d54 100644 --- a/tests/pos-macros/quotedPatterns-4.scala +++ b/tests/pos-macros/quotedPatterns-4.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { def impl(receiver: Expr[StringContext])(using qctx: scala.quoted.Quotes) = { import quotes.reflect.Repeated diff --git a/tests/pos-macros/quotedPatterns.scala b/tests/pos-macros/quotedPatterns.scala index ec4d32cdf588..6a298eb8b0a6 100644 --- a/tests/pos-macros/quotedPatterns.scala +++ b/tests/pos-macros/quotedPatterns.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { def x(using Quotes) = '{1 + 2} diff --git a/tests/pos-macros/scala2-macro-compat-1.scala b/tests/pos-macros/scala2-macro-compat-1.scala index 63a9d0d6c43e..d4cc508a471c 100644 --- a/tests/pos-macros/scala2-macro-compat-1.scala +++ b/tests/pos-macros/scala2-macro-compat-1.scala @@ -18,9 +18,9 @@ object LineNumberMacro2 { } object LineNumberMacro3 { - import scala.quoted._ + import scala.quoted.* def thisLineNumberExpr(using Quotes): Expr[Int] = { - import quotes.reflect._ + import quotes.reflect.* Expr(Position.ofMacroExpansion.startLine + 1) } } diff --git a/tests/pos-macros/splice-with-explicit-context.scala b/tests/pos-macros/splice-with-explicit-context.scala index 2e4ba6f7497b..d05aa254feb4 100644 --- a/tests/pos-macros/splice-with-explicit-context.scala +++ b/tests/pos-macros/splice-with-explicit-context.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def f(a: Expr[Int])(using q: Quotes): Unit = diff --git a/tests/pos-macros/tasty-constant-type/Macro_1.scala b/tests/pos-macros/tasty-constant-type/Macro_1.scala index b0b4d546548e..86250bca306b 100644 --- a/tests/pos-macros/tasty-constant-type/Macro_1.scala +++ b/tests/pos-macros/tasty-constant-type/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { @@ -7,7 +7,7 @@ object Macro { transparent inline def ff[A <: Int, B <: Int](): AddInt[A, B] = ${ impl[A, B] } def impl[A <: Int : Type, B <: Int : Type](using Quotes) : Expr[AddInt[A, B]] = { - import quotes.reflect._ + import quotes.reflect.* val ConstantType(IntConstant(v1)) = TypeRepr.of[A] val ConstantType(IntConstant(v2)) = TypeRepr.of[B] diff --git a/tests/pos-macros/toexproftuple.scala b/tests/pos-macros/toexproftuple.scala index e71ea1802c59..acb93d9736d5 100644 --- a/tests/pos-macros/toexproftuple.scala +++ b/tests/pos-macros/toexproftuple.scala @@ -1,4 +1,4 @@ -import scala.quoted._, scala.deriving._ +import scala.quoted._, scala.deriving.* inline def mcr: Any = ${mcrImpl} def mcrImpl(using ctx: Quotes): Expr[Any] = { diff --git a/tests/pos-macros/treemap-unapply/Macro.scala b/tests/pos-macros/treemap-unapply/Macro.scala index 7e389e666fa7..a709ff797b3d 100644 --- a/tests/pos-macros/treemap-unapply/Macro.scala +++ b/tests/pos-macros/treemap-unapply/Macro.scala @@ -1,8 +1,8 @@ -import scala.quoted._ +import scala.quoted.* inline def mcr(x: => Unit): Unit = ${mcrImpl('x)} def mcrImpl(x: Expr[Unit])(using Quotes) : Expr[Unit] = - import quotes.reflect._ + import quotes.reflect.* val tr: Term = x.asTerm object m extends TreeMap m.transformTerm(tr)(Symbol.spliceOwner).asExprOf[Unit] diff --git a/tests/pos-macros/typetags.scala b/tests/pos-macros/typetags.scala index 97e915dda84c..3a6e60c2e91c 100644 --- a/tests/pos-macros/typetags.scala +++ b/tests/pos-macros/typetags.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { diff --git a/tests/pos-macros/using-quote-context.scala b/tests/pos-macros/using-quote-context.scala index 1581356517a0..f55198416a22 100644 --- a/tests/pos-macros/using-quote-context.scala +++ b/tests/pos-macros/using-quote-context.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Test { def fold[W: Type](s: Expr[W]): Quotes ?=> Expr[W] = diff --git a/tests/pos-scala2/hk-infer.scala b/tests/pos-scala2/hk-infer.scala index 2bf898c485cf..44b4553e5951 100644 --- a/tests/pos-scala2/hk-infer.scala +++ b/tests/pos-scala2/hk-infer.scala @@ -5,7 +5,7 @@ object Basis { val x1 = Seq(X("asdf")) val x2 = Seq(X('d')) } -import Basis._ +import Basis.* object DoesWork { // Doesn'tWork diff --git a/tests/pos-scala2/t2030.scala b/tests/pos-scala2/t2030.scala index 2333c3981b99..9d4a139c8425 100644 --- a/tests/pos-scala2/t2030.scala +++ b/tests/pos-scala2/t2030.scala @@ -1,4 +1,4 @@ -import scala.collection.immutable._ +import scala.collection.immutable.* object Test extends App { val res0 = TreeSet(1, 2, 3, 4, 5, 6) diff --git a/tests/pos-scala2/t3568.scala b/tests/pos-scala2/t3568.scala index 59b6753cd342..76517def917b 100644 --- a/tests/pos-scala2/t3568.scala +++ b/tests/pos-scala2/t3568.scala @@ -1,6 +1,6 @@ -import scala.annotation._ -import scala.annotation.unchecked._ -import scala.collection._ +import scala.annotation.* +import scala.annotation.unchecked.* +import scala.collection.* package object buffer { diff --git a/tests/pos-scala2/t5070.scala b/tests/pos-scala2/t5070.scala index c236b4f9ea21..127f82d484ae 100644 --- a/tests/pos-scala2/t5070.scala +++ b/tests/pos-scala2/t5070.scala @@ -10,7 +10,7 @@ trait WebDSL[W <: Web] { } object Test { def t[W <: Web](implicit webDSL: WebDSL[W]): Unit = { - import webDSL._ + import webDSL.* implicitly[LocalNameCompanion] // succeeds implicitly[Companion1[W#LocalName]] // fails } diff --git a/tests/pos-scala2/typerep-stephane.scala b/tests/pos-scala2/typerep-stephane.scala index 2cb899591afc..7af225613a00 100644 --- a/tests/pos-scala2/typerep-stephane.scala +++ b/tests/pos-scala2/typerep-stephane.scala @@ -42,7 +42,7 @@ object typerep { } object test extends App { - import typerep._ + import typerep.* println(3.getType) println(List(3).getType) } diff --git a/tests/pos-special/extend-java-enum.scala b/tests/pos-special/extend-java-enum.scala index d6b03048411e..323b6d82639f 100644 --- a/tests/pos-special/extend-java-enum.scala +++ b/tests/pos-special/extend-java-enum.scala @@ -1,4 +1,4 @@ -import java.{lang => jl} +import java.{lang as jl} final class ConfigSyntax private (name: String, ordinal: Int) extends jl.Enum[ConfigSyntax](name, ordinal) diff --git a/tests/pos-special/fatal-warnings/i7219.scala b/tests/pos-special/fatal-warnings/i7219.scala index 903fc0429bf2..fe50549e2710 100644 --- a/tests/pos-special/fatal-warnings/i7219.scala +++ b/tests/pos-special/fatal-warnings/i7219.scala @@ -10,7 +10,7 @@ object Bar { type Blue = Foo.Blue } -import Foo._ +import Foo.* def foo(a: MyEnum): Seq[Bar.Blue] = a match { case Red => Seq.empty diff --git a/tests/pos-special/fatal-warnings/i7219b.scala b/tests/pos-special/fatal-warnings/i7219b.scala index f2fea75771ea..869c72b3b7d0 100644 --- a/tests/pos-special/fatal-warnings/i7219b.scala +++ b/tests/pos-special/fatal-warnings/i7219b.scala @@ -10,7 +10,7 @@ object Bar { export Foo.Blue } -import Foo._ +import Foo.* def foo(a: MyEnum): Seq[Bar.Blue] = a match { case Red => Seq.empty diff --git a/tests/pos-special/fatal-warnings/i9804.scala b/tests/pos-special/fatal-warnings/i9804.scala index 8aa4c34eca31..e42c13f3ebdc 100644 --- a/tests/pos-special/fatal-warnings/i9804.scala +++ b/tests/pos-special/fatal-warnings/i9804.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def f[A: Type](e: Expr[A])(using Quotes): Expr[A] = e match { case '{ $e2 } => e2 diff --git a/tests/pos-special/fatal-warnings/matchable-same-type.scala b/tests/pos-special/fatal-warnings/matchable-same-type.scala index c6cee3fcdc48..afcef9619855 100644 --- a/tests/pos-special/fatal-warnings/matchable-same-type.scala +++ b/tests/pos-special/fatal-warnings/matchable-same-type.scala @@ -1,4 +1,4 @@ -import scala.language.`3.1-migration` +import scala.language.`future-migration` type X def x: X = ??? diff --git a/tests/pos-special/fatal-warnings/switches.scala b/tests/pos-special/fatal-warnings/switches.scala index 723727df493c..142aec175f3c 100644 --- a/tests/pos-special/fatal-warnings/switches.scala +++ b/tests/pos-special/fatal-warnings/switches.scala @@ -1,7 +1,7 @@ import scala.annotation.switch class Test { - import Test._ + import Test.* def test1(x: Int): Int = (x: @switch) match { case 1 => 1 diff --git a/tests/pos-special/fatal-warnings/tasty-parent-unapply.scala b/tests/pos-special/fatal-warnings/tasty-parent-unapply.scala index 196d31a07c4d..f76faa8f0e93 100644 --- a/tests/pos-special/fatal-warnings/tasty-parent-unapply.scala +++ b/tests/pos-special/fatal-warnings/tasty-parent-unapply.scala @@ -1,10 +1,10 @@ -import scala.quoted._ +import scala.quoted.* object Macros { def impl(using Quotes): Unit = { - import quotes.reflect._ + import quotes.reflect.* def foo(tree: Tree, term: Term, typeTree: TypeTree, parent: Tree) = { diff --git a/tests/pos-special/fatal-warnings/type-test-matchable.scala b/tests/pos-special/fatal-warnings/type-test-matchable.scala index 5becee6f2e9f..f6d64d0e8aaa 100644 --- a/tests/pos-special/fatal-warnings/type-test-matchable.scala +++ b/tests/pos-special/fatal-warnings/type-test-matchable.scala @@ -1,4 +1,4 @@ -import scala.language.`3.1-migration` +import scala.language.`future-migration` import scala.reflect.TypeTest trait Foo: diff --git a/tests/pos-special/i7592/Macros_1.scala b/tests/pos-special/i7592/Macros_1.scala index 4794c704c61f..7564433fdc20 100644 --- a/tests/pos-special/i7592/Macros_1.scala +++ b/tests/pos-special/i7592/Macros_1.scala @@ -1,7 +1,7 @@ -import scala.quoted._ +import scala.quoted.* def compileImpl[T](expr : Expr[T])(using Quotes) : Expr[T] = { - import quotes.reflect._ + import quotes.reflect.* def proc(term : Term): Term = { term match { diff --git a/tests/pos-special/sourcepath/outer/Test2.scala b/tests/pos-special/sourcepath/outer/Test2.scala index 0d0012204065..50e5e00122da 100644 --- a/tests/pos-special/sourcepath/outer/Test2.scala +++ b/tests/pos-special/sourcepath/outer/Test2.scala @@ -1,5 +1,5 @@ package outer -import nested._ +import nested.* class Test2 extends A(22) { diff --git a/tests/pos-special/sourcepath/outer/Test3.scala b/tests/pos-special/sourcepath/outer/Test3.scala index f092aba589b6..8a270409bf3d 100644 --- a/tests/pos-special/sourcepath/outer/Test3.scala +++ b/tests/pos-special/sourcepath/outer/Test3.scala @@ -1,5 +1,5 @@ package outer -import nested._ +import nested.* class Test3 { diff --git a/tests/pos-special/sourcepath/outer/indent2.scala b/tests/pos-special/sourcepath/outer/indent2.scala index 354b92601e05..90de7f409f30 100644 --- a/tests/pos-special/sourcepath/outer/indent2.scala +++ b/tests/pos-special/sourcepath/outer/indent2.scala @@ -1,5 +1,5 @@ package outer -import nested._ +import nested.* object indent2 { val x2: Int = indent1.inner.x diff --git a/tests/pos-special/sourcepath/outer/toplevel2.scala b/tests/pos-special/sourcepath/outer/toplevel2.scala index d20c7a10e0ab..9609f6057c1b 100644 --- a/tests/pos-special/sourcepath/outer/toplevel2.scala +++ b/tests/pos-special/sourcepath/outer/toplevel2.scala @@ -1,5 +1,5 @@ package outer -import nested._ +import nested.* object toplevel2 { val a: Int = one diff --git a/tests/pos-special/strawman-collections/CollectionStrawMan1.scala b/tests/pos-special/strawman-collections/CollectionStrawMan1.scala index 631e2f8e3b71..09f0d54b0bdd 100644 --- a/tests/pos-special/strawman-collections/CollectionStrawMan1.scala +++ b/tests/pos-special/strawman-collections/CollectionStrawMan1.scala @@ -1,6 +1,6 @@ package strawman.collections -import Predef.{augmentString => _, wrapString => _, _} +import Predef.{augmentString as _, wrapString as _, *} import scala.reflect.ClassTag /** A strawman architecture for new collections. It contains some diff --git a/tests/pos-special/strawman-collections/CollectionStrawMan4.scala b/tests/pos-special/strawman-collections/CollectionStrawMan4.scala index 5383acc02293..5ca8a978c4fd 100644 --- a/tests/pos-special/strawman-collections/CollectionStrawMan4.scala +++ b/tests/pos-special/strawman-collections/CollectionStrawMan4.scala @@ -1,6 +1,6 @@ package strawman.collections -import Predef.{augmentString => _, wrapString => _, _} +import Predef.{augmentString as _, wrapString as _, *} import scala.reflect.ClassTag import annotation.unchecked.uncheckedVariance import annotation.tailrec diff --git a/tests/pos-special/strawman-collections/CollectionStrawMan5.scala b/tests/pos-special/strawman-collections/CollectionStrawMan5.scala index 2296b29c82f1..52c5f3baa2e1 100644 --- a/tests/pos-special/strawman-collections/CollectionStrawMan5.scala +++ b/tests/pos-special/strawman-collections/CollectionStrawMan5.scala @@ -1,6 +1,6 @@ package strawman.collections -import Predef.{augmentString => _, wrapString => _, _} +import Predef.{augmentString as _, wrapString as _, *} import scala.reflect.ClassTag import annotation.unchecked.uncheckedVariance import annotation.tailrec diff --git a/tests/pos-special/strawman-collections/CollectionStrawMan6.scala b/tests/pos-special/strawman-collections/CollectionStrawMan6.scala index f13c19dad04e..9f189afbcf3a 100644 --- a/tests/pos-special/strawman-collections/CollectionStrawMan6.scala +++ b/tests/pos-special/strawman-collections/CollectionStrawMan6.scala @@ -1,13 +1,13 @@ package strawman.collections -import Predef.{augmentString => _, wrapString => _, _} +import Predef.{augmentString as _, wrapString as _, *} import scala.reflect.ClassTag import annotation.unchecked.uncheckedVariance import annotation.tailrec import compiletime.uninitialized class LowPriority { - import CollectionStrawMan6._ + import CollectionStrawMan6.* /** Convert array to iterable via view. Lower priority than ArrayOps */ implicit def arrayToView[T](xs: Array[T]): ArrayView[T] = new ArrayView[T](xs) diff --git a/tests/pos-special/typeclass-scaling.scala b/tests/pos-special/typeclass-scaling.scala index 6102e346136b..4b809de664f3 100644 --- a/tests/pos-special/typeclass-scaling.scala +++ b/tests/pos-special/typeclass-scaling.scala @@ -19,7 +19,7 @@ import scala.annotation.tailrec // user 1m6.337s // sys 0m1.344s object datatypes { - import typeclasses._ + import typeclasses.* enum E1[T] derives Eq, Pickler { case C1(x1: T) @@ -215,8 +215,8 @@ object typeclasses { object Eq { import scala.compiletime.erasedValue - import compiletime._ - import scala.deriving._ + import compiletime.* + import scala.deriving.* inline def tryEql[TT](x: TT, y: TT): Boolean = summonInline[Eq[TT]].eql(x, y) @@ -266,8 +266,8 @@ object typeclasses { object Pickler { import scala.compiletime.{erasedValue, constValue} - import compiletime._ - import deriving._ + import compiletime.* + import deriving.* def nextInt(buf: mutable.ListBuffer[Int]): Int = try buf.head finally buf.trimStart(1) @@ -356,8 +356,8 @@ object typeclasses { } } } -import datatypes._ -import typeclasses._ +import datatypes.* +import typeclasses.* // Tests object Test extends App { diff --git a/tests/pos-staging/quote-0.scala b/tests/pos-staging/quote-0.scala index a772a6395999..a9eb68ffce5f 100644 --- a/tests/pos-staging/quote-0.scala +++ b/tests/pos-staging/quote-0.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Macros { @@ -31,7 +31,7 @@ class Test { run { val program = '{ - import Macros._ + import Macros.* val x = 1 assert(x != 0) diff --git a/tests/pos-staging/quote-assert/quoted_1.scala b/tests/pos-staging/quote-assert/quoted_1.scala index 83a707770474..2bf170574eb4 100644 --- a/tests/pos-staging/quote-assert/quoted_1.scala +++ b/tests/pos-staging/quote-assert/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { def assertImpl(expr: Expr[Boolean])(using Quotes) = diff --git a/tests/pos-staging/quote-assert/quoted_2.scala b/tests/pos-staging/quote-assert/quoted_2.scala index c9c8caf4112e..95a2044cf271 100644 --- a/tests/pos-staging/quote-assert/quoted_2.scala +++ b/tests/pos-staging/quote-assert/quoted_2.scala @@ -1,8 +1,8 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* -import Macros._ +import Macros.* object Test { diff --git a/tests/pos-with-compiler/A.scala b/tests/pos-with-compiler/A.scala index d5e8ad4e44e3..bab94e771eb6 100644 --- a/tests/pos-with-compiler/A.scala +++ b/tests/pos-with-compiler/A.scala @@ -1,5 +1,5 @@ -import dotty.tools.dotc.core.Decorators._ -import dotty.tools.dotc.core.NameOps._ +import dotty.tools.dotc.core.Decorators.* +import dotty.tools.dotc.core.NameOps.* object Test { "JFunction".toTermName.specializedFor(Nil, ???, Nil, Nil)(using ???) diff --git a/tests/pos-with-compiler/Fileish.scala b/tests/pos-with-compiler/Fileish.scala index d226bb0bdeee..8ba62efb3298 100644 --- a/tests/pos-with-compiler/Fileish.scala +++ b/tests/pos-with-compiler/Fileish.scala @@ -3,7 +3,7 @@ package dotty.tools package io -import java.io.{ InputStream } +import java.io.InputStream import java.util.jar.JarEntry import language.postfixOps diff --git a/tests/pos-with-compiler/Labels.scala b/tests/pos-with-compiler/Labels.scala index f1a120920f05..a01141cd7d53 100644 --- a/tests/pos-with-compiler/Labels.scala +++ b/tests/pos-with-compiler/Labels.scala @@ -1,5 +1,5 @@ import dotty.tools.dotc.ast.Trees.Thicket -import dotty.tools.dotc.ast.tpd._ +import dotty.tools.dotc.ast.tpd.* object Labels { diff --git a/tests/pos-with-compiler/Patterns.scala b/tests/pos-with-compiler/Patterns.scala index ecbde54df0b0..6492ce6f8c72 100644 --- a/tests/pos-with-compiler/Patterns.scala +++ b/tests/pos-with-compiler/Patterns.scala @@ -1,5 +1,5 @@ -import dotty.tools.dotc.ast.Trees._ -import dotty.tools.dotc.core.Types._ +import dotty.tools.dotc.ast.Trees.* +import dotty.tools.dotc.core.Types.* object Patterns { val d: Object = null diff --git a/tests/pos-with-compiler/i143.scala b/tests/pos-with-compiler/i143.scala index c7863d45b90f..bd49cd21a963 100644 --- a/tests/pos-with-compiler/i143.scala +++ b/tests/pos-with-compiler/i143.scala @@ -1,9 +1,9 @@ package dotty.tools.dotc package transform -import dotty.tools.dotc.core.Denotations._ -import dotty.tools.dotc.core.Symbols._ -import dotty.tools.dotc.core.Contexts._ +import dotty.tools.dotc.core.Denotations.* +import dotty.tools.dotc.core.Symbols.* +import dotty.tools.dotc.core.Contexts.* class TC5(val ctx: Context) extends AnyVal { def candidates(mbr: SingleDenotation): Boolean = { diff --git a/tests/pos-with-compiler/lazyValsSepComp.scala b/tests/pos-with-compiler/lazyValsSepComp.scala index 78edf31d4567..c7e97dc12142 100644 --- a/tests/pos-with-compiler/lazyValsSepComp.scala +++ b/tests/pos-with-compiler/lazyValsSepComp.scala @@ -1,11 +1,11 @@ package dotty.tools package io -import java.io.{ InputStream } +import java.io.InputStream import java.util.jar.JarEntry import dotty.tools.dotc.core.Definitions import language.postfixOps -import dotty.tools.dotc.core.Contexts._ +import dotty.tools.dotc.core.Contexts.* /** A test to trigger issue with separate compilation and lazy vals */ diff --git a/tests/pos-with-compiler/tasty/test-definitions.scala b/tests/pos-with-compiler/tasty/test-definitions.scala index 5a45840dec84..3def4d22d62a 100644 --- a/tests/pos-with-compiler/tasty/test-definitions.scala +++ b/tests/pos-with-compiler/tasty/test-definitions.scala @@ -343,8 +343,8 @@ abstract class Tasty { // The concrete implementation - hidden from users. object ReflectionImpl extends Tasty { - import definitions._ - import dotty.tools.dotc._ + import definitions.* + import dotty.tools.dotc.* import ast.tpd import core.{Types, Symbols, Contexts} import util.Spans @@ -411,8 +411,8 @@ object ReflectionImpl extends Tasty { as fast as native access. object ReflectionImpl extends TastyAST { - import definitions._ - import dotty.tools.dotc._ + import definitions.* + import dotty.tools.dotc.* import ast.tpd import core.{Types, Symbols, Contexts} import util.{Positions} diff --git a/tests/pos/6709.scala b/tests/pos/6709.scala index 1833459efff5..038cbcab8957 100644 --- a/tests/pos/6709.scala +++ b/tests/pos/6709.scala @@ -51,7 +51,7 @@ object Main { case Even[N <: BinNat](n: N) } - import BinNat._ + import BinNat.* type Inc[N <: BinNat] <: BinNat = N match { diff --git a/tests/pos/IArrayToArraySeq.scala b/tests/pos/IArrayToArraySeq.scala new file mode 100644 index 000000000000..8c4a305b4425 --- /dev/null +++ b/tests/pos/IArrayToArraySeq.scala @@ -0,0 +1,12 @@ +def test: Unit = + IArray(2, 1, 3).toSeq + IArray(2, 1, 3).toSeq.toList + IArray(2, 1, 3).toSeq.updated(1, 2) + IArray(2, 1, 3).toSeq.updated(1, "a") + IArray(2, 1, 3).toSeq.sorted + IArray(2, 1, 3).toSeq.appended("b") + IArray(2, 1, 3).toSeq.prepended("b") + IArray(2, 1, 3).toSeq.appendedAll(IArray(4,5, "a").toSeq) + IArray(2, 1, 3).toSeq.prependedAll(IArray(4,5, "a").toSeq) + val x1: Seq[Int] = Array(1, 2).toSeq + val x2: Seq[Int] = IArray(1, 2).toSeq diff --git a/tests/pos/Iter2.scala b/tests/pos/Iter2.scala index ff4ab32e0c21..c61b1e190012 100644 --- a/tests/pos/Iter2.scala +++ b/tests/pos/Iter2.scala @@ -163,7 +163,7 @@ object Iter2 { } case class ArrayIterator[+A](elems: Array[AnyRef], len: Int) extends Iterator[A] { - import ArrayIterator._ + import ArrayIterator.* private def elem(i: Int) = elems(i).asInstanceOf[A] diff --git a/tests/pos/Meter.scala b/tests/pos/Meter.scala index 321047b0215f..842454ffede9 100644 --- a/tests/pos/Meter.scala +++ b/tests/pos/Meter.scala @@ -46,8 +46,8 @@ package b { protected def proprint = Console.print("<<<") } } -import a._ -import _root_.b._ +import a.* +import _root_.b.* object Test extends App { { diff --git a/tests/pos/Monoid.scala b/tests/pos/Monoid.scala index f6004cdf319f..54b15677ca5f 100644 --- a/tests/pos/Monoid.scala +++ b/tests/pos/Monoid.scala @@ -49,7 +49,7 @@ object Test { } import Monoid.ops._ // works in dotty, fails in scalac - import Ring.ops._ + import Ring.ops.* "abc" |+| "def" "abc" |+| StringMonoid.id StringMonoid.id |+| "abc" diff --git a/tests/pos/Repeated.scala b/tests/pos/Repeated.scala new file mode 100644 index 000000000000..058edba2d174 --- /dev/null +++ b/tests/pos/Repeated.scala @@ -0,0 +1,176 @@ +package scala.collection +package immutable + +import scala.collection.Stepper.EfficientSplit +import scala.collection.immutable.Range +import scala.collection.mutable.Buffer +import scala.collection.IterableOps.SizeCompareOps +import scala.collection.Searching.SearchResult +import scala.math.Ordering +import scala.reflect.ClassTag +import scala.util.Sorting +import annotation.targetName + +opaque type Repeated[+A] = Seq[A] +object Repeated: + + extension [A](xs: Repeated[A]) + def length: Int = xs.length + def apply(n: Int) = xs.apply(n) + def iterator: Iterator[A] = xs.iterator + + def ++[B >: A](suffix: IterableOnce[B]): Repeated[B] = xs ++ suffix + def :+ [B >: A](x: B): Repeated[B] = xs :+ x + def :++ [B >: A](suffix: IterableOnce[B]): Repeated[B] = xs :++ suffix + + def addString(b: mutable.StringBuilder): mutable.StringBuilder = xs.addString(b) + def addString(b: mutable.StringBuilder, sep: String): mutable.StringBuilder = xs.addString(b, sep) + def addString(b: mutable.StringBuilder, start: String, sep: String, end: String): mutable.StringBuilder = xs.addString(b, start, sep, end) + def appended[B >: A](x: B): Repeated[B] = xs.appended(x) + def appendedAll[B >: A](suffix: IterableOnce[B]): Repeated[B] = xs.appendedAll(suffix) + def collect[B](pf: PartialFunction[A, B]): Repeated[B] = xs.collect(pf) + def collectFirst[B](f: PartialFunction[A, B]): Option[B] = xs.collectFirst(f) + def combinations(n: Int): Iterator[Repeated[A]] = xs.combinations(n) + def concat[B >: A](suffix: IterableOnce[B]): Repeated[B] = xs.concat(suffix) + def contains(elem: A): Boolean = xs.contains(elem) + def containsSlice[B](that: Seq[B]): Boolean = xs.containsSlice(that) + def copyToArray[B >: A](ys: Array[B]): Int = xs.copyToArray(ys) + def copyToArray[B >: A](ys: Array[B], start: Int): Int = xs.copyToArray(ys, start) + def copyToArray[B >: A](ys: Array[B], start: Int, len: Int): Int = xs.copyToArray(ys, start, len) + def corresponds[B](that: IterableOnce[B])(p: (A, B) => Boolean): Boolean = xs.corresponds(that)(p) + def count(p: A => Boolean): Int = xs.count(p) + def diff[B >: A](that: Seq[B]): Repeated[A] = xs.diff(that) + def distinct: Repeated[A] = xs.distinct + def distinctBy[B](f: A => B): Repeated[A] = xs.distinctBy(f) + def drop(n: Int): Repeated[A] = xs.drop(n) + def dropRight(n: Int): Repeated[A] = xs.dropRight(n) + def dropWhile(p: A => Boolean): Repeated[A] = xs.dropWhile(p) + def empty: Repeated[A] = xs.empty + def endsWith[B >: A](that: Iterable[B]): Boolean = xs.endsWith(that) + def exists(p: A => Boolean): Boolean = xs.exists(p) + def filter(p: A => Boolean): Repeated[A] = xs.filter(p) + def filterNot(p: A => Boolean): Repeated[A] = xs.filterNot(p) + def find(p: A => Boolean): Option[A] = xs.find(p) + def findLast(p: A => Boolean): Option[A] = xs.findLast(p) + def flatMap[B](f: A => IterableOnce[B]): Repeated[B] = xs.flatMap(f) + def fold[A1 >: A](z: A1)(op: (A1, A1) => A1): A1 = xs.fold(z)(op) + def foldLeft[B](z: B)(op: (B, A) => B): B = xs.foldLeft(z)(op) + def foldRight[B](z: B)(op: (A, B) => B): B = xs.foldRight(z)(op) + def forall(p: A => Boolean): Boolean = xs.forall(p) + def foreach[U](f: A => U): Unit = xs.foreach(f) + def groupBy[K](f: A => K): immutable.Map[K, Repeated[A]] = xs.groupBy(f) + def groupMap[K, B](key: A => K)(f: A => B): immutable.Map[K, Repeated[B]] = xs.groupMap(key)(f) + def groupMapReduce[K, B](key: (A) => K)(f: (A) => B)(reduce: (B, B) => B): immutable.Map[K, B] = xs.groupMapReduce(key)(f)(reduce) + def grouped(size: Int): Iterator[Repeated[A]] = xs.grouped(size) + def head: A = xs.head + def headOption: Option[A] = xs.headOption + def indexOf(elem: A, from: Int = 0): Int = xs.indexOf(elem, from) + def indexOfSlice[B >: A](that: Seq[B]): Int = xs.indexOfSlice(that) + def indexOfSlice[B >: A](that: Seq[B], from: Int): Int = xs.indexOfSlice(that, from) + def indexWhere(p: A => Boolean, from: Int = 0): Int = xs.indexWhere(p, from) + def indices: Range = xs.indices + def init: Repeated[A] = xs.init + def inits: Iterator[Repeated[A]] = xs.inits + def intersect[B >: A](that: Seq[B]): Repeated[A] = xs.intersect(that) + def isEmpty: Boolean = xs.isEmpty + def isTraversableAgain: Boolean = xs.isTraversableAgain + def knownSize: Int = xs.length + def last: A = xs.last + def lastIndexOf(elem: A, end: Int = xs.length - 1): Int = xs.lastIndexOf(elem, end) + def lastIndexOfSlice[B >: A](that: Seq[B]): Int = xs.lastIndexOfSlice(that) + def lastIndexOfSlice[B >: A](that: Seq[B], end: Int): Int = xs.lastIndexOfSlice(that, end) + def lastIndexWhere(p: A => Boolean, end: Int = xs.length - 1): Int = xs.lastIndexWhere(p, end) + def lastOption: Option[A] = xs.lastOption + def lazyZip[B](that: Iterable[B]): LazyZip2[A, B, Repeated[A]] = xs.lazyZip[B](that).asInstanceOf[LazyZip2[A, B, Repeated[A]]] + def lengthCompare(len: Int): Int = xs.lengthCompare(len) + def lengthIs: SizeCompareOps = xs.lengthIs + def map[B](f: A => B): Repeated[B] = xs.map(f) + def max[B >: A](using math.Ordering[B]): A = xs.max[B] + def maxBy[B](f: A => B)(using math.Ordering[B]): A = xs.maxBy(f) + def maxByOption[B](f: A => B)(using math.Ordering[B]): Option[A] = xs.maxByOption(f) + def maxOption[B >: A](using math.Ordering[B]): Option[B] = xs.maxOption[B] + def min[B >: A](using math.Ordering[B]): A = xs.min[B] + def minBy[B](f: A => B)(using math.Ordering[B]): A = xs.minBy(f) + def minByOption[B](f: A => B)(using math.Ordering[B]): Option[A] = xs.minByOption(f) + def minOption[B >: A](using math.Ordering[B]): Option[B] = xs.minOption[B] + def mkString: String = xs.mkString + def mkString(sep: String): String = xs.mkString(sep) + def mkString(start: String, sep: String, end: String): String = xs.mkString(start, sep, end) + def nonEmpty: Boolean = xs.nonEmpty + def padTo[B >: A](len: Int, elem: B): Repeated[B] = xs.padTo(len, elem) + def partition(p: A => Boolean): (Repeated[A], Repeated[A]) = xs.partition(p) + def partitionMap[A1, A2](f: A => Either[A1, A2]): (Repeated[A1], Repeated[A2]) = xs.partitionMap(f) + def patch[B >: A](from: Int, other: IterableOnce[B], replaced: Int): Repeated[B] = xs.patch(from, other, replaced) + def permutations: Iterator[Repeated[A]] = xs.permutations + def prepended[B >: A](x: B): Repeated[B] = xs.prepended(x) + def prependedAll[B >: A](prefix: IterableOnce[B]): Repeated[B] = xs.prependedAll(prefix) + def product[B >: A](using math.Numeric[B]): B = xs.product[B] + def reduce[B >: A](op: (B, B) => B): B = xs.reduce(op) + def reduceLeft[B >: A](op: (B, A) => B): B = xs.reduceLeft(op) + def reduceRight[B >: A](op: (A, B) => B): B = xs.reduceRight(op) + def reverse: Repeated[A] = xs.reverse + def reverseIterator: Iterator[A] = xs.reverseIterator + def sameElements[B >: A](that: IterableOnce[B]): Boolean = xs.sameElements(that) + def scan[B >: A](z: B)(op: (B, B) => B): Repeated[B] = xs.scan(z)(op) + def scanLeft[B](z: B)(op: (B, A) => B): Repeated[B] = xs.scanLeft(z)(op) + def scanRight[B](z: B)(op: (A, B) => B): Repeated[B] = xs.scanRight(z)(op) + def search[B >: A](elem: B)(using Ordering[B]): SearchResult = xs.search(elem) + def search[B >: A](elem: B, from: Int, to: Int)(using Ordering[B]): SearchResult = xs.search(elem, from, to) + def segmentLength(p: (A) => Boolean, from: Int): Int = xs.segmentLength(p, from) + def segmentLength(p: (A) => Boolean): Int = xs.segmentLength(p) + def size: Int = xs.size + def sizeCompare(that: Iterable[_]): Int = xs.sizeCompare(that) + def sizeCompare(otherSize: Int): Int = xs.sizeCompare(otherSize) + def sizeIs: SizeCompareOps = xs.sizeIs + def slice(from: Int, until: Int): Repeated[A] = xs.slice(from, until) + def sliding(size: Int, step: Int = 1): Iterator[Repeated[A]] = xs.sliding(size, step) + def sortBy[B](f: A => B)(implicit ord: Ordering[B]): Repeated[A] = xs.sortBy(f) + def sortWith(lt: (A, A) => Boolean): Repeated[A] = xs.sortWith(lt) + def sorted[B >: A](implicit ord: Ordering[B]): Repeated[A] = xs.sorted[B] + def span(p: A => Boolean): (Repeated[A], Repeated[A]) = xs.span(p) + def splitAt(n: Int): (Repeated[A], Repeated[A]) = xs.splitAt(n) + def startsWith[B >: A](that: IterableOnce[B], offset: Int): Boolean = xs.startsWith(that, offset) + def stepper[S <: Stepper[_]](using StepperShape[A, S]): S = xs.stepper[S] + def sum[B >: A](using math.Numeric[B]): B = xs.sum[B] + def tail: Repeated[A] = xs.tail + def tails: Iterator[Repeated[A]] = xs.tails + def take(n: Int): Repeated[A] = xs.take(n) + def takeRight(n: Int): Repeated[A] = xs.takeRight(n) + def takeWhile(p: A => Boolean): Repeated[A] = xs.takeWhile(p) + def tapEach[U](f: (A) => U): Repeated[A] = xs.tapEach(f) + def to[C1](factory: Factory[A, C1]): C1 = xs.to(factory) + def toArray[B >: A: ClassTag]: Array[B] = xs.toArray[B] + def toBuffer[B >: A]: Buffer[B] = xs.toBuffer[B] + def toIndexedSeq: immutable.IndexedSeq[A] = xs.toIndexedSeq + def toIterable: Iterable[A] = xs.toIterable + def toList: List[A] = xs.toList + def toSeq: Seq[A] = xs.toSeq + def toSet: Set[A] = xs.toSet + def toVector: Vector[A] = xs.toVector + def updated[B >: A](index: Int, elem: B): Repeated[B] = xs.updated(index, elem) + def view: SeqView[A] = xs.view + def withFilter(p: A => Boolean): WithFilter[A, Repeated] = xs.withFilter(p) + def zip[B](that: IterableOnce[B]): Repeated[(A, B)] = xs.zip(that) + def zipAll[A1 >: A, B](that: Iterable[B], thisElem: A1, thatElem: B): Repeated[(A1, B)] = xs.zipAll(that, thisElem, thatElem) + def zipWithIndex: Repeated[(A, Int)] = xs.zipWithIndex + + extension [A](xs: Repeated[IterableOnce[A]]) + def flatten: Repeated[A] = xs.flatten + + extension [A](prefix: IterableOnce[A]) + def ++: (xs: Repeated[A]): Repeated[A] = xs.prependedAll(prefix) + + extension [A](x: A) + def +: (xs: Repeated[A]): Repeated[A] = xs.prepended(x) + + extension [A1, A2](xs: Repeated[(A1, A2)]) + def unzip: (Repeated[A1], Repeated[A2]) = xs.unzip + def toMap: Map[A1, A2] = xs.toMap + + extension [A1, A2, A3](xs: Repeated[(A1, A2, A3)]) + def unzip3: (Repeated[A1], Repeated[A2], Repeated[A3]) = xs.unzip3 + + extension [A](xs: Repeated[Repeated[A]]) + def transpose: Repeated[Repeated[A]] = xs.transpose + + implicit def repeatedToSeq[A](xs: Repeated[A]): Seq[A] = xs.toSeq \ No newline at end of file diff --git a/tests/pos/StringContext.scala b/tests/pos/StringContext.scala index 1fcfd01522a2..e473225a79c3 100644 --- a/tests/pos/StringContext.scala +++ b/tests/pos/StringContext.scala @@ -12,7 +12,7 @@ package scala -import java.lang.{ StringBuilder => JLSBuilder } +import java.lang.StringBuilder as JLSBuilder import scala.annotation.tailrec /** This class provides the basic mechanism to do String Interpolation. @@ -56,7 +56,7 @@ import scala.annotation.tailrec */ case class StringContext(parts: String*) { - import StringContext.{checkLengths => scCheckLengths, glob, standardInterpolator => scStandardInterpolator} + import StringContext.{checkLengths as scCheckLengths, glob, standardInterpolator as scStandardInterpolator} @deprecated("use same-named method on StringContext companion object", "2.13.0") def checkLengths(args: scala.collection.Seq[Any]): Unit = scCheckLengths(args, parts) diff --git a/tests/pos/X.scala b/tests/pos/X.scala index da85d901ec59..ce5fcb547bbf 100644 --- a/tests/pos/X.scala +++ b/tests/pos/X.scala @@ -1,4 +1,4 @@ -import scala.deriving._ +import scala.deriving.* trait FunctorK[F[_[_]]] object FunctorK { diff --git a/tests/pos/assignments.scala b/tests/pos/assignments.scala index 9801bdca22e3..df7d286e6ba2 100644 --- a/tests/pos/assignments.scala +++ b/tests/pos/assignments.scala @@ -19,7 +19,7 @@ object assignments { c.x *= 2 val cc = c - import cc._ + import cc.* x = x + 1 x *= 2 } diff --git a/tests/pos/bigint.scala b/tests/pos/bigint.scala index e1aaaf96ecf8..4f5661a48e35 100644 --- a/tests/pos/bigint.scala +++ b/tests/pos/bigint.scala @@ -1,5 +1,5 @@ import scala.math.BigInt -//import BigInt._ +//import BigInt.* object test { 1 * BigInt(0) diff --git a/tests/pos/byname-implicits-13.scala b/tests/pos/byname-implicits-13.scala index abe4f47c0e05..92782fd03eaf 100644 --- a/tests/pos/byname-implicits-13.scala +++ b/tests/pos/byname-implicits-13.scala @@ -179,7 +179,7 @@ object equal { def ===(y: T): Boolean = eqT.eqv(x, y) } - import GenericInstances._ + import GenericInstances.* implicit val EqLongInstance: Eq[Long] = new Eq[Long] { def eqv(x: Long, y: Long): Boolean = x == y } implicit val EqDoubleInstance: Eq[Double] = new Eq[Double] { def eqv(x: Double, y: Double): Boolean = x == y } diff --git a/tests/pos/byname-implicits-14.scala b/tests/pos/byname-implicits-14.scala index cf1f2084df31..a428220ddf05 100644 --- a/tests/pos/byname-implicits-14.scala +++ b/tests/pos/byname-implicits-14.scala @@ -179,7 +179,7 @@ object equal { def ===(y: T): Boolean = eqT.eqv(x, y) } - import GenericInstances._ + import GenericInstances.* implicit val EqLongInstance: Eq[Long] = new Eq[Long] { def eqv(x: Long, y: Long): Boolean = x == y } implicit val EqDoubleInstance: Eq[Double] = new Eq[Double] { def eqv(x: Double, y: Double): Boolean = x == y } diff --git a/tests/pos/byname-implicits-9.scala b/tests/pos/byname-implicits-9.scala index 217852cd4085..2f810ca4805d 100644 --- a/tests/pos/byname-implicits-9.scala +++ b/tests/pos/byname-implicits-9.scala @@ -68,6 +68,6 @@ object Show { } object Test { - import ListInstances._ + import ListInstances.* implicitly[Show[List[Int]]] } diff --git a/tests/pos/classtag-typetest/3_1-migration.scala b/tests/pos/classtag-typetest/3_1-migration.scala index 0cd62d9cdb36..19cf81233658 100644 --- a/tests/pos/classtag-typetest/3_1-migration.scala +++ b/tests/pos/classtag-typetest/3_1-migration.scala @@ -1,4 +1,4 @@ -import scala.language.`3.1-migration` +import scala.language.`future-migration` import scala.reflect.ClassTag def f3_1m[T: ClassTag](x: Any): Unit = diff --git a/tests/pos/classtag-typetest/3_1.scala b/tests/pos/classtag-typetest/3_1.scala index 12a3c2a3bb94..a5eb11a363c0 100644 --- a/tests/pos/classtag-typetest/3_1.scala +++ b/tests/pos/classtag-typetest/3_1.scala @@ -1,4 +1,4 @@ -import scala.language.`3.1` +import scala.language.future import scala.reflect.ClassTag def f3_1[T: ClassTag](x: Any): Unit = diff --git a/tests/pos/collectGenericCC.scala b/tests/pos/collectGenericCC.scala index ba19d78d065d..66f30e93979f 100644 --- a/tests/pos/collectGenericCC.scala +++ b/tests/pos/collectGenericCC.scala @@ -1,4 +1,4 @@ -import scala.collection._ +import scala.collection.* object Test { def collect[A, Res](r: Iterable[A])(implicit bf: Factory[A, Res]) = { diff --git a/tests/pos/consume.scala b/tests/pos/consume.scala index d17638bb84a0..5b911d50528e 100644 --- a/tests/pos/consume.scala +++ b/tests/pos/consume.scala @@ -5,8 +5,8 @@ object Test1: object Test2 { import scala.math.Numeric - import scala.math.Numeric.Implicits._ - import scala.math.Ordering.Implicits._ + import scala.math.Numeric.Implicits.* + import scala.math.Ordering.Implicits.* def consume[T: Numeric](xs: List[T], limit: T): List[T] = val zero = implicitly[Numeric[T]].zero diff --git a/tests/pos/depmet_implicit_norm_ret.scala b/tests/pos/depmet_implicit_norm_ret.scala index 9582fe871495..13e253991111 100644 --- a/tests/pos/depmet_implicit_norm_ret.scala +++ b/tests/pos/depmet_implicit_norm_ret.scala @@ -17,7 +17,7 @@ object Test{ } } - import ZipWith._ + import ZipWith.* trait ZipWith[S] { type T diff --git a/tests/pos/elidable-tparams.scala b/tests/pos/elidable-tparams.scala index d65478bcb73e..8c0377e0813d 100644 --- a/tests/pos/elidable-tparams.scala +++ b/tests/pos/elidable-tparams.scala @@ -1,5 +1,5 @@ -import annotation._ -import elidable._ +import annotation.* +import elidable.* class ElidableCrashTest { trait My diff --git a/tests/pos/enum-List-control.scala b/tests/pos/enum-List-control.scala index dbe4b2a48f42..0810f9d09bf8 100644 --- a/tests/pos/enum-List-control.scala +++ b/tests/pos/enum-List-control.scala @@ -19,7 +19,7 @@ object List { } } object Test { - import List._ + import List.* val xs = Cons(1, Cons(2, Cons(3, Nil()))) def main(args: Array[String]) = println(xs) } diff --git a/tests/pos/enum-widen.scala b/tests/pos/enum-widen.scala index 32bbcf9a3242..47f3a915d502 100644 --- a/tests/pos/enum-widen.scala +++ b/tests/pos/enum-widen.scala @@ -4,7 +4,7 @@ object test: case Some[T](x: T) extends Option[T] case None - import Option._ + import Option.* var x = Some(1) val y: Some[Int] = Some(2) @@ -16,6 +16,6 @@ object test: enum Nat: case Z case S[N <: Z.type | S[_]](pred: N) - import Nat._ + import Nat.* val two = S(S(Z)) diff --git a/tests/pos/gadt-infer-ascription.scala b/tests/pos/gadt-infer-ascription.scala index 773b1ee17eca..6a3b01fc8325 100644 --- a/tests/pos/gadt-infer-ascription.scala +++ b/tests/pos/gadt-infer-ascription.scala @@ -5,7 +5,7 @@ object GadtAscription { case S[G, A, B](x: Var[G, A]) extends Var[(B, G), A] } - import Var._ + import Var.* def evalVar[G, A](x: Var[G, A])(rho: G): A = x match { case _: Z[g, a] => rho(0) diff --git a/tests/pos/gadt-inference.scala b/tests/pos/gadt-inference.scala index e625e4823dc0..bf471ca9184d 100644 --- a/tests/pos/gadt-inference.scala +++ b/tests/pos/gadt-inference.scala @@ -3,7 +3,7 @@ object `gadt-inference` { case StrLit(s: String) extends Expr[String] case IntLit(i: Int) extends Expr[Int] } - import Expr._ + import Expr.* def eval[T](e: Expr[T]) = e match { diff --git a/tests/pos/gen-traversable-methods.scala b/tests/pos/gen-traversable-methods.scala index b59cd33c769b..34c96b86db17 100644 --- a/tests/pos/gen-traversable-methods.scala +++ b/tests/pos/gen-traversable-methods.scala @@ -1,7 +1,7 @@ -import collection._ +import collection.* diff --git a/tests/pos/i0239.scala b/tests/pos/i0239.scala index 0dfba7ea07bd..258c3c987adc 100644 --- a/tests/pos/i0239.scala +++ b/tests/pos/i0239.scala @@ -18,7 +18,7 @@ object test1 { def compute[A](implicit m: M[A]): A = ??? - import p._ + import p.* val v = compute val v1: String = v } diff --git a/tests/pos/i10107c.scala b/tests/pos/i10107c.scala new file mode 100644 index 000000000000..b42e62ddb7dc --- /dev/null +++ b/tests/pos/i10107c.scala @@ -0,0 +1,12 @@ +import scala.quoted._ + +inline def isTrue: Boolean = true + +inline def oneOf(): String = { + inline if isTrue then + "foo" + else + "bar" +} + +def test1 = oneOf() diff --git a/tests/pos/i10116.scala b/tests/pos/i10116.scala index f6764b8c6433..9c549b1c105c 100644 --- a/tests/pos/i10116.scala +++ b/tests/pos/i10116.scala @@ -8,7 +8,7 @@ object OverloadedWithLong { object Test { def main(args: Array[String]): Unit = - import OverloadedWithLong._ + import OverloadedWithLong.* val l: Any = 0 :: Nil val r = overloaded(l match { diff --git a/tests/pos/i10295.scala b/tests/pos/i10295.scala index 8fc237e2e853..3ec7eefca0ac 100644 --- a/tests/pos/i10295.scala +++ b/tests/pos/i10295.scala @@ -3,14 +3,14 @@ trait M: object X: def foo(): X = ??? -inline def m(using m: M): m.type = m +transparent inline def m(using m: M): m.type = m def doSomething(body: M ?=> Unit) = body(using new M{}) def Test1 = given M = new M{} - import m._ + import m.* val x: X = X.foo() println(x) @@ -30,7 +30,7 @@ def Test2 = doSomething { // not ideal val myM = m // or summon[M] - import myM._ + import myM.* val x: X = X.foo() println(x) } diff --git a/tests/pos/i10311.scala b/tests/pos/i10311.scala index bfa0c15f3493..561ec525899a 100644 --- a/tests/pos/i10311.scala +++ b/tests/pos/i10311.scala @@ -8,7 +8,7 @@ object Module { } } object test: - import Module._ + import Module.* val a = new MyInt(42, 43) val b = a.x diff --git a/tests/pos/i1045.scala b/tests/pos/i1045.scala index f0cf1df90f8a..ceeea15d7ab5 100644 --- a/tests/pos/i1045.scala +++ b/tests/pos/i1045.scala @@ -1,4 +1,4 @@ -import scala.collection._ +import scala.collection.* object EmptyHashMap extends mutable.HashMap[Nothing, Nothing] object T { diff --git a/tests/pos/i10511.scala b/tests/pos/i10511.scala index 386899d047a7..3bc69123e040 100644 --- a/tests/pos/i10511.scala +++ b/tests/pos/i10511.scala @@ -3,7 +3,7 @@ enum Bool { case False } -import Bool._ +import Bool.* type Not[B <: Bool] = B match { case True.type => False.type diff --git a/tests/pos/i10769.scala b/tests/pos/i10769.scala index 5c63d2c807d0..cc5299ee406a 100644 --- a/tests/pos/i10769.scala +++ b/tests/pos/i10769.scala @@ -1,7 +1,7 @@ package stm trait STMLike[F[_]] { - import Internals._ + import Internals.* sealed abstract class Txn[+A] {} diff --git a/tests/pos/i10769b.scala b/tests/pos/i10769b.scala index 2e097460b5bf..28b2a174c891 100644 --- a/tests/pos/i10769b.scala +++ b/tests/pos/i10769b.scala @@ -1,7 +1,7 @@ package stm trait STMLike[F[_]] { - import Internals._ + import Internals.* sealed abstract class Txn[+A] {} diff --git a/tests/pos/i10964a.scala b/tests/pos/i10964a.scala index 55ba1a47d266..98ea22f4f098 100644 --- a/tests/pos/i10964a.scala +++ b/tests/pos/i10964a.scala @@ -57,7 +57,7 @@ object Ref { class Resource[F[_], A] { - import ApplicativeSyntax._ + import ApplicativeSyntax.* implicit def asyncForResource[F[_]](implicit F0: Async[F]): Async[[X] =>> Resource[F, X]] = ??? diff --git a/tests/pos/i11128-wildcard.scala b/tests/pos/i11128-wildcard.scala index 97323e584e85..965e5b20ec8d 100644 --- a/tests/pos/i11128-wildcard.scala +++ b/tests/pos/i11128-wildcard.scala @@ -10,6 +10,6 @@ object Outer { } -import Outer._ +import Outer.* val wrapBar = new Wrap.Bar() diff --git a/tests/pos/i11184a.scala b/tests/pos/i11184a.scala new file mode 100644 index 000000000000..b4b0beca45ee --- /dev/null +++ b/tests/pos/i11184a.scala @@ -0,0 +1,5 @@ +import scala.quoted._ + +inline def isTrue: Boolean = true +inline def oneOf: String = inline if isTrue then "foo" else "bar" +def test1 = oneOf diff --git a/tests/pos/i11184b.scala b/tests/pos/i11184b.scala new file mode 100644 index 000000000000..16a12b92d15b --- /dev/null +++ b/tests/pos/i11184b.scala @@ -0,0 +1,5 @@ +import scala.quoted._ + +inline def isTrue(): Boolean = true +inline def oneOf: String = inline if isTrue() then "foo" else "bar" +def test1 = oneOf diff --git a/tests/pos/i11184c.scala b/tests/pos/i11184c.scala new file mode 100644 index 000000000000..bcd83fb056a2 --- /dev/null +++ b/tests/pos/i11184c.scala @@ -0,0 +1,6 @@ +import scala.quoted._ + +object Foo: + inline def isTrue: Boolean = true +inline def oneOf: String = inline if Foo.isTrue then "foo" else "bar" +def test1 = oneOf diff --git a/tests/pos/i11184d.scala b/tests/pos/i11184d.scala new file mode 100644 index 000000000000..3807159a9c5d --- /dev/null +++ b/tests/pos/i11184d.scala @@ -0,0 +1,5 @@ +import scala.quoted._ + +inline def isTrue: Boolean = true +transparent inline def oneOf: Any = inline if isTrue then isTrue else "bar" +def test1 = oneOf diff --git a/tests/pos/i11214.scala b/tests/pos/i11214.scala new file mode 100644 index 000000000000..154f203b7e20 --- /dev/null +++ b/tests/pos/i11214.scala @@ -0,0 +1,5 @@ +trait Pet(val name: String) +trait FeatheredPet extends Pet + +class Bird(override val name: String) extends FeatheredPet: + override def toString = s"bird name: $name" \ No newline at end of file diff --git a/tests/pos/i11250/1.scala b/tests/pos/i11250/1.scala new file mode 100644 index 000000000000..2d7eef8cb759 --- /dev/null +++ b/tests/pos/i11250/1.scala @@ -0,0 +1,29 @@ +package shapeless3.data + +import scala.compiletime._ + +trait Monoidal { + type to[_] <: Tuple + type length[m] = Monoidal.length[to[m]] +} + +object Monoidal { + import Tuple._ + + type length[m <: Tuple] = Size[m] +} + +trait UnboundedMonoidal[T0[_, _], U0] extends Monoidal { + type to[t] <: Tuple = t match { + case T0[hd, tl] => hd *: to[tl] + case U0 => EmptyTuple + } +} + +object pairs extends UnboundedMonoidal[Tuple2, Unit] + +object MonoidalTest { // Compiles fine here + type p = (Int, (String, (Boolean, Unit))) + summon[pairs.length[p] =:= 3] +} + diff --git a/tests/pos/i11250/2.scala b/tests/pos/i11250/2.scala new file mode 100644 index 000000000000..030fa62a88dc --- /dev/null +++ b/tests/pos/i11250/2.scala @@ -0,0 +1,7 @@ +package shapeless3.data + +object MonoidalTest2 { // But not here + type p = (Int, (String, (Boolean, Unit))) + summon[pairs.length[p] =:= 3] +} + diff --git a/tests/pos/i11311.scala b/tests/pos/i11311.scala index 6ab995ad6411..3fd8634675a1 100644 --- a/tests/pos/i11311.scala +++ b/tests/pos/i11311.scala @@ -1,4 +1,4 @@ -import language.`3.1` +import language.future object Test: def cat1(s1: String)(s2: String) = s1 + s2 diff --git a/tests/pos/i11353.scala b/tests/pos/i11353.scala new file mode 100644 index 000000000000..cca655cf049b --- /dev/null +++ b/tests/pos/i11353.scala @@ -0,0 +1,10 @@ +def iarr = IArray( + IArray(1, 2, 3), + IArray(4, 5, 6), + IArray(7, 8, 9) +) +def arr = Array( // same issue + IArray(1, 2, 3), + Array(4, 5, 6), + Array(7, 8, 9) +) diff --git a/tests/pos/i11358.scala b/tests/pos/i11358.scala new file mode 100644 index 000000000000..aa246a45fba4 --- /dev/null +++ b/tests/pos/i11358.scala @@ -0,0 +1,14 @@ +object Test: + + def test1: IArray[Int] = IArray(1, 2) +++ IArray(2, 3) + def test2: IArray[Int] = IArray(1, 2) +++ List(2, 3) + def test3 = +++[Int](IArray(1, 2))(IArray(2, 3)) + def test4 = +++[Int](IArray(1, 2))(List(2, 3)) + def test5: IArray[Int] = IArray(1, 2).+++[Int](IArray(2, 3)) + def test6: IArray[Int] = IArray(1, 2).+++[Int](List(2, 3)) + def test7 = +++(IArray(1, 2))[Int](IArray(2, 3)) + def test8 = +++(IArray(1, 2))[Int](List(2, 3)) + + extension [A: reflect.ClassTag](arr: IArray[A]) + def +++[B >: A: reflect.ClassTag](suffix: IArray[B]): IArray[B] = ??? + def +++[B >: A: reflect.ClassTag](suffix: IterableOnce[B]): IArray[B] = ??? diff --git a/tests/pos/i1137-2/B_2.scala b/tests/pos/i1137-2/B_2.scala index 9a3b013d38fb..dd099ac52092 100644 --- a/tests/pos/i1137-2/B_2.scala +++ b/tests/pos/i1137-2/B_2.scala @@ -1,4 +1,4 @@ object B { - import ATest._ + import ATest.* def foo: A = new A(1) } diff --git a/tests/pos/i1174.scala b/tests/pos/i1174.scala index 5875a38adf24..c9aa05521524 100644 --- a/tests/pos/i1174.scala +++ b/tests/pos/i1174.scala @@ -1,5 +1,5 @@ import scala.reflect.ClassTag -import scala.util._ +import scala.util.* object Main { class A diff --git a/tests/pos/i1202b.scala b/tests/pos/i1202b.scala index 09d06170feee..88b865e334af 100644 --- a/tests/pos/i1202b.scala +++ b/tests/pos/i1202b.scala @@ -1,7 +1,7 @@ package i1202 class Test() { - import Test._ + import Test.* val myStatus = Unknown } object Test { diff --git a/tests/pos/i1753.scala b/tests/pos/i1753.scala index e5ad743aaac8..4e8b961ca073 100644 --- a/tests/pos/i1753.scala +++ b/tests/pos/i1753.scala @@ -13,8 +13,8 @@ trait BCodeIdiomatic { } trait BCodeSkelBuilder extends BCodeIdiomatic { - import int._ - import bTypes._ + import int.* + import bTypes.* val b: BTypesFromSymbols[int.type] = bTypes val x: int.type = bTypes.int val y: bTypes.int.type = int diff --git a/tests/pos/i1777.scala b/tests/pos/i1777.scala index 381ff9139a1c..9602511b815f 100644 --- a/tests/pos/i1777.scala +++ b/tests/pos/i1777.scala @@ -1,5 +1,5 @@ object Main extends App { - import scala.collection.immutable._ + import scala.collection.immutable.* case class Foo(s: String) { implicit val orderingS: Ordering[String] = Ordering[String] // Crash diff --git a/tests/pos/i1857.scala b/tests/pos/i1857.scala index 635612104fc3..cdf22dac519c 100644 --- a/tests/pos/i1857.scala +++ b/tests/pos/i1857.scala @@ -26,7 +26,7 @@ trait FooDSL extends CommandeerDSL[Foo] { } object RunMe { - //import Foo._ + //import Foo.* def main(args: Array[String]): Unit = { println("Hi Mum") diff --git a/tests/pos/i2112.scala b/tests/pos/i2112.scala index cebce7018dac..e9f43df2100a 100644 --- a/tests/pos/i2112.scala +++ b/tests/pos/i2112.scala @@ -1,4 +1,4 @@ -import scala.collection.JavaConverters._ +import scala.collection.JavaConverters.* object Test { def test(x: Any): Unit = { diff --git a/tests/pos/i2300.scala b/tests/pos/i2300.scala index b58e4921bb8f..a36993a5866c 100644 --- a/tests/pos/i2300.scala +++ b/tests/pos/i2300.scala @@ -18,7 +18,7 @@ object hlists { } object Test { - import hlists._ + import hlists.* val merged: HCons[Int,HCons[String,HNil]] = { HCons(42, HNil) merge HCons("foo", HNil) diff --git a/tests/pos/i2324.scala b/tests/pos/i2324.scala index b150334e6958..00d93df2e709 100644 --- a/tests/pos/i2324.scala +++ b/tests/pos/i2324.scala @@ -5,8 +5,8 @@ object B { def foo: Int = 2 } class C { - import A._ - import B._ + import A.* + import B.* def bar: Int = 4 diff --git a/tests/pos/i2397.scala b/tests/pos/i2397.scala index 20ad37abd7c2..9e64f4370a01 100644 --- a/tests/pos/i2397.scala +++ b/tests/pos/i2397.scala @@ -6,7 +6,7 @@ object Test { foo((new Foo[Int]: Foo[_])) } -import java.nio.file._ +import java.nio.file.* import java.util.stream.Collectors object Foo { diff --git a/tests/pos/i2551/test_2.scala b/tests/pos/i2551/test_2.scala index 73d4931ab2e0..91ebc5c9e579 100644 --- a/tests/pos/i2551/test_2.scala +++ b/tests/pos/i2551/test_2.scala @@ -1,4 +1,4 @@ -import scala.meta._ +import scala.meta.* object Test { val v = Version() diff --git a/tests/pos/i2554.scala b/tests/pos/i2554.scala index f8a77019c3fd..488adba5906a 100644 --- a/tests/pos/i2554.scala +++ b/tests/pos/i2554.scala @@ -11,7 +11,7 @@ object foo { } } object Test { - import foo._ + import foo.* implicit val shape: Shape[_ <: FlatShapeLevel, Int, Int, _] = null def hint = Shape.tuple2Shape(shape, shape) val hint2: foo.Shape[foo.FlatShapeLevel, (Int, Int), (Int, Int), _] = hint diff --git a/tests/pos/i2663.scala b/tests/pos/i2663.scala index 5c69eb5f7b4a..9803827e5208 100644 --- a/tests/pos/i2663.scala +++ b/tests/pos/i2663.scala @@ -6,7 +6,7 @@ enum Foo[T](x: T) { case Baz[S, T](y: String) extends Foo(y) with Tr } object Test { - import Foo._ + import Foo.* val bar: Foo[Boolean] = Bar(true) val bas: Foo[Int] = Bas(1) val bam: Foo[String] & Tr = Bam("") @@ -20,7 +20,7 @@ enum Foo2[S <: T, T](x1: S, x2: T) { case Baz[S, T](y: String) extends Foo2(y, y) with Tr } object Test2 { - import Foo2._ + import Foo2.* val bar: Foo2[Boolean, Boolean] = Bar(true) val bas: Foo2[Int, Int] = Bas(1) val bam: Foo2[String, String] & Tr = Bam("") diff --git a/tests/pos/i3607.scala b/tests/pos/i3607.scala index 8428f208e7c1..ff15e74b79bd 100644 --- a/tests/pos/i3607.scala +++ b/tests/pos/i3607.scala @@ -1,6 +1,6 @@ object A { implicit val x: Int = 1 } object Test1 { - import A.{x => y} + import A.x as y implicitly[Int] } diff --git a/tests/pos/i3669.scala b/tests/pos/i3669.scala index c785c4f6800e..f7a5c1fbd68a 100644 --- a/tests/pos/i3669.scala +++ b/tests/pos/i3669.scala @@ -1,4 +1,4 @@ -import java.nio.file._ +import java.nio.file.* class Test { def test(xs: Array[String]) = { diff --git a/tests/pos/i3917.scala b/tests/pos/i3917.scala index 19fd1506d69b..ad31fa58200d 100644 --- a/tests/pos/i3917.scala +++ b/tests/pos/i3917.scala @@ -17,11 +17,11 @@ object C extends A { this.a = true C.this.a = true - import B._ + import B.* b = true val c0 = new C - import c0._ + import c0.* c = true } } diff --git a/tests/pos/i3976.scala b/tests/pos/i3976.scala index a17738903115..7520830d6441 100644 --- a/tests/pos/i3976.scala +++ b/tests/pos/i3976.scala @@ -3,7 +3,7 @@ object Test { case A extends Hoge[List] case B extends Hoge[[X] =>> String] } - import Hoge._ + import Hoge.* A == A A == (B: Hoge[_]) diff --git a/tests/pos/i4176-gadt.scala b/tests/pos/i4176-gadt.scala index 4d17b4e39c64..d61f3eb137c5 100644 --- a/tests/pos/i4176-gadt.scala +++ b/tests/pos/i4176-gadt.scala @@ -8,7 +8,7 @@ object i4176 { case class TSumZero[N]() extends TSum[TZero, N, N] case class TSumM[M <: TNat, N, R <: TNat](sum: TSum[M, N, R]) extends TSum[TSucc[M], N, TSucc[R]] } - import TNatSum._ + import TNatSum.* implicit def tSumZero[N]: TSum[TZero, N, N] = TSumZero() diff --git a/tests/pos/i4188/Test_2.scala b/tests/pos/i4188/Test_2.scala index 7ddd1be426ba..c32fb11cab11 100644 --- a/tests/pos/i4188/Test_2.scala +++ b/tests/pos/i4188/Test_2.scala @@ -1,6 +1,6 @@ package collections -import decorators._ +import decorators.* object Test { def test(map: Map[Int, String]) = { diff --git a/tests/pos/i4188/collections_1.scala b/tests/pos/i4188/collections_1.scala index b4ef92d5700a..f5e8d8e3b383 100644 --- a/tests/pos/i4188/collections_1.scala +++ b/tests/pos/i4188/collections_1.scala @@ -4,7 +4,7 @@ object collections { type AnyConstr[X] = Any } -import collections._ +import collections.* trait Iterable[+A] extends IterableOps[A, Iterable, Iterable[A]] diff --git a/tests/pos/i4449.scala b/tests/pos/i4449.scala index 29325a202cc2..43337e4204d7 100644 --- a/tests/pos/i4449.scala +++ b/tests/pos/i4449.scala @@ -1,7 +1,7 @@ class TreeAccumulator2 { def foo(reflect: Reflection2)(tree: Any): Unit = { - import reflect._ + import reflect.* tree match { case A() => case B() => diff --git a/tests/pos/i5498-postfixOps.scala b/tests/pos/i5498-postfixOps.scala index b2634649509d..f890f4d2c8f1 100644 --- a/tests/pos/i5498-postfixOps.scala +++ b/tests/pos/i5498-postfixOps.scala @@ -1,4 +1,4 @@ -import scala.concurrent.duration._ +import scala.concurrent.duration.* def test() = { // only OK since the defaultOptions in the TestConfiguration includes -language:postfixOps diff --git a/tests/pos/i5574.scala b/tests/pos/i5574.scala index 0ba236d8ec3e..1d98dd63ddf6 100644 --- a/tests/pos/i5574.scala +++ b/tests/pos/i5574.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object i5574 { class Box[F[_]] diff --git a/tests/pos/i5588a.scala b/tests/pos/i5588a.scala index 06aeb3c8d9e1..4e02285371a2 100644 --- a/tests/pos/i5588a.scala +++ b/tests/pos/i5588a.scala @@ -12,7 +12,7 @@ object TestMain { } def testExtensionProperty(): Unit = { - import fooExt._ + import fooExt.* val foo = Foo("initVal") assert(foo.fooExt == "initVal") foo.fooExt = "updatedVal" diff --git a/tests/pos/i5588b.scala b/tests/pos/i5588b.scala index 97940677f5d7..8b4d90a8a38e 100644 --- a/tests/pos/i5588b.scala +++ b/tests/pos/i5588b.scala @@ -12,7 +12,7 @@ object TestMain2 { } def testExtensionProperty(): Unit = { - //import fooExt._ + //import fooExt.* val foo = Foo("initVal") assert(foo.fooExt == "initVal") foo.fooExt = "updatedVal" diff --git a/tests/pos/i5793/B.scala b/tests/pos/i5793/B.scala index a2f0f96c6f7e..b48af30f7429 100644 --- a/tests/pos/i5793/B.scala +++ b/tests/pos/i5793/B.scala @@ -1,6 +1,6 @@ object Main{ def main(args: Array[String]): Unit = { - import exec._ + import exec.* Runner.run(Some(5)) } } diff --git a/tests/pos/i5978.scala b/tests/pos/i5978.scala index 57dda97267a9..630a0ec4ea6c 100644 --- a/tests/pos/i5978.scala +++ b/tests/pos/i5978.scala @@ -21,7 +21,7 @@ package p1 { object Testcase { def main(args: Array[String]): Unit = { - import TextParser.{given, _} + import TextParser.{given, *} val tp_v: TokenParser[Char, Position[CharSequence]] = TextParser.TP val tp_i = summon[TokenParser[Char, Position[CharSequence]]] @@ -45,7 +45,7 @@ package p2 { object Testcase { def main(args: Array[String]): Unit = { - import TextParser.{given, _} + import TextParser.{given, *} val tp_v: TokenParser[Char, Position[CharSequence]] = TextParser.TP val tp_i = summon[TokenParser[Char, Position[CharSequence]]] diff --git a/tests/pos/i6014-gadt.scala b/tests/pos/i6014-gadt.scala index 82d4ab499e04..b5262c0652b9 100644 --- a/tests/pos/i6014-gadt.scala +++ b/tests/pos/i6014-gadt.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object Test1 { type Foo[F[_]] diff --git a/tests/pos/i6015.scala b/tests/pos/i6015.scala index 337aaf8bfdea..79041785cfd3 100644 --- a/tests/pos/i6015.scala +++ b/tests/pos/i6015.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object Test { implicit val i: Int = 23 diff --git a/tests/pos/i6151/Test.scala b/tests/pos/i6151/Test.scala index d04385bb6b93..314cf5a0ea8f 100644 --- a/tests/pos/i6151/Test.scala +++ b/tests/pos/i6151/Test.scala @@ -1,3 +1,3 @@ -import Expect._ +import Expect.* @Outcome(ExpectVal) class SimpleTest diff --git a/tests/pos/i6238.scala b/tests/pos/i6238.scala index 9cd6d56d95ed..f4a56bccd888 100644 --- a/tests/pos/i6238.scala +++ b/tests/pos/i6238.scala @@ -95,27 +95,27 @@ object K2 { object Test { { - import K1._ + import K1.* implicitly[Bar[A]] } { - import K1U._ + import K1U.* implicitly[Bar[A]] } { - import K1L._ + import K1L.* implicitly[Bar[A]] } { - import K11._ + import K11.* implicitly[Bar[A]] } { - import K2._ + import K2.* implicitly[Bar[A]] } } diff --git a/tests/pos/i6507b.scala b/tests/pos/i6507b.scala index 95ef9230d8e4..447423e5c261 100644 --- a/tests/pos/i6507b.scala +++ b/tests/pos/i6507b.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object Test { transparent inline def summonValues[T]: Tuple = inline erasedValue[T] match { diff --git a/tests/pos/i6665/Bad_2.scala b/tests/pos/i6665/Bad_2.scala index d835d90af673..81e5c6945d0c 100644 --- a/tests/pos/i6665/Bad_2.scala +++ b/tests/pos/i6665/Bad_2.scala @@ -1,4 +1,4 @@ package foo -import foo._ +import foo.* object A extends Oops object B extends Oops diff --git a/tests/pos/i6693.scala b/tests/pos/i6693.scala index 7d57950f5ef8..c0cfc1aec598 100644 --- a/tests/pos/i6693.scala +++ b/tests/pos/i6693.scala @@ -1,6 +1,6 @@ package towers.computes -import quoted._ +import quoted.* sealed abstract class Computes[T] diff --git a/tests/pos/i6989/Container_1.scala b/tests/pos/i6989/Container_1.scala index 3495bfd50169..2ae33a07ceba 100644 --- a/tests/pos/i6989/Container_1.scala +++ b/tests/pos/i6989/Container_1.scala @@ -7,6 +7,6 @@ object Container { } trait Container { - import Container._ + import Container.* implicit def mkStringExtras(s: String): StringExtras = new StringExtras(s) } \ No newline at end of file diff --git a/tests/pos/i7041.scala b/tests/pos/i7041.scala index 32bafa304dfb..458814e3f622 100644 --- a/tests/pos/i7041.scala +++ b/tests/pos/i7041.scala @@ -1,4 +1,4 @@ -import scala.util.control.NonLocalReturns._ +import scala.util.control.NonLocalReturns.* extension [T, E <: Throwable](op: => T) inline def rescue (fallback: PartialFunction[E, T]) = diff --git a/tests/pos/i7159.scala b/tests/pos/i7159.scala index a06d9e0d0eb1..55b3cf56b053 100644 --- a/tests/pos/i7159.scala +++ b/tests/pos/i7159.scala @@ -9,7 +9,7 @@ class Reflect(val internal: CompilerInterface) { object App { val refl: Reflect = ??? - import refl._ + import refl.* show(??? : Tree22) } \ No newline at end of file diff --git a/tests/pos/i7467.scala b/tests/pos/i7467.scala index 6ddee908eaee..03dbeaaa0595 100644 --- a/tests/pos/i7467.scala +++ b/tests/pos/i7467.scala @@ -1,5 +1,5 @@ -import javax.swing._ -import java.awt._ +import javax.swing.* +import java.awt.* class DuplicateSymbolError_DirectSuperclass extends DefaultListCellRenderer() { override def getListCellRendererComponent(list: JList[_ <: Object], value: Object, index: Int, isSelected: Boolean, cellHasFocus: Boolean): Component = ??? diff --git a/tests/pos/i7477.scala b/tests/pos/i7477.scala index 67d802dfa277..af95b7d5c84d 100644 --- a/tests/pos/i7477.scala +++ b/tests/pos/i7477.scala @@ -7,10 +7,10 @@ class Test1 { } package X { - import scala.concurrent._ - import scala.concurrent.duration._ + import scala.concurrent.* + import scala.concurrent.duration.* - import scala.concurrent.ExecutionContext.Implicits._ + import scala.concurrent.ExecutionContext.Implicits.* class Test1 { diff --git a/tests/pos/i7711/crash2_1.scala b/tests/pos/i7711/crash2_1.scala index f7d02ecff033..f1abde733655 100644 --- a/tests/pos/i7711/crash2_1.scala +++ b/tests/pos/i7711/crash2_1.scala @@ -1,7 +1,7 @@ package listV //import reflect.Selectable.reflectiveSelectable -import scalaLibV._ +import scalaLibV.* object sci { val isEmpty = iftTrue diff --git a/tests/pos/i7711/crash2_2.scala b/tests/pos/i7711/crash2_2.scala index f41585fd7110..aeadaa82f153 100644 --- a/tests/pos/i7711/crash2_2.scala +++ b/tests/pos/i7711/crash2_2.scala @@ -1,7 +1,7 @@ package listV //import reflect.Selectable.reflectiveSelectable -import scalaLibV._ +import scalaLibV.* object sci { val isEmpty = iftTrue // 1nd try diff --git a/tests/pos/i7876.scala b/tests/pos/i7876.scala index 4179bba1ef9b..48a8704abebb 100644 --- a/tests/pos/i7876.scala +++ b/tests/pos/i7876.scala @@ -1,6 +1,6 @@ object foo object bar -import foo._, bar._ +import foo._, bar.* object eq diff --git a/tests/pos/i801.scala b/tests/pos/i801.scala index 4d8df7f03061..eb6198d9dde8 100644 --- a/tests/pos/i801.scala +++ b/tests/pos/i801.scala @@ -1,9 +1,9 @@ object T1 { - import java.util.ArrayList, java.util.stream.{Stream => JStream} + import java.util.ArrayList, java.util.stream.Stream as JStream new java.util.ArrayList[String]().stream.map(_.toInt).map(_.toString): JStream[String] } object T2 { - import java.util._, java.util.stream.{Stream => JStream} + import java.util._, java.util.stream.Stream as JStream def f: JStream[String] = new java.util.ArrayList[String](Arrays.asList("1", "2")).stream.map(_.toInt).map(_.toString) } diff --git a/tests/pos/i8344-1.scala b/tests/pos/i8344-1.scala index deb546dfa663..92b393da2497 100644 --- a/tests/pos/i8344-1.scala +++ b/tests/pos/i8344-1.scala @@ -1,4 +1,4 @@ -import scala.{Tuple => STuple} +import scala.Tuple as STuple enum Datatype[T] { case Tuple[T <: STuple](elems: STuple.Map[T, Datatype]) extends Datatype[T] diff --git a/tests/pos/i8449.scala b/tests/pos/i8449.scala index 772e3c2c47f1..e96801554e5c 100644 --- a/tests/pos/i8449.scala +++ b/tests/pos/i8449.scala @@ -1,5 +1,5 @@ -import scala.compiletime.ops.int._ +import scala.compiletime.ops.int.* object Test { type Fib[N <: Int] <: Int = N match { diff --git a/tests/pos/i884.scala b/tests/pos/i884.scala index 29e53b9be152..2369e8a86dda 100644 --- a/tests/pos/i884.scala +++ b/tests/pos/i884.scala @@ -1,4 +1,4 @@ -import scala.reflect._ +import scala.reflect.* object `package` { } diff --git a/tests/pos/i8892.scala b/tests/pos/i8892.scala index f08b12341d3b..0a7e7223fe06 100644 --- a/tests/pos/i8892.scala +++ b/tests/pos/i8892.scala @@ -6,7 +6,7 @@ class Dummy extends Reporter: object ABug { sealed trait Nat { - inline def ++ : Succ[this.type] = Succ(this) + transparent inline def ++ : Succ[this.type] = Succ(this) transparent inline def +(inline that: Nat): Nat = inline this match { diff --git a/tests/pos/i9052/A.scala b/tests/pos/i9052/A.scala index 1ff6fa0df82e..8c6f6a68aae6 100644 --- a/tests/pos/i9052/A.scala +++ b/tests/pos/i9052/A.scala @@ -1,6 +1,6 @@ object impl: case object UNone -import impl._ +import impl.* opaque type UOption[+A] = (A | UNone.type) // error: Cyclic Reference involving UOption diff --git a/tests/pos/i9228.scala b/tests/pos/i9228.scala index a875e79c8b17..6e447dc3be47 100644 --- a/tests/pos/i9228.scala +++ b/tests/pos/i9228.scala @@ -7,7 +7,7 @@ object ABug { def gtoll(using g: Graph): List[List[g.Node]] = ??? object graph extends Graph - import graph._ + import graph.* given graph.type = graph val osq: List[List[Node]] = gtoll diff --git a/tests/pos/i9266.scala b/tests/pos/i9266.scala index 8c8d26ccbe03..9846b150aff1 100644 --- a/tests/pos/i9266.scala +++ b/tests/pos/i9266.scala @@ -1,3 +1,3 @@ -import language.`3.1-migration` +import language.`future-migration` def test = { implicit x: Int => x + x } \ No newline at end of file diff --git a/tests/pos/i9780.scala b/tests/pos/i9780.scala index f7670e05b845..0cdac95b00e1 100644 --- a/tests/pos/i9780.scala +++ b/tests/pos/i9780.scala @@ -1,5 +1,5 @@ import java.awt.event.WindowEvent -import java.awt.{Window => AWTWindow} +import java.awt.Window as AWTWindow abstract class Window { def peer: AWTWindow with InterfaceMixin diff --git a/tests/pos/i9992.scala b/tests/pos/i9992.scala index 1a7a9e519645..16b03ba13924 100644 --- a/tests/pos/i9992.scala +++ b/tests/pos/i9992.scala @@ -1,4 +1,4 @@ - import scala.concurrent._ + import scala.concurrent.* @main def test(): Unit = def test = () diff --git a/tests/pos/imp2-pos.scala b/tests/pos/imp2-pos.scala index 5460c600151d..214ff79a6e39 100644 --- a/tests/pos/imp2-pos.scala +++ b/tests/pos/imp2-pos.scala @@ -1,5 +1,5 @@ object Test { - import collection.mutable._ - import collection.mutable._ + import collection.mutable.* + import collection.mutable.* val x = new HashMap } diff --git a/tests/pos/implicit-infix-ops.scala b/tests/pos/implicit-infix-ops.scala index 9182893539be..2c53ae99dae9 100644 --- a/tests/pos/implicit-infix-ops.scala +++ b/tests/pos/implicit-infix-ops.scala @@ -1,22 +1,22 @@ object Test { - import Ordering.Implicits._ - import Numeric.Implicits._ + import Ordering.Implicits.* + import Numeric.Implicits.* def f1[T: Numeric](x: T, y: T, z: T) = x + y + z def f2[T: Ordering](x: T, y: T, z: T) = if (x < y) (z > y) else (x < z) } object Int { - import Ordering.Implicits._ - import math.Integral.Implicits._ + import Ordering.Implicits.* + import math.Integral.Implicits.* def f1[T: Integral](x: T, y: T, z: T) = (x + y + z) / z def f2[T: Ordering](x: T, y: T, z: T) = if (x < y) (z > y) else (x < z) } object Frac { - import Ordering.Implicits._ - import math.Fractional.Implicits._ + import Ordering.Implicits.* + import math.Fractional.Implicits.* def f1[T: Fractional](x: T, y: T, z: T) = (x + y + z) / z def f2[T: Ordering](x: T, y: T, z: T) = if (x < y) (z > y) else (x < z) diff --git a/tests/pos/implicit-match-and-inline-match.scala b/tests/pos/implicit-match-and-inline-match.scala index a985b788ccec..565082c71264 100644 --- a/tests/pos/implicit-match-and-inline-match.scala +++ b/tests/pos/implicit-match-and-inline-match.scala @@ -1,5 +1,5 @@ object `implicit-match-and-inline-match` { - import scala.compiletime._ + import scala.compiletime.* case class Box[T](value: T) implicit val ibox: Box[Int] = Box(0) diff --git a/tests/pos/import-rewrite/rewrite.scala b/tests/pos/import-rewrite/rewrite.scala index 0bda02c5e632..085853229720 100644 --- a/tests/pos/import-rewrite/rewrite.scala +++ b/tests/pos/import-rewrite/rewrite.scala @@ -1,5 +1,5 @@ package file -import java.io.{File => JFile, _}, StreamTokenizer.{TT_EOF => eof} +import java.io.{File as JFile, *}, StreamTokenizer.TT_EOF as eof object Main { Seq("").map(File.apply) diff --git a/tests/pos/inline-match-gadt-nested.scala b/tests/pos/inline-match-gadt-nested.scala index 1f8cc2b8233e..aac8017e763a 100644 --- a/tests/pos/inline-match-gadt-nested.scala +++ b/tests/pos/inline-match-gadt-nested.scala @@ -1,11 +1,11 @@ object `inline-match-gadt-nested` { - import scala.compiletime._ + import scala.compiletime.* enum Gadt[A, B] { case Nested(gadt: Gadt[A, Int]) extends Gadt[A, Int] case Simple extends Gadt[String, Int] } - import Gadt._ + import Gadt.* inline def foo[A, B](g: Gadt[A, B]): (A, B) = inline g match { diff --git a/tests/pos/inline-match-separate/inline-match-separate_2.scala b/tests/pos/inline-match-separate/inline-match-separate_2.scala index b2d43fceb3b1..1caf13578f31 100644 --- a/tests/pos/inline-match-separate/inline-match-separate_2.scala +++ b/tests/pos/inline-match-separate/inline-match-separate_2.scala @@ -1,4 +1,4 @@ -import Utils._ +import Utils.* object Test { val a = foo(new Box["a"]) diff --git a/tests/pos/inline-separate/A_1.scala b/tests/pos/inline-separate/A_1.scala index 72783578df80..e5055f1761e4 100644 --- a/tests/pos/inline-separate/A_1.scala +++ b/tests/pos/inline-separate/A_1.scala @@ -1,5 +1,5 @@ object A { - inline def summon[T] = compiletime.summonFrom { + transparent inline def summon[T] = compiletime.summonFrom { case t: T => t } } diff --git a/tests/pos/inline-separate/Test_2.scala b/tests/pos/inline-separate/Test_2.scala index 2a7c012b3771..779a832542be 100644 --- a/tests/pos/inline-separate/Test_2.scala +++ b/tests/pos/inline-separate/Test_2.scala @@ -1,7 +1,7 @@ -import A._ +import A.* object Test extends App { class Foo(f: => Foo) - inline implicit def foo(implicit f: => Foo): Foo = new Foo(summon[Foo]) + transparent inline implicit def foo(implicit f: => Foo): Foo = new Foo(summon[Foo]) def summonFoo(implicit ev: Foo): Foo = ev summonFoo } diff --git a/tests/pos/inline-val-constValue-1.scala b/tests/pos/inline-val-constValue-1.scala index efd482cd5c09..1cb13c1e4f0f 100644 --- a/tests/pos/inline-val-constValue-1.scala +++ b/tests/pos/inline-val-constValue-1.scala @@ -1,4 +1,4 @@ -import compiletime._ +import compiletime.* class C: type X <: Tuple diff --git a/tests/pos/inline-val-constValue-2.scala b/tests/pos/inline-val-constValue-2.scala index 33ae23069fa2..d17e75717a9c 100644 --- a/tests/pos/inline-val-constValue-2.scala +++ b/tests/pos/inline-val-constValue-2.scala @@ -1,4 +1,4 @@ -import compiletime._ +import compiletime.* class C: type N <: Int diff --git a/tests/pos/javaConversions-2.10-ambiguity.scala b/tests/pos/javaConversions-2.10-ambiguity.scala index e92185bb4fb8..b5aea14e1578 100644 --- a/tests/pos/javaConversions-2.10-ambiguity.scala +++ b/tests/pos/javaConversions-2.10-ambiguity.scala @@ -1,6 +1,6 @@ import collection.{mutable, concurrent} -import collection.JavaConverters._ -import java.util.concurrent.{ConcurrentHashMap => CHM} +import collection.JavaConverters.* +import java.util.concurrent.ConcurrentHashMap as CHM object Bar { def assertType[T](t: T) = t diff --git a/tests/pos/mirror-implicit-scope.scala b/tests/pos/mirror-implicit-scope.scala index 392675688b77..a63b7cd1db83 100644 --- a/tests/pos/mirror-implicit-scope.scala +++ b/tests/pos/mirror-implicit-scope.scala @@ -1,4 +1,4 @@ -import scala.deriving._ +import scala.deriving.* object Test { object K0 { diff --git a/tests/pos/opaque-xm.scala b/tests/pos/opaque-xm.scala index fac02902d13d..9431bd59f8ed 100644 --- a/tests/pos/opaque-xm.scala +++ b/tests/pos/opaque-xm.scala @@ -1,4 +1,4 @@ -import Predef.{any2stringadd => _, _} +import Predef.{any2stringadd as _, *} object opaquetypes { opaque type Logarithm = Double @@ -22,7 +22,7 @@ object opaquetypes { } } object usesites { - import opaquetypes._ + import opaquetypes.* val l = Logarithm(1.0) val l2 = Logarithm(2.0) val l3 = l * l2 diff --git a/tests/pos/opaque.scala b/tests/pos/opaque.scala index 7eda1f527585..a691ad4b3d54 100644 --- a/tests/pos/opaque.scala +++ b/tests/pos/opaque.scala @@ -1,4 +1,4 @@ -import Predef.{any2stringadd => _, _} +import Predef.{any2stringadd as _, *} object opaquetypes { opaque type Logarithm = Double @@ -27,7 +27,7 @@ object opaquetypes { val LL: Logarithm = Logarithm(1) } object usesites { - import opaquetypes._ + import opaquetypes.* val l = Logarithm(1.0) val l2 = Logarithm(2.0) val l3 = l * l2 diff --git a/tests/pos/pat_iuli.scala b/tests/pos/pat_iuli.scala index 46356ff58812..49f0f456d9a2 100644 --- a/tests/pos/pat_iuli.scala +++ b/tests/pos/pat_iuli.scala @@ -7,7 +7,7 @@ trait Ops { self: MyCodes => } trait Blox { self: MyCodes => - import opcodes._ + import opcodes.* class Basick { var foo: Instru = null diff --git a/tests/pos/patmat.scala b/tests/pos/patmat.scala index f34c5d98336d..035464437671 100644 --- a/tests/pos/patmat.scala +++ b/tests/pos/patmat.scala @@ -38,7 +38,7 @@ object Test { case Some[T](value: T) extends Option[T] case None } - import Option._ + import Option.* val x: Option[String] = Some("abc") diff --git a/tests/pos/pos_valueclasses/paramlists.scala b/tests/pos/pos_valueclasses/paramlists.scala index b9252726fc55..8e4eb53aa6d7 100644 --- a/tests/pos/pos_valueclasses/paramlists.scala +++ b/tests/pos/pos_valueclasses/paramlists.scala @@ -23,7 +23,7 @@ object Test { m1.two2(11)(12) { - import m1._ + import m1.* zero zero2 diff --git a/tests/pos/range.scala b/tests/pos/range.scala index a33f7fcee19c..266dbf8602fe 100644 --- a/tests/pos/range.scala +++ b/tests/pos/range.scala @@ -1,4 +1,4 @@ -import scala.math._ +import scala.math.* import collection.immutable.NumericRange object Test { val r1: scala.collection.immutable.Range.Partial[_, _] = ??? diff --git a/tests/pos/reference/delegates.scala b/tests/pos/reference/delegates.scala index 88002d939330..2a1594192761 100644 --- a/tests/pos/reference/delegates.scala +++ b/tests/pos/reference/delegates.scala @@ -234,7 +234,7 @@ object Completions: given fromString : Conversion[String, CompletionArg] = Error(_) given fromFuture : Conversion[Future[HttpResponse], CompletionArg] = Response(_) given fromStatusCode: Conversion[Future[StatusCode], CompletionArg] = Status(_) - import CompletionArg._ + import CompletionArg.* def complete[T](arg: CompletionArg) = arg match case Error(s) => ??? diff --git a/tests/pos/reference/extension-methods.scala b/tests/pos/reference/extension-methods.scala index cf075b7f3cda..3dacf787a436 100644 --- a/tests/pos/reference/extension-methods.scala +++ b/tests/pos/reference/extension-methods.scala @@ -115,7 +115,7 @@ object ExtMethods: require(exponent > 0) if exponent == 0 then 1 else x * (x ** (exponent - 1)) - import DoubleOps.{**} + import DoubleOps.** assert(2.0 ** 3 == **(2.0)(3)) end ExtMethods \ No newline at end of file diff --git a/tests/pos/reference/inlines.scala b/tests/pos/reference/inlines.scala index 48fcf5b6e2b6..a1eb215b4d22 100644 --- a/tests/pos/reference/inlines.scala +++ b/tests/pos/reference/inlines.scala @@ -30,7 +30,7 @@ object Logger { } object Test{ - import Logger._ + import Logger.* var indentSetting = 2 diff --git a/tests/pos/reference/opaque.scala b/tests/pos/reference/opaque.scala index 47b3a273cb1f..4dd91dc06fe4 100644 --- a/tests/pos/reference/opaque.scala +++ b/tests/pos/reference/opaque.scala @@ -19,8 +19,8 @@ object Logarithms { } object LogTest { - import Logarithms._ - import Predef.{any2stringadd => _, _} + import Logarithms.* + import Predef.{any2stringadd as _, *} val l = Logarithm(1.0) val l2 = Logarithm(2.0) @@ -52,7 +52,7 @@ object Access { } object User { - import Access._ + import Access.* case class Item(rights: Permissions) diff --git a/tests/pos/reference/union-types.scala b/tests/pos/reference/union-types.scala index f9e7612e0570..4562a2462e4c 100644 --- a/tests/pos/reference/union-types.scala +++ b/tests/pos/reference/union-types.scala @@ -20,7 +20,7 @@ object t1 { } object t2 { - import t1._ + import t1.* trait Admin trait UserData diff --git a/tests/pos/renaming-imports.scala b/tests/pos/renaming-imports.scala new file mode 100644 index 000000000000..9419be1e9ff4 --- /dev/null +++ b/tests/pos/renaming-imports.scala @@ -0,0 +1,27 @@ +import java as j +import collection as c + +val x: j.io.IOException = ??? + +import c.mutable as mut +import mut.ArrayBuffer as Buf + +val y = Buf(1, 2, 3) + +object O: + type OString = String + def foo22(x: Int) = x + +class C: + import O.* + import foo22 as foo + import OString as OS + import scala.collection.Iterable + println(foo(22)) + val s: OS = "" + +def test = + import C as CC + println(C().s) + + diff --git a/tests/pos/sammy_poly.scala b/tests/pos/sammy_poly.scala index 3291493c52da..593f97638315 100644 --- a/tests/pos/sammy_poly.scala +++ b/tests/pos/sammy_poly.scala @@ -2,7 +2,7 @@ trait F1[T, U] { def apply(x: T): U } class T { - import T._ + import T.* // NOTE: the f(x) desugaring for now assumes the single abstract method is called 'apply' def app1[T, U](x: T)(f: F1[T, U]): U = f(x) def app2[T, U](x: T)(f: F2[T, U]): U = f(x) diff --git a/tests/pos/scala-days-2019-slides/metaprogramming-1-forset.scala b/tests/pos/scala-days-2019-slides/metaprogramming-1-forset.scala index 830e6bf3df9d..ab27285cc141 100644 --- a/tests/pos/scala-days-2019-slides/metaprogramming-1-forset.scala +++ b/tests/pos/scala-days-2019-slides/metaprogramming-1-forset.scala @@ -1,6 +1,6 @@ object ForSetExample { - import scala.collection.immutable._ + import scala.collection.immutable.* import scala.compiletime.summonFrom inline def setFor[T]: Set[T] = diff --git a/tests/pos/scala-days-2019-slides/metaprogramming-2-tuple.scala b/tests/pos/scala-days-2019-slides/metaprogramming-2-tuple.scala index cebfd1cf1d91..b20625cd12c9 100644 --- a/tests/pos/scala-days-2019-slides/metaprogramming-2-tuple.scala +++ b/tests/pos/scala-days-2019-slides/metaprogramming-2-tuple.scala @@ -1,5 +1,5 @@ object TupleExample { - import Tuple._ + import Tuple.* type A type B diff --git a/tests/pos/seq-ordering.scala b/tests/pos/seq-ordering.scala index 517d8ae8aafe..46cfcfb7311c 100644 --- a/tests/pos/seq-ordering.scala +++ b/tests/pos/seq-ordering.scala @@ -1,7 +1,7 @@ -import Ordering.Implicits._ +import Ordering.Implicits.* class A { - import Predef.{ implicitly => ? } + import Predef.implicitly as ? ?[Ordering[List[Int]]] ?[Ordering[IndexedSeq[(Int, String)]]] diff --git a/tests/pos/singleton-ops-composition.scala b/tests/pos/singleton-ops-composition.scala index 7cc2b93806fb..ed008726df21 100644 --- a/tests/pos/singleton-ops-composition.scala +++ b/tests/pos/singleton-ops-composition.scala @@ -1,5 +1,5 @@ -import scala.compiletime.ops.boolean._ -import scala.compiletime.ops.int.{^ => ^^,_} // must rename int.^ or get clash with boolean.^ +import scala.compiletime.ops.boolean.* +import scala.compiletime.ops.int.{^ as ^^,_} // must rename int.^ or get clash with boolean.^ object Test { val t0: 1 + 2 * 3 = 7 diff --git a/tests/pos/singleton-ops-dispatch.scala b/tests/pos/singleton-ops-dispatch.scala index 71278a375cc6..4a1c56515577 100644 --- a/tests/pos/singleton-ops-dispatch.scala +++ b/tests/pos/singleton-ops-dispatch.scala @@ -1,4 +1,4 @@ -import scala.compiletime.ops._ +import scala.compiletime.ops.* object Test { infix type +[X <: Int | String, Y <: Int | String] = (X, Y) match { diff --git a/tests/pos/singleton-ops-test-issue-8280.scala b/tests/pos/singleton-ops-test-issue-8280.scala index fd5a0ef54717..e57a07877cb5 100644 --- a/tests/pos/singleton-ops-test-issue-8280.scala +++ b/tests/pos/singleton-ops-test-issue-8280.scala @@ -1,4 +1,4 @@ -import scala.compiletime.ops.int._ +import scala.compiletime.ops.int.* import scala.compiletime.S class Foo[T <: Int] { diff --git a/tests/pos/singleton-ops-test-issue-8287.scala b/tests/pos/singleton-ops-test-issue-8287.scala index bc4595bf79a1..194ba860460d 100644 --- a/tests/pos/singleton-ops-test-issue-8287.scala +++ b/tests/pos/singleton-ops-test-issue-8287.scala @@ -1,4 +1,4 @@ -import scala.compiletime.ops.int._ +import scala.compiletime.ops.int.* object Test { class Vec[S <: Int] { diff --git a/tests/pos/spec-groups.scala b/tests/pos/spec-groups.scala index 9b6359a98256..02d240a539c0 100644 --- a/tests/pos/spec-groups.scala +++ b/tests/pos/spec-groups.scala @@ -1,4 +1,4 @@ -import Specializable._ +import Specializable.* class A[@specialized(Primitives) T](x: T) { def f1[@specialized(Primitives) U](x: T, y: U) = ((x, y)) diff --git a/tests/pos/spurious-overload.scala b/tests/pos/spurious-overload.scala index aae4c96329a2..ee3790b8c7dc 100644 --- a/tests/pos/spurious-overload.scala +++ b/tests/pos/spurious-overload.scala @@ -24,7 +24,7 @@ object Test extends App { } } - import lazyLib._ + import lazyLib.* val s: Susp[Int] = delay { println("evaluating..."); 3 } println("2 + s = " + (2 + s)) // implicit call to force() diff --git a/tests/pos/summonInline.scala b/tests/pos/summonInline.scala new file mode 100644 index 000000000000..e007fd214981 --- /dev/null +++ b/tests/pos/summonInline.scala @@ -0,0 +1,10 @@ +import scala.compiletime.summonInline + +type A +given A = ??? + +inline def summon1: A = summonInline[A] +transparent inline def summon2: A = summonInline[A] + +def test1 = summon1 +def test2 = summon2 diff --git a/tests/pos/switch-small.scala b/tests/pos/switch-small.scala index 9de9ca028e46..f4705f9846b7 100644 --- a/tests/pos/switch-small.scala +++ b/tests/pos/switch-small.scala @@ -1,4 +1,4 @@ -import annotation._ +import annotation.* object Test { def f(x: Int) = (x: @switch) match { diff --git a/tests/pos/t0774/unrelated.scala b/tests/pos/t0774/unrelated.scala index 1efdb2505eac..7c1f5f79ff39 100644 --- a/tests/pos/t0774/unrelated.scala +++ b/tests/pos/t0774/unrelated.scala @@ -1,5 +1,5 @@ object Outer { - import Inner._ + import Inner.* deathname diff --git a/tests/pos/t11593/Test.scala b/tests/pos/t11593/Test.scala index 9ef8533b2942..6ad153bc1e14 100644 --- a/tests/pos/t11593/Test.scala +++ b/tests/pos/t11593/Test.scala @@ -1,5 +1,5 @@ package foo { - import java.util._ + import java.util.* object X { def bar(x: Properties): Unit = println(x.getClass.getName) bar(new Properties) diff --git a/tests/pos/t1500a.scala b/tests/pos/t1500a.scala index adf46329aaa2..de9db552938a 100644 --- a/tests/pos/t1500a.scala +++ b/tests/pos/t1500a.scala @@ -17,7 +17,7 @@ object Steps { } object StepsTest { - import Steps._ + import Steps.* implicitly[Step0] implicitly[Step1] diff --git a/tests/pos/t1987b/b.scala b/tests/pos/t1987b/b.scala index a469ca6ea87a..c2f1e1d97b4a 100644 --- a/tests/pos/t1987b/b.scala +++ b/tests/pos/t1987b/b.scala @@ -2,7 +2,7 @@ package bug.packageb // Note that the overloading works if instead of being in the package we import it: -// replace the above line with import bug.packageb._ +// replace the above line with import bug.packageb.* class Client { val x = func(1) // doesn't compile: type mismatch; found: Int(1) required: String diff --git a/tests/pos/t2133.scala b/tests/pos/t2133.scala index 02ef43c21907..529ac31f2699 100644 --- a/tests/pos/t2133.scala +++ b/tests/pos/t2133.scala @@ -11,8 +11,8 @@ trait Foo2 { } class Bob extends AnyRef with Foo with Foo2 { - import bip._ - import bar._ + import bip.* + import bar.* def go() = fn() } diff --git a/tests/pos/t2310.scala b/tests/pos/t2310.scala index 68912b496194..a1c3613735d0 100644 --- a/tests/pos/t2310.scala +++ b/tests/pos/t2310.scala @@ -1,4 +1,4 @@ -import scala.Stream._ +import scala.Stream.* object consistencyError { /* this gives an error: diff --git a/tests/pos/t2405.scala b/tests/pos/t2405.scala index cf06ed15dbe6..a993a852d9de 100644 --- a/tests/pos/t2405.scala +++ b/tests/pos/t2405.scala @@ -2,13 +2,13 @@ object A { implicit val x: Int = 1 } // Problem as stated in the ticket. object Test1 { - import A.{x => y} + import A.x as y implicitly[Int] } // Testing for the absence of shadowing #1. object Test2 { - import A.{x => y} + import A.x as y val x = 2 implicitly[Int] } @@ -16,7 +16,7 @@ object Test2 { // Testing for the absence of shadowing #2. object Test3 { { - import A.{x => y} + import A.x as y def x: Int = 0 implicitly[Int] } diff --git a/tests/pos/t2435.scala b/tests/pos/t2435.scala index f913b3bcae21..090294a5ac9b 100644 --- a/tests/pos/t2435.scala +++ b/tests/pos/t2435.scala @@ -17,7 +17,7 @@ object Bug { } object Test { - import Bug._ + import Bug.* println("Compiles:") val a1 = FNil.chain("a").chain("a") val a2 = a1.chain("a") diff --git a/tests/pos/t2500.scala b/tests/pos/t2500.scala index 4b02fe488c8d..e54a9e8bd3a7 100644 --- a/tests/pos/t2500.scala +++ b/tests/pos/t2500.scala @@ -1,5 +1,5 @@ object Test { - import scala.collection._ + import scala.collection.* ((Map(1 -> "a", 2 -> "b"): collection.Map[Int, String]) map identity[(Int, String)]) : scala.collection.Map[Int,String] ((SortedMap(1 -> "a", 2 -> "b"): collection.SortedMap[Int, String]) map identity[(Int, String)]): scala.collection.SortedMap[Int,String] ((SortedSet(1, 2): collection.SortedSet[Int]) map identity[Int]): scala.collection.SortedSet[Int] diff --git a/tests/pos/t2503.scala b/tests/pos/t2503.scala index 8dda45b2b760..fbe466368d88 100755 --- a/tests/pos/t2503.scala +++ b/tests/pos/t2503.scala @@ -1,4 +1,4 @@ -import scala.collection.mutable._ +import scala.collection.mutable.* trait SB[A] extends Buffer[A] { abstract override def insertAll(n: Int, iter: IterableOnce[A]): Unit = synchronized { diff --git a/tests/pos/t2698.scala b/tests/pos/t2698.scala index 497b4f21e68b..24b8bffc72d0 100644 --- a/tests/pos/t2698.scala +++ b/tests/pos/t2698.scala @@ -3,7 +3,7 @@ class WordExp { type _labelT <: Label } -import scala.collection._ +import scala.collection.* abstract class S2 { val lang: WordExp diff --git a/tests/pos/t2712-5.scala b/tests/pos/t2712-5.scala index ed96d4c06fcc..d80755d2a450 100644 --- a/tests/pos/t2712-5.scala +++ b/tests/pos/t2712-5.scala @@ -23,7 +23,7 @@ object Test { val f: Int => String = _.toString - import FunctorSyntax._ + import FunctorSyntax.* f.map((s: String) => s.reverse) } diff --git a/tests/pos/t2712-7.scala b/tests/pos/t2712-7.scala index d9c5243f132d..2d5edda438f5 100644 --- a/tests/pos/t2712-7.scala +++ b/tests/pos/t2712-7.scala @@ -8,7 +8,7 @@ object Xor { } object TestXor { - import Xor._ + import Xor.* def meh[F[_], A, B](fa: F[A])(f: A => B): F[B] = ??? meh(new Right(23): Xor[Boolean, Int])(_ < 13) meh(new Left(true): Xor[Boolean, Int])(_ < 13) diff --git a/tests/pos/t2741/2741_2.scala b/tests/pos/t2741/2741_2.scala index a9fd9d7d0ee1..a8097f8093b8 100644 --- a/tests/pos/t2741/2741_2.scala +++ b/tests/pos/t2741/2741_2.scala @@ -1,5 +1,5 @@ // object Test compiles jointly, but not separately. object Test { - import Scalaz._ + import Scalaz.* Scalaz.a } diff --git a/tests/pos/t2809.scala b/tests/pos/t2809.scala index 1e9ec60d2e86..a093c3a25f1f 100644 --- a/tests/pos/t2809.scala +++ b/tests/pos/t2809.scala @@ -4,7 +4,7 @@ package p1 { } } package p2 { // all being in the same package compiles fine - import p1._ + import p1.* abstract class T2 extends T1 { class A { bug() diff --git a/tests/pos/t3160.scala b/tests/pos/t3160.scala index cc007dc0148f..bd6c8651d942 100644 --- a/tests/pos/t3160.scala +++ b/tests/pos/t3160.scala @@ -1,4 +1,4 @@ -import scala.collection.mutable._ +import scala.collection.mutable.* class Node class A { diff --git a/tests/pos/t3177.scala b/tests/pos/t3177.scala index 12dfce6eea03..791329ba93b1 100644 --- a/tests/pos/t3177.scala +++ b/tests/pos/t3177.scala @@ -3,7 +3,7 @@ trait InvariantFunctor[F[_]] { } object InvariantFunctor { - import Endo._ + import Endo.* implicit val EndoInvariantFunctor: InvariantFunctor[Endo] = new InvariantFunctor[Endo] { def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b))) diff --git a/tests/pos/t3384.scala b/tests/pos/t3384.scala index 4d4a81d69d54..ec8dfb6eddcc 100644 --- a/tests/pos/t3384.scala +++ b/tests/pos/t3384.scala @@ -8,7 +8,7 @@ package object po { type A = p.A } -import po._ +import po.* class C { val a = new A() //p.A.init$default$1) } diff --git a/tests/pos/t3836.scala b/tests/pos/t3836.scala index 840f171164f9..d2d394e5ee70 100644 --- a/tests/pos/t3836.scala +++ b/tests/pos/t3836.scala @@ -5,8 +5,8 @@ package object bar { } package baz { - import java.io._ - import foo.bar._ + import java.io.* + import foo.bar.* object Test { def f = new IOException diff --git a/tests/pos/t4112.scala b/tests/pos/t4112.scala index ab0f36fdc4ab..5a8c8e19a7ca 100644 --- a/tests/pos/t4112.scala +++ b/tests/pos/t4112.scala @@ -1,6 +1,6 @@ -import collection.immutable._ +import collection.immutable.* diff --git a/tests/pos/t4524.scala b/tests/pos/t4524.scala index 4721a7d06773..ae5f05536eca 100644 --- a/tests/pos/t4524.scala +++ b/tests/pos/t4524.scala @@ -1,5 +1,5 @@ object test { - import A._ + import A.* class A(b: B = new A.B()) object A { class B diff --git a/tests/pos/t4760.scala b/tests/pos/t4760.scala index 039f08368070..374b8756eb36 100644 --- a/tests/pos/t4760.scala +++ b/tests/pos/t4760.scala @@ -9,10 +9,10 @@ class Test { // ^ // one error found def f2 = { - import scala._ + import scala.* } def f2b = { - import scala.collection.mutable.{ Map => MMap } + import scala.collection.mutable.Map as MMap } def f(): Unit = { locally { @@ -22,14 +22,14 @@ class Test { // parses def f3 = { - import scala._ + import scala.* 5 } locally { (x: Int) => - import scala.util._ + import scala.util.* } 1 match { - case 1 => import scala.concurrent._ + case 1 => import scala.concurrent.* } } diff --git a/tests/pos/t4911.scala b/tests/pos/t4911.scala index cfb3792ae49e..123d12285219 100644 --- a/tests/pos/t4911.scala +++ b/tests/pos/t4911.scala @@ -1,4 +1,4 @@ -import language._ +import language.* object Test { class Foo[T](val x: T) ; object Foo { def unapply[T](x: Foo[T]) = Some(x.x) } diff --git a/tests/pos/t4938.scala b/tests/pos/t4938.scala index 6e413128512a..e6f55bee411e 100644 --- a/tests/pos/t4938.scala +++ b/tests/pos/t4938.scala @@ -1,4 +1,4 @@ class A { - import scala.collection.mutable._ + import scala.collection.mutable.* val xs = List(Set(), Seq()) } diff --git a/tests/pos/t5070.scala b/tests/pos/t5070.scala index f55ee30f8b5c..b3dd44d177a6 100644 --- a/tests/pos/t5070.scala +++ b/tests/pos/t5070.scala @@ -7,7 +7,7 @@ object O { } class Test { - import O._ + import O.* implicit val a: A = new A {} implicitly[a.T] // works @@ -28,7 +28,7 @@ class ImplicitVsTypeAliasTezt { } def useMonad[m[_], a](m: m[a])(implicit i: Monad[m]) = { - import i._ + import i.* // value map is not a member of type parameter m[a] for { diff --git a/tests/pos/t522.scala b/tests/pos/t522.scala index 5798b7ee398b..e60627f8096f 100644 --- a/tests/pos/t522.scala +++ b/tests/pos/t522.scala @@ -6,7 +6,7 @@ object Util { def foo(s: String) = new foo(s) {} } -import imptwice.Util._ +import imptwice.Util.* object User { diff --git a/tests/pos/t5313.scala b/tests/pos/t5313.scala index 605e868793b5..94cee256a8dd 100644 --- a/tests/pos/t5313.scala +++ b/tests/pos/t5313.scala @@ -16,12 +16,12 @@ object DepBug { } def useDep(d : Dep): Unit = { - import d._ + import d.* a.m(b) // OK } { - import dep._ + import dep.* a.m(b) // OK with 2.9.1.final, error on trunk } diff --git a/tests/pos/t5577.scala b/tests/pos/t5577.scala index d2b2a7dcc32d..110822ea4969 100644 --- a/tests/pos/t5577.scala +++ b/tests/pos/t5577.scala @@ -1,7 +1,7 @@ -import collection._ +import collection.* diff --git a/tests/pos/t5639/Bar.scala b/tests/pos/t5639/Bar.scala index f577500acd04..7aba598f95f3 100644 --- a/tests/pos/t5639/Bar.scala +++ b/tests/pos/t5639/Bar.scala @@ -1,6 +1,6 @@ package pack.age -import pack.age.Implicits._ +import pack.age.Implicits.* object Quux { def baz : Baz = 1 diff --git a/tests/pos/t5829.scala b/tests/pos/t5829.scala index 84b450ab31f7..959868730fc6 100644 --- a/tests/pos/t5829.scala +++ b/tests/pos/t5829.scala @@ -11,7 +11,7 @@ trait Universe { object Test extends App { val universe: Universe = null - import universe._ + import universe.* def select: Select = ??? def ident: Ident = ??? List(select, ident) diff --git a/tests/pos/t5862.scala b/tests/pos/t5862.scala index e3006ddc3f7a..3d3090cba11c 100644 --- a/tests/pos/t5862.scala +++ b/tests/pos/t5862.scala @@ -23,7 +23,7 @@ trait WireFormat[A] class MapReduceJob { trait DataSource - import scala.collection.mutable.{ Set => MSet, Map => MMap } + import scala.collection.mutable.{ Set as MSet, Map as MMap } private val mappers: MMap[DataSource, MSet[TaggedMapper[_, _, _]]] = MMap.empty def addTaggedMapper[A, K, V](input: DataSource, m: TaggedMapper[A, K, V]): Unit = { diff --git a/tests/pos/t6117.scala b/tests/pos/t6117.scala index 6aca84f72c42..5193d5178c70 100644 --- a/tests/pos/t6117.scala +++ b/tests/pos/t6117.scala @@ -6,13 +6,13 @@ trait ImportMe { } class Test(val importMe: ImportMe) { - import importMe._ - import importMe._ + import importMe.* + import importMe.* // A.scala:12: error: reference to foo is ambiguous; // it is imported twice in the same scope by - // import importMe._ - // and import importMe._ + // import importMe.* + // and import importMe.* // println(foo(1)) // ^ println(foo(1)) diff --git a/tests/pos/t6146.scala b/tests/pos/t6146.scala index b5bde826b1c1..e2d1070110ec 100644 --- a/tests/pos/t6146.scala +++ b/tests/pos/t6146.scala @@ -15,7 +15,7 @@ trait AxisCompanion { } object Axis extends AxisCompanion class Axis { - import Axis._ + import Axis.* def test( f: Format ) = f match { case Format.Integer => "Int" // case Format.Time( hours, millis ) => "Time" @@ -47,7 +47,7 @@ object O1 extends T1[Any] { case object Shorty extends O1.O2.Format class Test1 { - import O1.O2._ + import O1.O2.* val FI: Format.Integer.type = Format.Integer def test( f: Format ) = { val ff: f.type = f diff --git a/tests/pos/t6225.scala b/tests/pos/t6225.scala index d3d30d9e16ef..ddf7f0214efa 100644 --- a/tests/pos/t6225.scala +++ b/tests/pos/t6225.scala @@ -15,6 +15,6 @@ object ko { } object ko2 { - import library.y._ + import library.y.* implicitly[Foo] } diff --git a/tests/pos/t6335.scala b/tests/pos/t6335.scala index 1c0b846be372..e636e0ab4a59 100644 --- a/tests/pos/t6335.scala +++ b/tests/pos/t6335.scala @@ -16,7 +16,7 @@ trait Z { } object Test { - import E._ + import E.* 0.xx "".yy diff --git a/tests/pos/t6780.scala b/tests/pos/t6780.scala index 4a358046c607..49c4301bc345 100644 --- a/tests/pos/t6780.scala +++ b/tests/pos/t6780.scala @@ -2,7 +2,7 @@ object O { implicit def i: Int = 0 } -import O._ +import O.* trait Foo { implicit val v1: Any diff --git a/tests/pos/t6963c.scala b/tests/pos/t6963c.scala index 80e8f11d9de5..baf356ab26b7 100644 --- a/tests/pos/t6963c.scala +++ b/tests/pos/t6963c.scala @@ -22,7 +22,7 @@ object Test { } def f5: Unit = { - import scala.collection.mutable._ + import scala.collection.mutable.* List(1,2,3,4,5).scanRight(0)(_+_) } } diff --git a/tests/pos/t7232/Test.scala b/tests/pos/t7232/Test.scala index 49c3c12aed02..697f1313f8ed 100644 --- a/tests/pos/t7232/Test.scala +++ b/tests/pos/t7232/Test.scala @@ -1,5 +1,5 @@ object Test { - import pack._ + import pack.* Foo.okay().size() Foo.wrong().size() } diff --git a/tests/pos/t7232c/Test.scala b/tests/pos/t7232c/Test.scala index aa7c71094839..3fedd2475670 100644 --- a/tests/pos/t7232c/Test.scala +++ b/tests/pos/t7232c/Test.scala @@ -1,4 +1,4 @@ object Test { - import pack._ + import pack.* Foo.innerList().isInnerList() } diff --git a/tests/pos/t7232d/Test.scala b/tests/pos/t7232d/Test.scala index 89a8063b3c17..f0c8d9d8895f 100644 --- a/tests/pos/t7232d/Test.scala +++ b/tests/pos/t7232d/Test.scala @@ -1,4 +1,4 @@ object Test { - import pack._ + import pack.* Foo.mapEntry().getKey() } diff --git a/tests/pos/t7233.scala b/tests/pos/t7233.scala index ae15c08c3569..5e785c02c95c 100644 --- a/tests/pos/t7233.scala +++ b/tests/pos/t7233.scala @@ -5,7 +5,7 @@ object Foo { def ol(i: String) = i } object Test { - import Foo.{ bar => quux, toString => bar, ol => olRenamed} + import Foo.{ bar as quux, toString as bar, ol as olRenamed} val f1 = quux _ val f1Typed: (Int => Int) = f1 diff --git a/tests/pos/t7233b.scala b/tests/pos/t7233b.scala index 927c7fcfd12f..62fb14959482 100644 --- a/tests/pos/t7233b.scala +++ b/tests/pos/t7233b.scala @@ -1,8 +1,8 @@ object Test { // crash - def foo(a: Any) = { import a.{toString => toS}; toS } + def foo(a: Any) = { import a.toString as toS; toS } // okay - def ok1(a: String) = { import a.{isInstanceOf => iio}; iio[String] } - def ok2(a: Int) = { import a.{toInt => ti}; ti } + def ok1(a: String) = { import a.isInstanceOf as iio; iio[String] } + def ok2(a: Int) = { import a.toInt as ti; ti } } diff --git a/tests/pos/t7285a.scala b/tests/pos/t7285a.scala index 23b52f5950bb..aa6f731ab294 100644 --- a/tests/pos/t7285a.scala +++ b/tests/pos/t7285a.scala @@ -80,7 +80,7 @@ object Test4 { } } - import Test4.Base._ + import Test4.Base.* locally { (d1: Base, d2: Base) => (d1, d2) match { diff --git a/tests/pos/t7532b/B_2.scala b/tests/pos/t7532b/B_2.scala index c4f15daf5c61..ee77dcb4935a 100644 --- a/tests/pos/t7532b/B_2.scala +++ b/tests/pos/t7532b/B_2.scala @@ -1,4 +1,4 @@ -import pack._ +import pack.* object Test { val r = new R diff --git a/tests/pos/t7690.scala b/tests/pos/t7690.scala index 4d88c334844a..fcefcd202c89 100644 --- a/tests/pos/t7690.scala +++ b/tests/pos/t7690.scala @@ -11,7 +11,7 @@ object C { def amethod(in: Int): Boolean = in.x { i => - import A._ + import A.* "asdf" == i.toString } } diff --git a/tests/pos/t7785.scala b/tests/pos/t7785.scala index 1de693d137fe..c3fcebfb46f5 100644 --- a/tests/pos/t7785.scala +++ b/tests/pos/t7785.scala @@ -1,4 +1,4 @@ -import scala.language._ +import scala.language.* trait R[+Repr] diff --git a/tests/pos/t812.scala b/tests/pos/t812.scala index 709b59c194e6..16474bc0d2f8 100644 --- a/tests/pos/t812.scala +++ b/tests/pos/t812.scala @@ -1,7 +1,7 @@ package test; -import scala.{App => Main}; +import scala.App as Main; class Test extends Main { - import test.{Test => Hello} + import test.Test as Hello super[App].main(Array("test")); private[Test] def xxx = 10; } diff --git a/tests/pos/t8170.scala b/tests/pos/t8170.scala index fe9f262ba22d..f8718937d107 100644 --- a/tests/pos/t8170.scala +++ b/tests/pos/t8170.scala @@ -9,7 +9,7 @@ object O { } object Test { - import O._ + import O.* val a: B = ??? val b: a.T[X] = ??? b.ensuring(x => true) // trigger an implicit search diff --git a/tests/pos/t8207.scala b/tests/pos/t8207.scala index 680b40f3790f..c03f5824e352 100644 --- a/tests/pos/t8207.scala +++ b/tests/pos/t8207.scala @@ -1,5 +1,5 @@ class C { me => - import me.{toString => ts} + import me.toString as ts locally(this: me.type) trait T type X = me.T diff --git a/tests/pos/t8300-conversions-a.scala b/tests/pos/t8300-conversions-a.scala index 1a24da7502af..1728c43ca53c 100644 --- a/tests/pos/t8300-conversions-a.scala +++ b/tests/pos/t8300-conversions-a.scala @@ -16,7 +16,7 @@ trait Universe { object Test extends App { val u: Universe = ??? - import u._ + import u.* val sym: Symbol = ??? sym.asFreeType diff --git a/tests/pos/t8300-conversions-b.scala b/tests/pos/t8300-conversions-b.scala index a571dbea9040..052fb388c6bb 100644 --- a/tests/pos/t8300-conversions-b.scala +++ b/tests/pos/t8300-conversions-b.scala @@ -16,7 +16,7 @@ trait Universe { object Test extends App { val u: Universe = ??? - import u._ + import u.* val sym: Symbol = ??? sym.asFreeType diff --git a/tests/pos/t8300-overloading.scala b/tests/pos/t8300-overloading.scala index 2eeba0a66ca7..61d8df3c5151 100644 --- a/tests/pos/t8300-overloading.scala +++ b/tests/pos/t8300-overloading.scala @@ -9,7 +9,7 @@ trait Universe { object Test extends App { val u: Universe = ??? - import u._ + import u.* def foo(name: Name) = ??? def foo(name: TermName) = ??? diff --git a/tests/pos/t8300-patmat-a.scala b/tests/pos/t8300-patmat-a.scala index ab3a3c960526..8d2960294678 100644 --- a/tests/pos/t8300-patmat-a.scala +++ b/tests/pos/t8300-patmat-a.scala @@ -9,7 +9,7 @@ trait Universe { object Test extends App { val u: Universe = ??? - import u._ + import u.* locally { val ScalaName: TermName = ??? diff --git a/tests/pos/t8300-patmat-b.scala b/tests/pos/t8300-patmat-b.scala index 0acad4406956..4b33061d321a 100644 --- a/tests/pos/t8300-patmat-b.scala +++ b/tests/pos/t8300-patmat-b.scala @@ -9,7 +9,7 @@ trait Universe { object Test extends App { val u: Universe = ??? - import u._ + import u.* locally { val ScalaName: TermName = ??? diff --git a/tests/pos/t8301.scala b/tests/pos/t8301.scala index 2d10864c57e7..fe9bff52e78b 100644 --- a/tests/pos/t8301.scala +++ b/tests/pos/t8301.scala @@ -12,7 +12,7 @@ trait Universe { object Test extends App { val u: Universe = ??? - import u._ + import u.* val sym: Symbol = ??? sym.asFreeType diff --git a/tests/pos/t8301b.scala b/tests/pos/t8301b.scala index 4dd39139d276..403b5faf168f 100644 --- a/tests/pos/t8301b.scala +++ b/tests/pos/t8301b.scala @@ -9,7 +9,7 @@ trait Universe { object Test extends App { val u: Universe = ??? - import u._ + import u.* val ScalaName: TermName = ??? locally { @@ -17,12 +17,12 @@ object Test extends App { ??? match { case Test.ScalaName => ??? } - import Test.ScalaName._ + import Test.ScalaName.* ??? match { case ScalaName => ??? } - import ScalaName._ + import ScalaName.* // both the pattern and import led to // stable identifier required, but SN found. Note that value SN @@ -31,6 +31,6 @@ object Test extends App { ??? match { case SN => ??? } - import SN._ + import SN.* } } diff --git a/tests/pos/tangledCompanion.scala b/tests/pos/tangledCompanion.scala index 5853f8675ec3..5e0f3c2aca8b 100644 --- a/tests/pos/tangledCompanion.scala +++ b/tests/pos/tangledCompanion.scala @@ -1,6 +1,6 @@ object Test { - import Coll._ + import Coll.* import LazyList.#:: val xs = LazyList.Empty diff --git a/tests/pos/tasty-reflect-opaque-api-proto.scala b/tests/pos/tasty-reflect-opaque-api-proto.scala index fe077fd5b15e..744c14a55a89 100644 --- a/tests/pos/tasty-reflect-opaque-api-proto.scala +++ b/tests/pos/tasty-reflect-opaque-api-proto.scala @@ -19,7 +19,7 @@ class Reflect(val internal: CompilerInterface) { object App { val refl: Reflect = ??? - import refl._ + import refl.* val tree: Tree = ??? tree.show diff --git a/tests/pos/tcpoly_infer_ticket716.scala b/tests/pos/tcpoly_infer_ticket716.scala index 8268cdad9513..a517ac28884f 100644 --- a/tests/pos/tcpoly_infer_ticket716.scala +++ b/tests/pos/tcpoly_infer_ticket716.scala @@ -19,7 +19,7 @@ object Functor{ } object GeneralLiftingDemo extends App { - import Functor._ + import Functor.* val l = List(1,2,3) val res = l fmap( 1+_) // TODO: should not need explicit call to lifttoOO println("OO : " + res ) diff --git a/tests/pos/test-desugar.scala b/tests/pos/test-desugar.scala index a1e7c7e2c9af..abe358ce8874 100644 --- a/tests/pos/test-desugar.scala +++ b/tests/pos/test-desugar.scala @@ -31,7 +31,7 @@ object desugar { object patDefs { - import caseClasses._ + import caseClasses.* val xs: List[Int] = Cons(1, Cons(2, Nil)) diff --git a/tests/pos/test-erasure.scala b/tests/pos/test-erasure.scala index d794e9186d7a..1fd61ece6c57 100644 --- a/tests/pos/test-erasure.scala +++ b/tests/pos/test-erasure.scala @@ -5,7 +5,7 @@ object erasure { def this() = this(0) } - import java.lang._ + import java.lang.* def const[T](x: T, y: T) = x diff --git a/tests/pos/test-typers.scala b/tests/pos/test-typers.scala index 93e255f1a152..a0b0d14e58a2 100644 --- a/tests/pos/test-typers.scala +++ b/tests/pos/test-typers.scala @@ -1,7 +1,7 @@ package test import annotation.{tailrec, switch} -import collection.mutable._ +import collection.mutable.* object typers { diff --git a/tests/pos/type-projection.scala b/tests/pos/type-projection.scala index 943baa27587c..55712069223d 100644 --- a/tests/pos/type-projection.scala +++ b/tests/pos/type-projection.scala @@ -1,6 +1,6 @@ package p package q -import java.lang._ +import java.lang.* import language.`3.0-migration` trait Txn[S <: Sys[S]] { diff --git a/tests/pos/typeclass-encoding.scala b/tests/pos/typeclass-encoding.scala index 52ad8126dd8e..03731f409a43 100644 --- a/tests/pos/typeclass-encoding.scala +++ b/tests/pos/typeclass-encoding.scala @@ -48,7 +48,7 @@ object runtime { } object semiGroups { - import runtime._ + import runtime.* trait SemiGroup extends TypeClass { def add(that: This): This diff --git a/tests/pos/typeclass-encoding2.scala b/tests/pos/typeclass-encoding2.scala index 143c1bc2ae0c..13db93f91204 100644 --- a/tests/pos/typeclass-encoding2.scala +++ b/tests/pos/typeclass-encoding2.scala @@ -61,13 +61,13 @@ object runtime { (implicit ev: TypeClassCommon { type This = From }): ev.Instance { type This = From } = ev.inject(x) } -import runtime._ +import runtime.* object semiGroups { trait SemiGroup extends TypeClass { val commons: SemiGroupCommon - import commons._ + import commons.* def add(that: This): This } trait SemiGroupCommon extends TypeClassCommon { @@ -79,7 +79,7 @@ object semiGroups { trait Monoid extends SemiGroup { val commons: MonoidCommon - import commons._ + import commons.* } trait MonoidCommon extends SemiGroupCommon { type Instance <: Monoid @@ -179,7 +179,7 @@ object ord { trait Ord extends TypeClass { val commons: OrdCommon - import commons._ + import commons.* def compareTo(that: This): Int def < (that: This) = compareTo(that) < 0 def > (that: This) = compareTo(that) > 0 @@ -198,7 +198,7 @@ object ord { val minimum: Int = Int.MinValue def inject($this: Int) = new Ord { val commons: IntOrd.this.type = IntOrd.this - import commons._ + import commons.* def compareTo(that: this.This): Int = if (this < that) -1 else if (this > that) +1 else 0 } @@ -210,7 +210,7 @@ object ord { def minimum: List[T] = Nil def inject($this: List[T]) = new Ord { val commons: self.type = self - import commons._ + import commons.* def compareTo(that: List[T]): Int = ($this, that) match { case (Nil, Nil) => 0 case (Nil, _) => -1 @@ -294,13 +294,13 @@ object runtime1 { }): ev.Instance[A] { type This = [X] =>> From[X] } = ev.inject(x) } -import runtime1._ +import runtime1.* object functors { trait Functor[A] extends TypeClass1 { val commons: FunctorCommon - import commons._ + import commons.* def map[B](f: A => B): This[B] } trait FunctorCommon extends TypeClassCommon1 { @@ -313,7 +313,7 @@ object functors { trait Monad[A] extends Functor[A] { val commons: MonadCommon - import commons._ + import commons.* def flatMap[B](f: A => This[B]): This[B] def map[B](f: A => B) = this.flatMap(f.andThen(commons.pure)) } @@ -334,7 +334,7 @@ object functors { def pure[A](x: A) = x :: Nil def inject[A]($this: List[A]) = new Monad[A] { val commons: ListMonad.this.type = ListMonad - import commons._ + import commons.* def flatMap[B](f: A => List[B]): List[B] = $this.flatMap(f) } } diff --git a/tests/pos/typeclass-encoding3.scala b/tests/pos/typeclass-encoding3.scala index 363826d2d6bd..ee42c7ba9e28 100644 --- a/tests/pos/typeclass-encoding3.scala +++ b/tests/pos/typeclass-encoding3.scala @@ -62,7 +62,7 @@ object Test { trait SemiGroup { val common: SemiGroup.Common - import common._ + import common.* def combine(that: This): This } @@ -76,7 +76,7 @@ object Test { trait Monoid extends SemiGroup { val common: Monoid.Common - import common._ + import common.* } object Monoid { trait Common extends SemiGroup.Common { self => @@ -157,7 +157,7 @@ object Test { trait Ord { val common: Ord.Common - import common._ + import common.* def compareTo(that: This): Int def < (that: This) = compareTo(that) < 0 @@ -242,7 +242,7 @@ object Test { trait Functor[A] { val common: Functor.Common - import common._ + import common.* def map[B](f: A => B): This[B] } @@ -257,7 +257,7 @@ object Test { trait Monad[A] extends Functor[A] { self => val common: Monad.Common - import common._ + import common.* def flatMap[B](f: A => This[B]): This[B] def map[B](f: A => B): This[B] = flatMap(f `andThen` pure) diff --git a/tests/pos/virtpatmat_exist1.scala b/tests/pos/virtpatmat_exist1.scala index f3ac809a7268..93c37d76c422 100644 --- a/tests/pos/virtpatmat_exist1.scala +++ b/tests/pos/virtpatmat_exist1.scala @@ -1,4 +1,4 @@ -import annotation.unchecked.{uncheckedVariance => uV} +import annotation.unchecked.uncheckedVariance as uV import scala.collection.{IterableFactory, StrictOptimizedIterableOps, mutable} import scala.collection.immutable.{ListMap, ListSet} import scala.collection.mutable.{AbstractSet, HashMap, HashSet, Set, SetOps} @@ -29,7 +29,7 @@ object Test { } // without type ascription for the one in the body of the last flatmap of each alternative, type inference borks on the existentials - // def splitArray[T >: Nothing <: Any](ad: Array[Iterable[T]]): Any = { import OptionMatching._ + // def splitArray[T >: Nothing <: Any](ad: Array[Iterable[T]]): Any = { import OptionMatching.* // runOrElse(ad.apply(0))(((x1: Iterable[T]) => ( // or(((x4: Iterable[T]) => one(null)), // guard(x1.isInstanceOf[Iterable[T] with Test.HashMapCollision1[_,_]], x1.asInstanceOf[Iterable[T] with Test.HashMapCollision1[_,_]]).flatMap(((x2: Iterable[T] with Test.HashMapCollision1[_,_]) => one(x2))), diff --git a/tests/pos/virtpatmat_exist2.scala b/tests/pos/virtpatmat_exist2.scala index f6ebb3ee2f84..c16c2721cc83 100644 --- a/tests/pos/virtpatmat_exist2.scala +++ b/tests/pos/virtpatmat_exist2.scala @@ -8,7 +8,7 @@ object Test { // what's the _$1 doing there? // def grow[T >: Nothing <: Any]: ParseResult[T] = { - // import OptionMatching._ + // import OptionMatching.* // runOrElse[MemoEntry[T], ParseResult[T]]((null: MemoEntry[T]))(((x1: MemoEntry[T]) => // (MemoEntry.unapply[T](x1).flatMap[ParseResult[T]](((x4: Either[Nothing,ParseResult[_]]) => // guard[Right[Nothing,ParseResult[_]]](x4.isInstanceOf[Right[Nothing,ParseResult[_]]], x4.asInstanceOf[Right[Nothing,ParseResult[_]]]).flatMap[ParseResult[T]](((cp3: Right[Nothing,ParseResult[_]]) => diff --git a/tests/pos/virtpatmat_exist4.scala b/tests/pos/virtpatmat_exist4.scala index 728006276350..b81134b0457a 100644 --- a/tests/pos/virtpatmat_exist4.scala +++ b/tests/pos/virtpatmat_exist4.scala @@ -10,7 +10,7 @@ trait IMain { self: MemberHandlers => trait MemberHandlers { val intp: IMain - import intp.global._ + import intp.global.* sealed abstract class MemberHandler(val member: Tree) { def importedSymbols: List[Symbol] } diff --git a/tests/rewrites/rewrites3x.scala b/tests/rewrites/rewrites3x.scala index d8f9f680d614..48e2d35b0fdd 100644 --- a/tests/rewrites/rewrites3x.scala +++ b/tests/rewrites/rewrites3x.scala @@ -1,6 +1,9 @@ +import scala.{collection => coll, runtime=>_, _} +import coll._ + def f(xs: Int*) = xs.sum def test = - f(List(1, 2, 3) *) + f(List(1, 2, 3): _*) def g = { implicit x: Int => x + 1 diff --git a/tests/run-custom-args/Yretain-trees/tasty-definitions-2/Macro_1.scala b/tests/run-custom-args/Yretain-trees/tasty-definitions-2/Macro_1.scala index e30bf8af85ae..4f3bca594b0a 100644 --- a/tests/run-custom-args/Yretain-trees/tasty-definitions-2/Macro_1.scala +++ b/tests/run-custom-args/Yretain-trees/tasty-definitions-2/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { @@ -6,7 +6,7 @@ object Foo { ${ inspectBodyImpl('i) } def inspectBodyImpl(x: Expr[Int])(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* x.asTerm match { case Inlined(None, Nil, arg) => Expr(arg.symbol.tree.show(using Printer.TreeStructure)) case arg => Expr(arg.symbol.tree.show(using Printer.TreeStructure)) // TODO should all by name parameters be in an inline node? diff --git a/tests/run-custom-args/Yretain-trees/tasty-definitions-3.check b/tests/run-custom-args/Yretain-trees/tasty-definitions-3.check index 3cdc1b6b29f7..3c2b67edfde0 100644 --- a/tests/run-custom-args/Yretain-trees/tasty-definitions-3.check +++ b/tests/run-custom-args/Yretain-trees/tasty-definitions-3.check @@ -1,3 +1,3 @@ -DefDef("foo", Nil, Inferred(), None) -ValDef("bar", Inferred(), None) +DefDef("foo", Nil, TypeIdent("Int"), Some(Apply(Select(Literal(IntConstant(1)), "+"), List(Literal(IntConstant(2)))))) +ValDef("bar", TypeIdent("Int"), Some(Apply(Select(Literal(IntConstant(2)), "+"), List(Literal(IntConstant(3)))))) Bind("x", Ident("_")) diff --git a/tests/run-custom-args/Yretain-trees/tasty-definitions-3/Macro_1.scala b/tests/run-custom-args/Yretain-trees/tasty-definitions-3/Macro_1.scala index 6bdd99bfe7fa..179fe8f48654 100644 --- a/tests/run-custom-args/Yretain-trees/tasty-definitions-3/Macro_1.scala +++ b/tests/run-custom-args/Yretain-trees/tasty-definitions-3/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { @@ -6,7 +6,7 @@ object Foo { ${ inspectBodyImpl('i) } def inspectBodyImpl(x: Expr[Int])(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* x.asTerm match { case Inlined(None, Nil, arg) => Expr(arg.symbol.tree.show(using Printer.TreeStructure)) case arg => Expr(arg.symbol.tree.show(using Printer.TreeStructure)) // TODO should all by name parameters be in an inline node? diff --git a/tests/run-custom-args/Yretain-trees/tasty-extractors-owners/quoted_1.scala b/tests/run-custom-args/Yretain-trees/tasty-extractors-owners/quoted_1.scala index 11be6e926a5f..e29ac7a11944 100644 --- a/tests/run-custom-args/Yretain-trees/tasty-extractors-owners/quoted_1.scala +++ b/tests/run-custom-args/Yretain-trees/tasty-extractors-owners/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -6,7 +6,7 @@ object Macros { ${ impl('x) } def impl[T](x: Expr[T])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val buff = new StringBuilder @@ -19,7 +19,7 @@ object Macros { def myTraverser(using Quotes)(buff: StringBuilder): quotes.reflect.TreeTraverser = new { - import quotes.reflect._ + import quotes.reflect.* override def traverseTree(tree: Tree)(owner: Symbol): Unit = { tree match { case tree @ DefDef(name, _, _, _) => diff --git a/tests/run-custom-args/Yretain-trees/tasty-extractors-owners/quoted_2.scala b/tests/run-custom-args/Yretain-trees/tasty-extractors-owners/quoted_2.scala index cc13d81ae03b..5b793c829269 100644 --- a/tests/run-custom-args/Yretain-trees/tasty-extractors-owners/quoted_2.scala +++ b/tests/run-custom-args/Yretain-trees/tasty-extractors-owners/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-custom-args/Yretain-trees/tasty-load-tree-1/quoted_1.scala b/tests/run-custom-args/Yretain-trees/tasty-load-tree-1/quoted_1.scala index 53cecc556fee..8bcba476dff2 100644 --- a/tests/run-custom-args/Yretain-trees/tasty-load-tree-1/quoted_1.scala +++ b/tests/run-custom-args/Yretain-trees/tasty-load-tree-1/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { @@ -7,7 +7,7 @@ object Foo { ${ inspectBodyImpl('i) } def inspectBodyImpl(x: Expr[Int])(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* def definitionString(sym: Symbol): Expr[String] = if sym.isClassDef || sym.isDefDef || sym.isValDef then Expr(sym.tree.show(using Printer.TreeStructure)) diff --git a/tests/run-custom-args/Yretain-trees/tasty-load-tree-2.check b/tests/run-custom-args/Yretain-trees/tasty-load-tree-2.check index 70f474a9e253..e66a336fb836 100644 --- a/tests/run-custom-args/Yretain-trees/tasty-load-tree-2.check +++ b/tests/run-custom-args/Yretain-trees/tasty-load-tree-2.check @@ -1,2 +1,2 @@ -DefDef("foo", Nil, Inferred(), None) -ValDef("bar", Inferred(), None) +DefDef("foo", Nil, TypeIdent("Int"), Some(Apply(Select(Literal(IntConstant(1)), "+"), List(Literal(IntConstant(2)))))) +ValDef("bar", TypeIdent("Int"), Some(Apply(Select(Literal(IntConstant(2)), "+"), List(Literal(IntConstant(3)))))) diff --git a/tests/run-custom-args/Yretain-trees/tasty-load-tree-2/quoted_1.scala b/tests/run-custom-args/Yretain-trees/tasty-load-tree-2/quoted_1.scala index 81550be6ca02..d6983c1034c8 100644 --- a/tests/run-custom-args/Yretain-trees/tasty-load-tree-2/quoted_1.scala +++ b/tests/run-custom-args/Yretain-trees/tasty-load-tree-2/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { @@ -6,7 +6,7 @@ object Foo { ${ inspectBodyImpl('i) } def inspectBodyImpl(x: Expr[Int])(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* def definitionString(sym: Symbol): Expr[String] = if sym.isClassDef || sym.isDefDef || sym.isValDef then Expr(sym.tree.show(using Printer.TreeStructure)) diff --git a/tests/run-custom-args/erased/erased-frameless.scala b/tests/run-custom-args/erased/erased-frameless.scala index 989faf22ddb7..bc52bd4ac8fb 100644 --- a/tests/run-custom-args/erased/erased-frameless.scala +++ b/tests/run-custom-args/erased/erased-frameless.scala @@ -101,7 +101,7 @@ object X4 { } object Test { - import Exists._ + import Exists.* def main(args: Array[String]): Unit = { val source: Vector[X4[Int, String, Double, Boolean]] = diff --git a/tests/run-custom-args/run-macros-erased/macro-erased/1.scala b/tests/run-custom-args/run-macros-erased/macro-erased/1.scala index bd3b8222d0bb..567ef57b1c06 100644 --- a/tests/run-custom-args/run-macros-erased/macro-erased/1.scala +++ b/tests/run-custom-args/run-macros-erased/macro-erased/1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def foo1(i: Int) = $ { case1('{ i }) } diff --git a/tests/run-custom-args/run-macros-erased/reflect-isFunctionType/macro_1.scala b/tests/run-custom-args/run-macros-erased/reflect-isFunctionType/macro_1.scala index 3bc306b73b10..bd07a51684f6 100644 --- a/tests/run-custom-args/run-macros-erased/reflect-isFunctionType/macro_1.scala +++ b/tests/run-custom-args/run-macros-erased/reflect-isFunctionType/macro_1.scala @@ -1,10 +1,10 @@ -import scala.quoted._ +import scala.quoted.* inline def isFunctionType[T]: Boolean = ${ isFunctionTypeImpl[T] } def isFunctionTypeImpl[T: Type](using Quotes) : Expr[Boolean] = { - import quotes.reflect._ + import quotes.reflect.* Expr(TypeRepr.of[T].isFunctionType) } @@ -12,7 +12,7 @@ def isFunctionTypeImpl[T: Type](using Quotes) : Expr[Boolean] = { inline def isContextFunctionType[T]: Boolean = ${ isContextFunctionTypeImpl[T] } def isContextFunctionTypeImpl[T: Type](using Quotes) : Expr[Boolean] = { - import quotes.reflect._ + import quotes.reflect.* Expr(TypeRepr.of[T].isContextFunctionType) } @@ -20,14 +20,14 @@ def isContextFunctionTypeImpl[T: Type](using Quotes) : Expr[Boolean] = { inline def isErasedFunctionType[T]: Boolean = ${ isErasedFunctionTypeImpl[T] } def isErasedFunctionTypeImpl[T: Type](using Quotes) : Expr[Boolean] = { - import quotes.reflect._ + import quotes.reflect.* Expr(TypeRepr.of[T].isErasedFunctionType) } inline def isDependentFunctionType[T]: Boolean = ${ isDependentFunctionTypeImpl[T] } def isDependentFunctionTypeImpl[T: Type](using Quotes) : Expr[Boolean] = { - import quotes.reflect._ + import quotes.reflect.* Expr(TypeRepr.of[T].isDependentFunctionType) } diff --git a/tests/run-custom-args/tasty-inspector/i10359.scala b/tests/run-custom-args/tasty-inspector/i10359.scala index f8f8f8c971f1..e2913c8ba25b 100644 --- a/tests/run-custom-args/tasty-inspector/i10359.scala +++ b/tests/run-custom-args/tasty-inspector/i10359.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.tasty.inspector._ +import scala.quoted.* +import scala.tasty.inspector.* object Bar { class Givens { @@ -36,7 +36,7 @@ object Test { class TestInspector() extends Inspector: def inspect(using Quotes)(tastys: List[Tasty[quotes.type]]): Unit = - import quotes.reflect._ + import quotes.reflect.* for tasty <- tastys do val code = tasty.ast.show diff --git a/tests/run-custom-args/tasty-inspector/i8163.scala b/tests/run-custom-args/tasty-inspector/i8163.scala index 4c06c317d41f..1f124b5d4182 100644 --- a/tests/run-custom-args/tasty-inspector/i8163.scala +++ b/tests/run-custom-args/tasty-inspector/i8163.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.tasty.inspector._ +import scala.quoted.* +import scala.tasty.inspector.* opaque type PhoneNumber = String @@ -27,7 +27,7 @@ class TestInspector() extends Inspector: inspectClass(tasty.ast) private def inspectClass(using Quotes)(tree: quotes.reflect.Tree): Unit = - import quotes.reflect._ + import quotes.reflect.* tree match { case t: PackageClause => t.stats.map( m => inspectClass(m) ) diff --git a/tests/run-custom-args/tasty-inspector/i8364.scala b/tests/run-custom-args/tasty-inspector/i8364.scala index bd808ac38a20..30b8a6b0bc7c 100644 --- a/tests/run-custom-args/tasty-inspector/i8364.scala +++ b/tests/run-custom-args/tasty-inspector/i8364.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.tasty.inspector._ +import scala.quoted.* +import scala.tasty.inspector.* @main def Test = { val inspector = new Inspector { diff --git a/tests/run-custom-args/tasty-inspector/i8389.scala b/tests/run-custom-args/tasty-inspector/i8389.scala index aef85a24d22c..3ceb0f150a44 100644 --- a/tests/run-custom-args/tasty-inspector/i8389.scala +++ b/tests/run-custom-args/tasty-inspector/i8389.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.tasty.inspector._ +import scala.quoted.* +import scala.tasty.inspector.* @main def Test = { // Artefact of the current test infrastructure diff --git a/tests/run-custom-args/tasty-inspector/i8460.scala b/tests/run-custom-args/tasty-inspector/i8460.scala index 2ed9b59168bc..76409764e577 100644 --- a/tests/run-custom-args/tasty-inspector/i8460.scala +++ b/tests/run-custom-args/tasty-inspector/i8460.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.tasty.inspector._ +import scala.quoted.* +import scala.tasty.inspector.* // Ambiguous member names sealed trait Vehicle @@ -43,7 +43,7 @@ class TestInspector_Children() extends Inspector: } private def inspectClass(using Quotes)(tree: quotes.reflect.Tree): Unit = - import quotes.reflect._ + import quotes.reflect.* tree match { case t: PackageClause => t.stats.map( m => inspectClass(m) ) diff --git a/tests/run-custom-args/tasty-inspector/i9970.scala b/tests/run-custom-args/tasty-inspector/i9970.scala index afc1cd25352e..9d1ad31f97e2 100644 --- a/tests/run-custom-args/tasty-inspector/i9970.scala +++ b/tests/run-custom-args/tasty-inspector/i9970.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.tasty.inspector._ +import scala.quoted.* +import scala.tasty.inspector.* /* Test that the constructor of a trait has the StableRealizable trait if and * only if the trait has NoInits. This is used by the TASTy reader in Scala 2 @@ -53,7 +53,7 @@ class TestInspector() extends Inspector: var foundSimple: Boolean = false def inspectClass(using Quotes)(tree: quotes.reflect.Tree): Unit = - import quotes.reflect._ + import quotes.reflect.* tree match case t: PackageClause => t.stats.foreach(inspectClass(_)) diff --git a/tests/run-custom-args/tasty-inspector/tasty-documentation-inspector/Test.scala b/tests/run-custom-args/tasty-inspector/tasty-documentation-inspector/Test.scala index 0e03bab7107b..4389c9f7fff6 100644 --- a/tests/run-custom-args/tasty-inspector/tasty-documentation-inspector/Test.scala +++ b/tests/run-custom-args/tasty-inspector/tasty-documentation-inspector/Test.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.tasty.inspector._ +import scala.quoted.* +import scala.tasty.inspector.* object Test { def main(args: Array[String]): Unit = { @@ -17,7 +17,7 @@ class DocumentationInspector extends Inspector { def inspect(using Quotes)(tastys: List[Tasty[quotes.type]]): Unit = { - import quotes.reflect._ + import quotes.reflect.* object Traverser extends TreeTraverser { override def traverseTree(tree: Tree)(owner: Symbol): Unit = tree match { diff --git a/tests/run-custom-args/tasty-inspector/tasty-inspector/Test.scala b/tests/run-custom-args/tasty-inspector/tasty-inspector/Test.scala index d6ddec2c9a29..d2d026a751b0 100644 --- a/tests/run-custom-args/tasty-inspector/tasty-inspector/Test.scala +++ b/tests/run-custom-args/tasty-inspector/tasty-inspector/Test.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.tasty.inspector._ +import scala.quoted.* +import scala.tasty.inspector.* object Test { def main(args: Array[String]): Unit = { @@ -16,7 +16,7 @@ object Test { class DBInspector extends Inspector { def inspect(using Quotes)(tastys: List[Tasty[quotes.type]]): Unit = { - import quotes.reflect._ + import quotes.reflect.* object Traverser extends TreeTraverser { override def traverseTree(tree: Tree)(owner: Symbol): Unit = tree match { diff --git a/tests/run-custom-args/tasty-inspector/tastyPaths.scala b/tests/run-custom-args/tasty-inspector/tastyPaths.scala index f13b0ee24f89..2b3f523cbfe4 100644 --- a/tests/run-custom-args/tasty-inspector/tastyPaths.scala +++ b/tests/run-custom-args/tasty-inspector/tastyPaths.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.tasty.inspector._ +import scala.quoted.* +import scala.tasty.inspector.* import java.io.File.separatorChar diff --git a/tests/run-custom-args/tasty-interpreter/interpreter/TastyInterpreter.scala b/tests/run-custom-args/tasty-interpreter/interpreter/TastyInterpreter.scala index a5ed8048de3a..34697e0d0117 100644 --- a/tests/run-custom-args/tasty-interpreter/interpreter/TastyInterpreter.scala +++ b/tests/run-custom-args/tasty-interpreter/interpreter/TastyInterpreter.scala @@ -1,12 +1,12 @@ package scala.tasty.interpreter -import scala.quoted._ -import scala.tasty.inspector._ +import scala.quoted.* +import scala.tasty.inspector.* class TastyInterpreter extends Inspector { def inspect(using Quotes)(tastys: List[Tasty[quotes.type]]): Unit = { - import quotes.reflect._ + import quotes.reflect.* object Traverser extends TreeTraverser { override def traverseTree(tree: Tree)(owner: Symbol): Unit = tree match { diff --git a/tests/run-custom-args/tasty-interpreter/interpreter/TreeInterpreter.scala b/tests/run-custom-args/tasty-interpreter/interpreter/TreeInterpreter.scala index 73badb893599..a76379e22313 100644 --- a/tests/run-custom-args/tasty-interpreter/interpreter/TreeInterpreter.scala +++ b/tests/run-custom-args/tasty-interpreter/interpreter/TreeInterpreter.scala @@ -1,10 +1,10 @@ package scala.tasty.interpreter -import scala.quoted._ +import scala.quoted.* import scala.tasty.interpreter.jvm.JVMReflection abstract class TreeInterpreter[Q <: Quotes & Singleton](using val q: Q) { - import quotes.reflect._ + import quotes.reflect.* final val LOG = false diff --git a/tests/run-custom-args/tasty-interpreter/interpreter/jvm/Interpreter.scala b/tests/run-custom-args/tasty-interpreter/interpreter/jvm/Interpreter.scala index fa5508b78c51..efb0ea248906 100644 --- a/tests/run-custom-args/tasty-interpreter/interpreter/jvm/Interpreter.scala +++ b/tests/run-custom-args/tasty-interpreter/interpreter/jvm/Interpreter.scala @@ -1,11 +1,11 @@ package scala.tasty.interpreter package jvm -import scala.quoted._ +import scala.quoted.* import scala.tasty.interpreter.jvm.JVMReflection class Interpreter[Q <: Quotes & Singleton](using q0: Q) extends TreeInterpreter[Q] { - import q.reflect._ + import q.reflect.* // All references are represented by themselves and values are boxed type AbstractAny = Any @@ -20,7 +20,7 @@ class Interpreter[Q <: Quotes & Singleton](using q0: Q) extends TreeInterpreter[ sym.tree match case tree: ClassDef => val parentSymbols = tree.parents.tail.map(_.asInstanceOf[TypeTree].symbol).head - import java.lang.reflect._ + import java.lang.reflect.* val handler: InvocationHandler = new InvocationHandler() { def invoke(proxy: Object, method: Method, args: scala.Array[Object]): Object = { if (LOG) { diff --git a/tests/run-custom-args/tasty-interpreter/interpreter/jvm/JVMReflection.scala b/tests/run-custom-args/tasty-interpreter/interpreter/jvm/JVMReflection.scala index d3fc7feb2e21..7d696c0e4e11 100644 --- a/tests/run-custom-args/tasty-interpreter/interpreter/jvm/JVMReflection.scala +++ b/tests/run-custom-args/tasty-interpreter/interpreter/jvm/JVMReflection.scala @@ -1,9 +1,9 @@ package scala.tasty.interpreter.jvm -import scala.quoted._ +import scala.quoted.* class JVMReflection[Q <: Quotes & Singleton](using val q: Q) { - import q.reflect._ + import q.reflect.* import java.lang.reflect.{InvocationTargetException, Method} private val classLoader: ClassLoader = getClass.getClassLoader diff --git a/tests/run-custom-args/typeclass-derivation2.scala b/tests/run-custom-args/typeclass-derivation2.scala index aec56c59219b..228547bcccc1 100644 --- a/tests/run-custom-args/typeclass-derivation2.scala +++ b/tests/run-custom-args/typeclass-derivation2.scala @@ -7,7 +7,7 @@ object TypeLevel { /** @param caseLabels The case and element labels of the described ADT as encoded strings. */ class ReflectedClass(labelsStr: String) { - import ReflectedClass._ + import ReflectedClass.* /** A mirror of case with ordinal number `ordinal` and elements as given by `Product` */ def mirror(ordinal: Int, product: Product): Mirror = @@ -130,7 +130,7 @@ enum Lst[+T] { // derives Eq, Pickler, Show object Lst { // common compiler-generated infrastructure - import TypeLevel._ + import TypeLevel.* type Shape[T] = Shape.Cases[( Shape.Case[Cons[T], (T, Lst[T])], @@ -165,7 +165,7 @@ case class Pair[T](x: T, y: T) // derives Eq, Pickler, Show object Pair { // common compiler-generated infrastructure - import TypeLevel._ + import TypeLevel.* type Shape[T] = Shape.Case[Pair[T], (T, T)] @@ -191,7 +191,7 @@ case class Left[L](x: L) extends Either[L, Nothing] case class Right[R](x: R) extends Either[Nothing, R] object Either { - import TypeLevel._ + import TypeLevel.* type Shape[L, R] = Shape.Cases[( Shape.Case[Left[L], L *: EmptyTuple], @@ -225,7 +225,7 @@ trait Eq[T] { object Eq { import scala.compiletime.{erasedValue, error, summonFrom} - import TypeLevel._ + import TypeLevel.* inline def tryEql[T](x: T, y: T) = summonInline[Eq[T]].eql(x, y) @@ -282,7 +282,7 @@ trait Pickler[T] { object Pickler { import scala.compiletime.{erasedValue, constValue, error, summonInline} - import TypeLevel._ + import TypeLevel.* def nextInt(buf: mutable.ListBuffer[Int]): Int = try buf.head finally buf.trimStart(1) @@ -374,7 +374,7 @@ trait Show[T] { } object Show { import scala.compiletime.{erasedValue, error, summonFrom} - import TypeLevel._ + import TypeLevel.* inline def tryShow[T](x: T): String = summonInline[Show[T]].show(x) @@ -427,7 +427,7 @@ object Show { // Tests object Test extends App { - import TypeLevel._ + import TypeLevel.* val eq = implicitly[Eq[Lst[Int]]] val xs = Lst.Cons(11, Lst.Cons(22, Lst.Cons(33, Lst.Nil))) val ys = Lst.Cons(11, Lst.Cons(22, Lst.Nil)) diff --git a/tests/run-custom-args/typeclass-derivation2c.scala b/tests/run-custom-args/typeclass-derivation2c.scala index 1a4b8873679d..ddf4d62e0498 100644 --- a/tests/run-custom-args/typeclass-derivation2c.scala +++ b/tests/run-custom-args/typeclass-derivation2c.scala @@ -72,7 +72,7 @@ object Deriving { def productElement[T](x: Any, idx: Int) = x.asInstanceOf[Product].productElement(idx).asInstanceOf[T] } -import Deriving._ +import Deriving.* // -- Example Datatypes --------------------------------------------------------- diff --git a/tests/run-deep-subtype/colltest4/CollectionStrawMan4_1.scala b/tests/run-deep-subtype/colltest4/CollectionStrawMan4_1.scala index c3f7d39bc3de..7f723ba86806 100644 --- a/tests/run-deep-subtype/colltest4/CollectionStrawMan4_1.scala +++ b/tests/run-deep-subtype/colltest4/CollectionStrawMan4_1.scala @@ -1,7 +1,7 @@ package colltest4 package strawman.collections -import Predef.{augmentString => _, wrapString => _, _} +import Predef.{augmentString as _, wrapString as _, *} import scala.reflect.ClassTag import annotation.unchecked.uncheckedVariance import annotation.tailrec diff --git a/tests/run-deep-subtype/colltest4/CollectionTests_2.scala b/tests/run-deep-subtype/colltest4/CollectionTests_2.scala index 45da9d8a5e20..9237c6c30e1d 100644 --- a/tests/run-deep-subtype/colltest4/CollectionTests_2.scala +++ b/tests/run-deep-subtype/colltest4/CollectionTests_2.scala @@ -1,9 +1,9 @@ -import Predef.{augmentString => _, wrapString => _, _} +import Predef.{augmentString as _, wrapString as _, *} import scala.reflect.ClassTag object Test { - import colltest4.strawman.collections._ - import CollectionStrawMan4._ + import colltest4.strawman.collections.* + import CollectionStrawMan4.* def seqOps(xs: Seq[Int]) = { val x1 = xs.foldLeft("")(_ + _) diff --git a/tests/run-macros/BigFloat/BigFloatFromDigitsImpl_1.scala b/tests/run-macros/BigFloat/BigFloatFromDigitsImpl_1.scala index d77cf6334f2f..0731abf11174 100644 --- a/tests/run-macros/BigFloat/BigFloatFromDigitsImpl_1.scala +++ b/tests/run-macros/BigFloat/BigFloatFromDigitsImpl_1.scala @@ -1,7 +1,7 @@ package test import language.experimental.genericNumberLiterals import scala.util.FromDigits -import scala.quoted._ +import scala.quoted.* object BigFloatFromDigitsImpl: def apply(digits: Expr[String])(using Quotes): Expr[BigFloat] = diff --git a/tests/run-macros/BigFloat/BigFloat_1.scala b/tests/run-macros/BigFloat/BigFloat_1.scala index 4d256f4394d8..5bb5b49587bd 100644 --- a/tests/run-macros/BigFloat/BigFloat_1.scala +++ b/tests/run-macros/BigFloat/BigFloat_1.scala @@ -1,7 +1,7 @@ package test import language.experimental.genericNumberLiterals import scala.util.FromDigits -import scala.quoted._ +import scala.quoted.* case class BigFloat(mantissa: BigInt, exponent: Int) { diff --git a/tests/run-macros/beta-reduce-inline-result.check b/tests/run-macros/beta-reduce-inline-result.check index f1c651a532ba..ed716e4990d8 100644 --- a/tests/run-macros/beta-reduce-inline-result.check +++ b/tests/run-macros/beta-reduce-inline-result.check @@ -1,6 +1,6 @@ -compile-time: 4:Int +compile-time: Macros.betaReduce[Int, Int](Test.dummy1)(3) run-time: 4 -compile-time: 1:Int +compile-time: Macros.betaReduce[Int, Int](Test.dummy2)(1) run-time: 1 run-time: 5 run-time: 7 diff --git a/tests/run-macros/beta-reduce-inline-result/Macro_1.scala b/tests/run-macros/beta-reduce-inline-result/Macro_1.scala index a38340a74595..528b8434b5c0 100644 --- a/tests/run-macros/beta-reduce-inline-result/Macro_1.scala +++ b/tests/run-macros/beta-reduce-inline-result/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def betaReduce[Arg,Result](inline fn : Arg=>Result)(inline arg: Arg): Result = diff --git a/tests/run-macros/beta-reduce-inline-result/Test_2.scala b/tests/run-macros/beta-reduce-inline-result/Test_2.scala index 247dffe61c79..3df46a7c9be4 100644 --- a/tests/run-macros/beta-reduce-inline-result/Test_2.scala +++ b/tests/run-macros/beta-reduce-inline-result/Test_2.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object Test { diff --git a/tests/run-macros/enum-nat-macro/Macros_2.scala b/tests/run-macros/enum-nat-macro/Macros_2.scala index 19339ef403e8..c533888718ba 100644 --- a/tests/run-macros/enum-nat-macro/Macros_2.scala +++ b/tests/run-macros/enum-nat-macro/Macros_2.scala @@ -1,11 +1,11 @@ -import Nat._ +import Nat.* inline def toIntMacro(inline nat: Nat): Int = ${ Macros.toIntImpl('nat) } inline def ZeroMacro: Zero.type = ${ Macros.natZero } transparent inline def toNatMacro(inline int: Int): Nat = ${ Macros.toNatImpl('int) } object Macros: - import quoted._ + import quoted.* def toIntImpl(nat: Expr[Nat])(using Quotes): Expr[Int] = diff --git a/tests/run-macros/enum-nat-macro/Test_3.scala b/tests/run-macros/enum-nat-macro/Test_3.scala index da686d4cb3f4..946fcdba6db3 100644 --- a/tests/run-macros/enum-nat-macro/Test_3.scala +++ b/tests/run-macros/enum-nat-macro/Test_3.scala @@ -1,4 +1,4 @@ -import Nat._ +import Nat.* @main def Test: Unit = assert(toIntMacro(Succ(Succ(Succ(Zero)))) == 3) diff --git a/tests/run-macros/exports/Macro_2.scala b/tests/run-macros/exports/Macro_2.scala index 8ab557efe02a..252487470d05 100644 --- a/tests/run-macros/exports/Macro_2.scala +++ b/tests/run-macros/exports/Macro_2.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def visitExportsTreeAccumulator[T](inline x: T)(inline f: String => Any): Any = ${ traverseExportsImpl('x, 'f) } inline def visitExportsTreeMap[T](inline x: T)(inline f: T => Any): Any = ${ visitExportsTreeMapImpl('x, 'f) } @@ -12,16 +12,16 @@ private def visitExportsExprMapImpl[T: Type](e: Expr[T], f: Expr[T => Any])(usin '{$f(${IdempotentExprMap.transform(e)})} private def visitExportsTreeMapImpl[T: Type](e: Expr[T], f: Expr[T => Any])(using Quotes): Expr[Any] = - import quotes.reflect._ + import quotes.reflect.* object m extends TreeMap '{$f(${m.transformTerm(e.asTerm)(Symbol.spliceOwner).asExprOf})} private def visitExportsShowImpl[T: Type](e: Expr[T])(using Quotes): Expr[Any] = - import quotes.reflect._ + import quotes.reflect.* '{println(${Expr(e.asTerm.show)})} private def visitExportsShowExtractImpl[T: Type](e: Expr[T])(using Quotes): Expr[Any] = - import quotes.reflect._ + import quotes.reflect.* '{println(${Expr(e.asTerm.show(using Printer.TreeStructure))})} private object IdempotentExprMap extends ExprMap { @@ -32,7 +32,7 @@ private object IdempotentExprMap extends ExprMap { } private def traverseExportsImpl(e: Expr[Any], f: Expr[String => Any])(using Quotes): Expr[Any] = { - import quotes.reflect._ + import quotes.reflect.* import collection.mutable object ExportAccumulator extends TreeAccumulator[mutable.Buffer[String]] { diff --git a/tests/run-macros/expr-map-1/Macro_1.scala b/tests/run-macros/expr-map-1/Macro_1.scala index 0a0859266040..643c57f0bb2b 100644 --- a/tests/run-macros/expr-map-1/Macro_1.scala +++ b/tests/run-macros/expr-map-1/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def rewrite[T](inline x: Any): Any = ${ stringRewriter('x) } diff --git a/tests/run-macros/expr-map-2/Macro_1.scala b/tests/run-macros/expr-map-2/Macro_1.scala index 66c904551331..f6bc48ffc13f 100644 --- a/tests/run-macros/expr-map-2/Macro_1.scala +++ b/tests/run-macros/expr-map-2/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def rewrite[T](inline x: Any): Any = ${ stringRewriter('x) } diff --git a/tests/run-macros/expr-map-3/Macro_1.scala b/tests/run-macros/expr-map-3/Macro_1.scala index 4ca27b8ace5e..0462c90b1305 100644 --- a/tests/run-macros/expr-map-3/Macro_1.scala +++ b/tests/run-macros/expr-map-3/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def rewrite[T](inline x: Any): Any = ${ stringRewriter('x) } diff --git a/tests/run-macros/f-interpolation-1/FQuote_1.scala b/tests/run-macros/f-interpolation-1/FQuote_1.scala index 7d9127025adb..4ca632c18280 100644 --- a/tests/run-macros/f-interpolation-1/FQuote_1.scala +++ b/tests/run-macros/f-interpolation-1/FQuote_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.language.implicitConversions @@ -9,7 +9,7 @@ object FQuote { } /*private*/ def impl(receiver: Expr[SCOps], args: Expr[Seq[Any]])(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* def liftListOfAny(lst: List[Term]): Expr[List[Any]] = lst match { case x :: xs => diff --git a/tests/run-macros/f-interpolation-1/Test_2.scala b/tests/run-macros/f-interpolation-1/Test_2.scala index a343ce600a18..6b2b939b1996 100644 --- a/tests/run-macros/f-interpolation-1/Test_2.scala +++ b/tests/run-macros/f-interpolation-1/Test_2.scala @@ -1,4 +1,4 @@ -import FQuote._ +import FQuote.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/flops-rewrite-2/Macro_1.scala b/tests/run-macros/flops-rewrite-2/Macro_1.scala index a5da85da98a5..b408854669b9 100644 --- a/tests/run-macros/flops-rewrite-2/Macro_1.scala +++ b/tests/run-macros/flops-rewrite-2/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def rewrite[T](inline x: T): T = ${ rewriteMacro('x) } diff --git a/tests/run-macros/flops-rewrite-3/Macro_1.scala b/tests/run-macros/flops-rewrite-3/Macro_1.scala index ccb53b38a4ce..81f6c4035523 100644 --- a/tests/run-macros/flops-rewrite-3/Macro_1.scala +++ b/tests/run-macros/flops-rewrite-3/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def rewrite[T](inline x: T): T = ${ rewriteMacro('x) } diff --git a/tests/run-macros/flops-rewrite/Macro_1.scala b/tests/run-macros/flops-rewrite/Macro_1.scala index cfabc79acc1f..49f071062dae 100644 --- a/tests/run-macros/flops-rewrite/Macro_1.scala +++ b/tests/run-macros/flops-rewrite/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def rewrite[T](inline x: T): T = ${ rewriteMacro('x) } diff --git a/tests/run-macros/gestalt-optional-staging/Macro_1.scala b/tests/run-macros/gestalt-optional-staging/Macro_1.scala index 59da2d765dbf..6d0714a95337 100644 --- a/tests/run-macros/gestalt-optional-staging/Macro_1.scala +++ b/tests/run-macros/gestalt-optional-staging/Macro_1.scala @@ -1,7 +1,7 @@ // Port of https://github.com/liufengyun/gestalt/blob/master/macros/src/main/scala/gestalt/macros/Optional.scala // using staging macros (only quotes and splices) -import scala.quoted._ +import scala.quoted.* final class Optional[+A >: Null](val value: A) extends AnyVal { def get: A = value diff --git a/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala b/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala index bf5acf16b17f..1d085d3a2c15 100644 --- a/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala +++ b/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala @@ -1,34 +1,34 @@ // Port of https://github.com/liufengyun/gestalt/blob/master/macros/src/main/scala/gestalt/macros/TypeToolbox.scala // using staging reflection -import scala.quoted._ +import scala.quoted.* object TypeToolbox { /** are the two types equal? */ inline def =:=[A, B]: Boolean = ${tpEqImpl[A, B]} private def tpEqImpl[A: Type, B: Type](using Quotes) : Expr[Boolean] = { - import quotes.reflect._ + import quotes.reflect.* Expr(TypeRepr.of[A] =:= TypeRepr.of[B]) } /** is `tp1` a subtype of `tp2` */ inline def <:<[A, B]: Boolean = ${tpLEqImpl[A, B]} private def tpLEqImpl[A: Type, B: Type](using Quotes) : Expr[Boolean] = { - import quotes.reflect._ + import quotes.reflect.* Expr(TypeRepr.of[A] <:< TypeRepr.of[B]) } /** type associated with the tree */ inline def typeOf[T, Expected](a: T): Boolean = ${typeOfImpl[T, Expected]('a)} private def typeOfImpl[A: Type, E: Type](a: Expr[A])(using Quotes) : Expr[Boolean] = { - import quotes.reflect._ + import quotes.reflect.* Expr(TypeRepr.of[A] =:= TypeRepr.of[E]) } /** does the type refer to a case class? */ inline def isCaseClass[A]: Boolean = ${isCaseClassImpl[A]} private def isCaseClassImpl[T: Type](using Quotes) : Expr[Boolean] = { - import quotes.reflect._ + import quotes.reflect.* val sym = TypeTree.of[T].symbol Expr(sym.isClassDef && sym.flags.is(Flags.Case)) } @@ -36,66 +36,66 @@ object TypeToolbox { /** val fields of a case class Type -- only the ones declared in primary constructor */ inline def caseFields[T]: List[String] = ${caseFieldsImpl[T]} private def caseFieldsImpl[T: Type](using Quotes) : Expr[List[String]] = { - import quotes.reflect._ + import quotes.reflect.* val fields = TypeTree.of[T].symbol.caseFields.map(_.name) Expr(fields) } inline def fieldIn[T](inline mem: String): String = ${fieldInImpl[T]('mem)} private def fieldInImpl[T: Type](mem: Expr[String])(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* val field = TypeTree.of[T].symbol.declaredField(mem.valueOrError) Expr(if field.isNoSymbol then "" else field.name) } inline def fieldsIn[T]: Seq[String] = ${fieldsInImpl[T]} private def fieldsInImpl[T: Type](using Quotes) : Expr[Seq[String]] = { - import quotes.reflect._ + import quotes.reflect.* val fields = TypeTree.of[T].symbol.declaredFields Expr(fields.map(_.name).toList) } inline def methodIn[T](inline mem: String): Seq[String] = ${methodInImpl[T]('mem)} private def methodInImpl[T: Type](mem: Expr[String])(using Quotes) : Expr[Seq[String]] = { - import quotes.reflect._ + import quotes.reflect.* Expr(TypeTree.of[T].symbol.declaredMethod(mem.valueOrError).map(_.name)) } inline def methodsIn[T]: Seq[String] = ${methodsInImpl[T]} private def methodsInImpl[T: Type](using Quotes) : Expr[Seq[String]] = { - import quotes.reflect._ + import quotes.reflect.* Expr(TypeTree.of[T].symbol.declaredMethods.map(_.name)) } inline def method[T](inline mem: String): Seq[String] = ${methodImpl[T]('mem)} private def methodImpl[T: Type](mem: Expr[String])(using Quotes) : Expr[Seq[String]] = { - import quotes.reflect._ + import quotes.reflect.* Expr(TypeTree.of[T].symbol.memberMethod(mem.valueOrError).map(_.name)) } inline def methods[T]: Seq[String] = ${methodsImpl[T]} private def methodsImpl[T: Type](using Quotes) : Expr[Seq[String]] = { - import quotes.reflect._ + import quotes.reflect.* Expr(TypeTree.of[T].symbol.memberMethods.map(_.name)) } inline def typeTag[T](x: T): String = ${typeTagImpl[T]} private def typeTagImpl[T: Type](using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* val res = TypeRepr.of[T].show Expr(res) } inline def companion[T1, T2]: Boolean = ${companionImpl[T1, T2]} private def companionImpl[T1: Type, T2: Type](using Quotes) : Expr[Boolean] = { - import quotes.reflect._ + import quotes.reflect.* val res = TypeTree.of[T1].symbol.companionModule == TypeTree.of[T2].symbol Expr(res) } inline def companionName[T1]: String = ${companionNameImpl[T1]} private def companionNameImpl[T: Type](using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* val sym = TypeTree.of[T].symbol val companionClass = if sym.isClassDef then sym.companionModule.companionClass diff --git a/tests/run-macros/gestalt-type-toolbox-reflect/Test_2.scala b/tests/run-macros/gestalt-type-toolbox-reflect/Test_2.scala index e74574c2feb6..ace267b55dda 100644 --- a/tests/run-macros/gestalt-type-toolbox-reflect/Test_2.scala +++ b/tests/run-macros/gestalt-type-toolbox-reflect/Test_2.scala @@ -1,6 +1,6 @@ object Test { - import TypeToolbox._ + import TypeToolbox.* type Age = Int diff --git a/tests/run-macros/i10011/Macro_1.scala b/tests/run-macros/i10011/Macro_1.scala index b195d27b3986..95e1878ac0cd 100644 --- a/tests/run-macros/i10011/Macro_1.scala +++ b/tests/run-macros/i10011/Macro_1.scala @@ -1,9 +1,9 @@ -import scala.quoted._ +import scala.quoted.* inline def printPos[T](inline expr: T): (Int, Int) = ${ printPos('expr) } private def printPos[T](expr: Expr[T])(using Quotes): Expr[(Int, Int)] = - import quotes.reflect._ + import quotes.reflect.* val pos = expr.asTerm.pos Expr((pos.start, pos.end)) diff --git a/tests/run-macros/i10043/Macro_1.scala b/tests/run-macros/i10043/Macro_1.scala new file mode 100644 index 000000000000..0a8f6b17e714 --- /dev/null +++ b/tests/run-macros/i10043/Macro_1.scala @@ -0,0 +1,13 @@ +package example + +import scala.quoted._ + +trait Trait { + final val foo = 23 +} + +object Trait { + inline def get: Trait = ${ getImpl } + + def getImpl(using Quotes): Expr[Trait] = '{ new Trait {} } +} diff --git a/tests/run-macros/i10043/Test_2.scala b/tests/run-macros/i10043/Test_2.scala new file mode 100644 index 000000000000..c4634cc44dc3 --- /dev/null +++ b/tests/run-macros/i10043/Test_2.scala @@ -0,0 +1 @@ +@main def Test = println(example.Trait.get) diff --git a/tests/run-macros/i10464/Macro_1.scala b/tests/run-macros/i10464/Macro_1.scala index 063a3928e3c7..f4f3077f2f8d 100644 --- a/tests/run-macros/i10464/Macro_1.scala +++ b/tests/run-macros/i10464/Macro_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object MatchMac { inline def apply(inline any: Any): Unit = ${ printMacImpl('any) } def printMacImpl(any: Expr[Any])(using Quotes): Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val res = any match { case '{ ($f: Person).name } => "matched!" case _ => "not matched" diff --git a/tests/run-macros/i10863/Macro_1.scala b/tests/run-macros/i10863/Macro_1.scala index 4d2ff4be8901..5786e0dc3262 100644 --- a/tests/run-macros/i10863/Macro_1.scala +++ b/tests/run-macros/i10863/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def showList: String = ${ showListExpr } diff --git a/tests/run-macros/i10880/MyQuoteMacro_1.scala b/tests/run-macros/i10880/MyQuoteMacro_1.scala index 31576cc6fe63..18fe92717363 100644 --- a/tests/run-macros/i10880/MyQuoteMacro_1.scala +++ b/tests/run-macros/i10880/MyQuoteMacro_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* case class MyQuoted(val ast: String, sub: String) object MyQuoteMacro { inline def myquote(inline content: MyContent): MyQuoted = ${ MyQuoteMacro.apply('content) } def apply(content: Expr[MyContent])(using Quotes): Expr[MyQuoted] = { - import quotes.reflect._ + import quotes.reflect.* '{ MyQuoted($content.key, null) } } } diff --git a/tests/run-macros/i10880/PullAst_1.scala b/tests/run-macros/i10880/PullAst_1.scala index 7440ddf7a90d..3ae61301b9f8 100644 --- a/tests/run-macros/i10880/PullAst_1.scala +++ b/tests/run-macros/i10880/PullAst_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object PullAst { def applyImpl(quoted: Expr[MyQuoted])(using qctx: Quotes): Expr[String] = diff --git a/tests/run-macros/i10880/Test_2.scala b/tests/run-macros/i10880/Test_2.scala index 67833b7639e7..2933e3c72f41 100644 --- a/tests/run-macros/i10880/Test_2.scala +++ b/tests/run-macros/i10880/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import Dsl._ + import Dsl.* inline def q2 = MyQuoteMacro.myquote(ent.content(MyInsert("Foo"))) diff --git a/tests/run-macros/i10914a/Macro_1.scala b/tests/run-macros/i10914a/Macro_1.scala index c86304c42a86..0a1b8088d04c 100644 --- a/tests/run-macros/i10914a/Macro_1.scala +++ b/tests/run-macros/i10914a/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* case class Entity(value: String) case class Input(ent: Entity) @@ -7,7 +7,7 @@ case class Container(ents: List[Entity]) object Dsl { inline def container(inline c: Input):Container = ${ containerImpl('c) } def containerImpl(c: Expr[Input])(using Quotes): Expr[Container] = - import quotes.reflect._ + import quotes.reflect.* val entExpr = c match case '{ Input($ent) } => ent case _ => report.throwError("Cannot Extract Entity from Input") @@ -21,7 +21,7 @@ object Dsl { inline def pull(inline c: Container): Entity = ${ pullImpl('c) } def pullImpl(c: Expr[Container])(using Quotes): Expr[Entity] = - import quotes.reflect._ + import quotes.reflect.* val inputs = c match case '{ Container($list) } => list.valueOrError diff --git a/tests/run-macros/i10914a/Test_2.scala b/tests/run-macros/i10914a/Test_2.scala index a93784fb2b07..6eae7f21b45d 100644 --- a/tests/run-macros/i10914a/Test_2.scala +++ b/tests/run-macros/i10914a/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import Dsl._ + import Dsl.* inline def makeEnt = Entity("foo") diff --git a/tests/run-macros/i10914b/Macro_1.scala b/tests/run-macros/i10914b/Macro_1.scala index 0515a4eb8cf3..680f189a3566 100644 --- a/tests/run-macros/i10914b/Macro_1.scala +++ b/tests/run-macros/i10914b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* case class Entity(value: String) case class Input(ent: Entity) @@ -9,7 +9,7 @@ object Dsl { inline def container(inline c: Input):Container = ${ containerImpl('c) } def containerImpl(c: Expr[Input])(using Quotes): Expr[Container] = - import quotes.reflect._ + import quotes.reflect.* //println("Getting Input: " + Printer.TreeStructure.show(c.asTerm)) val entExpr = c match case '{ Input($ent) } => ent @@ -25,7 +25,7 @@ object Dsl { inline def pull(inline c: Container): Entity = ${ pullImpl('c) } def pullImpl(c: Expr[Container])(using Quotes): Expr[Entity] = - import quotes.reflect._ + import quotes.reflect.* val inputs = c match case '{ Container($list) } => list.valueOrError diff --git a/tests/run-macros/i10914b/Test_2.scala b/tests/run-macros/i10914b/Test_2.scala index 790b6ef1c99e..2593a1a8c58a 100644 --- a/tests/run-macros/i10914b/Test_2.scala +++ b/tests/run-macros/i10914b/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import Dsl._ + import Dsl.* // inline def entity = makeEnt // This case breaks to //inline def input = Input(entity) diff --git a/tests/run-macros/i4431-b/quoted_1.scala b/tests/run-macros/i4431-b/quoted_1.scala index e62e45ddb2c2..7f617201ec27 100644 --- a/tests/run-macros/i4431-b/quoted_1.scala +++ b/tests/run-macros/i4431-b/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def h(f: => Int => String): String = f(42) diff --git a/tests/run-macros/i4431-b/quoted_2.scala b/tests/run-macros/i4431-b/quoted_2.scala index 00cdb38258d1..429d771f3e53 100644 --- a/tests/run-macros/i4431-b/quoted_2.scala +++ b/tests/run-macros/i4431-b/quoted_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/i4455/Macro_1.scala b/tests/run-macros/i4455/Macro_1.scala index 6ec8460328b1..3b440b370243 100644 --- a/tests/run-macros/i4455/Macro_1.scala +++ b/tests/run-macros/i4455/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def foo(inline i: Int): Int = ${ bar('i) } diff --git a/tests/run-macros/i4455/Test_2.scala b/tests/run-macros/i4455/Test_2.scala index 18fc75a361c6..2a7bdc048b1f 100644 --- a/tests/run-macros/i4455/Test_2.scala +++ b/tests/run-macros/i4455/Test_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { println(foo(1)) diff --git a/tests/run-macros/i4515/Macro_1.scala b/tests/run-macros/i4515/Macro_1.scala index 69b5dabec7f0..3c9d22b81350 100644 --- a/tests/run-macros/i4515/Macro_1.scala +++ b/tests/run-macros/i4515/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def foo[X](x: X): Unit = ${fooImpl('x)} def fooImpl[X: Type](x: Expr[X])(using Quotes): Expr[Unit] = '{} diff --git a/tests/run-macros/i4515b/Macro_1.scala b/tests/run-macros/i4515b/Macro_1.scala index a1bd34fb77e9..6cafe7fbf9cd 100644 --- a/tests/run-macros/i4515b/Macro_1.scala +++ b/tests/run-macros/i4515b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def foo: Unit = ${ fooImpl } diff --git a/tests/run-macros/i4734/Macro_1.scala b/tests/run-macros/i4734/Macro_1.scala index e9cca32ca0ce..30b12d2fce36 100644 --- a/tests/run-macros/i4734/Macro_1.scala +++ b/tests/run-macros/i4734/Macro_1.scala @@ -1,5 +1,5 @@ import scala.annotation.tailrec -import scala.quoted._ +import scala.quoted.* object Macros { inline def unrolledForeach(seq: IndexedSeq[Int], inline f: Int => Unit, inline unrollSize: Int): Unit = // or f: Int => Unit diff --git a/tests/run-macros/i4734/Test_2.scala b/tests/run-macros/i4734/Test_2.scala index 72aa3f715ee8..eb75b2d2b492 100644 --- a/tests/run-macros/i4734/Test_2.scala +++ b/tests/run-macros/i4734/Test_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/i4735/App_2.scala b/tests/run-macros/i4735/App_2.scala index 8a01cf3d06e6..4910a1dab287 100644 --- a/tests/run-macros/i4735/App_2.scala +++ b/tests/run-macros/i4735/App_2.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/i4735/Macro_1.scala b/tests/run-macros/i4735/Macro_1.scala index 482652a37192..54cdcb574c91 100644 --- a/tests/run-macros/i4735/Macro_1.scala +++ b/tests/run-macros/i4735/Macro_1.scala @@ -1,6 +1,6 @@ import scala.annotation.tailrec -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/run-macros/i4803/Macro_1.scala b/tests/run-macros/i4803/Macro_1.scala index 3e4c6e58cf8e..9ff32194c708 100644 --- a/tests/run-macros/i4803/Macro_1.scala +++ b/tests/run-macros/i4803/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object PowerMacro { def powerCode(x: Expr[Double], n: Expr[Long]) (using Quotes): Expr[Double] = diff --git a/tests/run-macros/i4803b/Macro_1.scala b/tests/run-macros/i4803b/Macro_1.scala index b205c6d3047c..ab82cb100dc3 100644 --- a/tests/run-macros/i4803b/Macro_1.scala +++ b/tests/run-macros/i4803b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object PowerMacro { def powerCode(x: Expr[Double], n: Expr[Long]) (using Quotes): Expr[Double] = diff --git a/tests/run-macros/i4803c/Macro_1.scala b/tests/run-macros/i4803c/Macro_1.scala index 26fe7f71bf7b..2058a0bc4b3b 100644 --- a/tests/run-macros/i4803c/Macro_1.scala +++ b/tests/run-macros/i4803c/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object PowerMacro { def powerCode(x: Expr[Double], n: Expr[Long]) (using Quotes): Expr[Double] = diff --git a/tests/run-macros/i4947e/Macro_1.scala b/tests/run-macros/i4947e/Macro_1.scala index 13aab8abeab6..0dc9c41f56a9 100644 --- a/tests/run-macros/i4947e/Macro_1.scala +++ b/tests/run-macros/i4947e/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { def printStack(tag: String): Unit = { diff --git a/tests/run-macros/i4947f/Macro_1.scala b/tests/run-macros/i4947f/Macro_1.scala index ea760e2fa67f..6edcab55dafc 100644 --- a/tests/run-macros/i4947f/Macro_1.scala +++ b/tests/run-macros/i4947f/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { def printStack(tag: String): Unit = { diff --git a/tests/run-macros/i4947f/Test_2.scala b/tests/run-macros/i4947f/Test_2.scala index 6a96b58b4d34..86c839416300 100644 --- a/tests/run-macros/i4947f/Test_2.scala +++ b/tests/run-macros/i4947f/Test_2.scala @@ -1,6 +1,6 @@ object Test { - import Macros._ + import Macros.* def main(args: Array[String]): Unit = { val x = 1 diff --git a/tests/run-macros/i5110/quoted_1.scala b/tests/run-macros/i5110/quoted_1.scala index 3648a9f38a38..df4250f089f1 100644 --- a/tests/run-macros/i5110/quoted_1.scala +++ b/tests/run-macros/i5110/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/run-macros/i5110/quoted_2.scala b/tests/run-macros/i5110/quoted_2.scala index ce0adb2639b8..f3a8d3b66eec 100644 --- a/tests/run-macros/i5110/quoted_2.scala +++ b/tests/run-macros/i5110/quoted_2.scala @@ -1,7 +1,7 @@ import scala.util.Try object Test { - import Macro._ + import Macro.* def main(args: Array[String]): Unit = { def bomb = new Bomb diff --git a/tests/run-macros/i5119/Macro_1.scala b/tests/run-macros/i5119/Macro_1.scala index fd2b6c80b6f5..b6e0e1be6bd6 100644 --- a/tests/run-macros/i5119/Macro_1.scala +++ b/tests/run-macros/i5119/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { class StringContextOps(sc: => StringContext) { @@ -6,7 +6,7 @@ object Macro { } implicit inline def XmlQuote(inline sc: StringContext): StringContextOps = new StringContextOps(sc) def impl(sc: Expr[StringContext], args: Expr[Seq[Any]])(using q: Quotes) : Expr[String] = { - import q.reflect._ + import q.reflect.* given Printer[Tree] = Printer.TreeStructure Expr(sc.asTerm.underlyingArgument.show + "\n" + args.asTerm.underlyingArgument.show) } diff --git a/tests/run-macros/i5119/Main_2.scala b/tests/run-macros/i5119/Main_2.scala index 9242dcabc5b1..29ab61481a94 100644 --- a/tests/run-macros/i5119/Main_2.scala +++ b/tests/run-macros/i5119/Main_2.scala @@ -1,6 +1,6 @@ object Test { - import Macro._ + import Macro.* def main(args: Array[String]): Unit = { println(ff"Hello World ${1}!") diff --git a/tests/run-macros/i5119b/Macro_1.scala b/tests/run-macros/i5119b/Macro_1.scala index fb22b0a04e0f..34b18505225a 100644 --- a/tests/run-macros/i5119b/Macro_1.scala +++ b/tests/run-macros/i5119b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { @@ -6,7 +6,7 @@ object Macro { inline def ff(arg1: Any, arg2: Any): String = ${ Macro.impl('{arg1}, '{arg2}) } def impl(arg1: Expr[Any], arg2: Expr[Any])(using q: Quotes) : Expr[String] = - import q.reflect._ + import q.reflect.* given Printer[Tree] = Printer.TreeStructure Expr(arg1.asTerm.underlyingArgument.show + "\n" + arg2.asTerm.underlyingArgument.show) diff --git a/tests/run-macros/i5119b/Main_2.scala b/tests/run-macros/i5119b/Main_2.scala index e6a797d97dca..0003d025cc70 100644 --- a/tests/run-macros/i5119b/Main_2.scala +++ b/tests/run-macros/i5119b/Main_2.scala @@ -1,6 +1,6 @@ object Test { - import Macro._ + import Macro.* def main(args: Array[String]): Unit = { println(ff(arg1 = foo(1), arg2 = foo(2))) diff --git a/tests/run-macros/i5188a/Macro_1.scala b/tests/run-macros/i5188a/Macro_1.scala index 58a51d476312..252f5245c9ea 100644 --- a/tests/run-macros/i5188a/Macro_1.scala +++ b/tests/run-macros/i5188a/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Lib { inline def sum(inline args: Int*): Int = ${ impl('args) } diff --git a/tests/run-macros/i5533/Macro_1.scala b/tests/run-macros/i5533/Macro_1.scala index 701982a9c7a1..7f5ba35e3fe7 100644 --- a/tests/run-macros/i5533/Macro_1.scala +++ b/tests/run-macros/i5533/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { @@ -8,7 +8,7 @@ object scalatest { inline def assert(condition: => Boolean): Unit = ${assertImpl('condition)} def assertImpl(condition: Expr[Boolean])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val tree = condition.asTerm diff --git a/tests/run-macros/i5533/Test_2.scala b/tests/run-macros/i5533/Test_2.scala index e982bb0fa7e9..708bbb1e04db 100644 --- a/tests/run-macros/i5533/Test_2.scala +++ b/tests/run-macros/i5533/Test_2.scala @@ -1,7 +1,7 @@ object Test { def main(args: Array[String]): Unit = { - import scalatest._ + import scalatest.* val x = "String" assert(f("abc")) } diff --git a/tests/run-macros/i5533b/Macro_1.scala b/tests/run-macros/i5533b/Macro_1.scala index bd172b4edbf3..74b136bf4fb2 100644 --- a/tests/run-macros/i5533b/Macro_1.scala +++ b/tests/run-macros/i5533b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { def f(x: Int): Int = x @@ -7,7 +7,7 @@ object scalatest { inline def assert(condition: => Boolean): Unit = ${assertImpl('condition)} def assertImpl(condition: Expr[Boolean])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val tree = condition.asTerm def exprStr: String = condition.show diff --git a/tests/run-macros/i5533b/Test_2.scala b/tests/run-macros/i5533b/Test_2.scala index 3d07d155ad23..feb1ed10ca53 100644 --- a/tests/run-macros/i5533b/Test_2.scala +++ b/tests/run-macros/i5533b/Test_2.scala @@ -1,7 +1,7 @@ object Test { def main(args: Array[String]): Unit = { - import scalatest._ + import scalatest.* val x = "String" println(assert(f(x) == "String")) } diff --git a/tests/run-macros/i5536/Macro_1.scala b/tests/run-macros/i5536/Macro_1.scala index bd0cc2402077..6e99c118e9bf 100644 --- a/tests/run-macros/i5536/Macro_1.scala +++ b/tests/run-macros/i5536/Macro_1.scala @@ -1,10 +1,10 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert(condition: => Boolean): Unit = ${assertImpl('condition)} def assertImpl(condition: Expr[Boolean])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val tree = condition.asTerm def exprStr: String = condition.show diff --git a/tests/run-macros/i5536/Test_2.scala b/tests/run-macros/i5536/Test_2.scala index 671ff6044f28..02910e9af71c 100644 --- a/tests/run-macros/i5536/Test_2.scala +++ b/tests/run-macros/i5536/Test_2.scala @@ -9,8 +9,8 @@ object Equality { object Test { - import scalatest._ - import Equality._ + import scalatest.* + import Equality.* def main(args: Array[String]): Unit = { val x = "String" diff --git a/tests/run-macros/i5629/Macro_1.scala b/tests/run-macros/i5629/Macro_1.scala index 641f276b7da0..16a80623396b 100644 --- a/tests/run-macros/i5629/Macro_1.scala +++ b/tests/run-macros/i5629/Macro_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def assert(condition: => Boolean): Unit = ${ assertImpl('{condition}, '{""}) } def assertImpl(cond: Expr[Boolean], clue: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val b = cond.asTerm.underlyingArgument.asExprOf[Boolean] '{ scala.Predef.assert($b) } } @@ -13,7 +13,7 @@ object Macros { inline def thisLineNumber = ${ thisLineNumberImpl } def thisLineNumberImpl(using Quotes) : Expr[Int] = { - import quotes.reflect._ + import quotes.reflect.* Expr(Position.ofMacroExpansion.startLine) } } diff --git a/tests/run-macros/i5629/Test_2.scala b/tests/run-macros/i5629/Test_2.scala index 329f3be6aee7..f098f61790a2 100644 --- a/tests/run-macros/i5629/Test_2.scala +++ b/tests/run-macros/i5629/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import Macros._ + import Macros.* def main(args: Array[String]): Unit = { val startLine = thisLineNumber diff --git a/tests/run-macros/i5715/Macro_1.scala b/tests/run-macros/i5715/Macro_1.scala index e0d476d5eb16..5f4e1ecca452 100644 --- a/tests/run-macros/i5715/Macro_1.scala +++ b/tests/run-macros/i5715/Macro_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert(condition: => Boolean): Unit = ${ assertImpl('condition, '{""}) } def assertImpl(cond: Expr[Boolean], clue: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* cond.asTerm.underlyingArgument match { case app @ Apply(select @ Select(lhs, op), rhs :: Nil) => diff --git a/tests/run-macros/i5715/Test_2.scala b/tests/run-macros/i5715/Test_2.scala index 19a116cf3f85..1754cb626999 100644 --- a/tests/run-macros/i5715/Test_2.scala +++ b/tests/run-macros/i5715/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import scalatest._ + import scalatest.* def main(args: Array[String]): Unit = { val l = List(3, 4) diff --git a/tests/run-macros/i5941/macro_1.scala b/tests/run-macros/i5941/macro_1.scala index 13b8e62c1116..154399d63c45 100644 --- a/tests/run-macros/i5941/macro_1.scala +++ b/tests/run-macros/i5941/macro_1.scala @@ -3,7 +3,7 @@ trait Lens[S, T] { def set(t: T, s: S) :S } -import scala.quoted._ +import scala.quoted.* object Lens { def apply[S, T](_get: S => T)(_set: T => S => S): Lens[S, T] = new Lens { @@ -12,8 +12,8 @@ object Lens { } def impl[S: Type, T: Type](getter: Expr[S => T])(using Quotes) : Expr[Lens[S, T]] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* // obj.copy(a = obj.a.copy(b = a.b.copy(c = v))) def setterBody(obj: Term, value: Term, parts: List[String]): Term = { @@ -85,8 +85,8 @@ object Iso { } def impl[S: Type, A: Type](using Quotes) : Expr[Iso[S, A]] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* val tpS = TypeRepr.of[S] val tpA = TypeRepr.of[A] @@ -124,8 +124,8 @@ object Iso { } def implUnit[S: Type](using Quotes) : Expr[Iso[S, 1]] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* val tpS = TypeRepr.of[S] @@ -196,8 +196,8 @@ object Prism { } def impl[S: Type, A <: S : Type](using Quotes) : Expr[Prism[S, A]] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* '{ val get = (p: S) => if (p.isInstanceOf[A]) Some(p.asInstanceOf[A]) else None diff --git a/tests/run-macros/i6171/Macro_1.scala b/tests/run-macros/i6171/Macro_1.scala index f34e1df8aca0..9fa8251fd71a 100644 --- a/tests/run-macros/i6171/Macro_1.scala +++ b/tests/run-macros/i6171/Macro_1.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert(condition: => Boolean): Unit = ${ assertImpl('condition, '{""}) } def assertImpl(cond: Expr[Boolean], clue: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* def isImplicitMethodType(tp: TypeRepr): Boolean = tp match case tp: MethodType => tp.isImplicit diff --git a/tests/run-macros/i6171/Test_2.scala b/tests/run-macros/i6171/Test_2.scala index 2e776cd4e1c7..7353506c637c 100644 --- a/tests/run-macros/i6171/Test_2.scala +++ b/tests/run-macros/i6171/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import scalatest._ + import scalatest.* def main(args: Array[String]): Unit = { assert(new Some(5).get == 5L) diff --git a/tests/run-macros/i6201/macro_1.scala b/tests/run-macros/i6201/macro_1.scala index 9dd1bc6a9fe9..2b87f431f3d9 100644 --- a/tests/run-macros/i6201/macro_1.scala +++ b/tests/run-macros/i6201/macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* extension (inline x: String) inline def strip: String = ${ stripImpl('x) } diff --git a/tests/run-macros/i6253-b/quoted_1.scala b/tests/run-macros/i6253-b/quoted_1.scala index 8e01b3f719db..ddfc75aeb7e5 100644 --- a/tests/run-macros/i6253-b/quoted_1.scala +++ b/tests/run-macros/i6253-b/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/run-macros/i6253-b/quoted_2.scala b/tests/run-macros/i6253-b/quoted_2.scala index 2a85eca35e41..72719a78c466 100644 --- a/tests/run-macros/i6253-b/quoted_2.scala +++ b/tests/run-macros/i6253-b/quoted_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/i6253-c/quoted_1.scala b/tests/run-macros/i6253-c/quoted_1.scala index 39281b9cd79c..1708aff5d68b 100644 --- a/tests/run-macros/i6253-c/quoted_1.scala +++ b/tests/run-macros/i6253-c/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/run-macros/i6253-c/quoted_2.scala b/tests/run-macros/i6253-c/quoted_2.scala index 2a85eca35e41..72719a78c466 100644 --- a/tests/run-macros/i6253-c/quoted_2.scala +++ b/tests/run-macros/i6253-c/quoted_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/i6253/quoted_1.scala b/tests/run-macros/i6253/quoted_1.scala index 2e05cc17f625..fd8a9bdeb2f0 100644 --- a/tests/run-macros/i6253/quoted_1.scala +++ b/tests/run-macros/i6253/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/run-macros/i6253/quoted_2.scala b/tests/run-macros/i6253/quoted_2.scala index 2a85eca35e41..72719a78c466 100644 --- a/tests/run-macros/i6253/quoted_2.scala +++ b/tests/run-macros/i6253/quoted_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/i6270/Macro_1.scala b/tests/run-macros/i6270/Macro_1.scala index d50beaaebc65..e073ee073e01 100644 --- a/tests/run-macros/i6270/Macro_1.scala +++ b/tests/run-macros/i6270/Macro_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object api { extension (inline x: String) inline def reflect : String = ${ reflImpl('x) } private def reflImpl(x: Expr[String])(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* Expr(x.show) } @@ -13,7 +13,7 @@ object api { ${ reflImplColor('x) } private def reflImplColor(x: Expr[String])(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* Expr(x.asTerm.show(using Printer.TreeAnsiCode)) } } diff --git a/tests/run-macros/i6270/Test_2.scala b/tests/run-macros/i6270/Test_2.scala index a1b398712cd2..c57d96b4ef33 100644 --- a/tests/run-macros/i6270/Test_2.scala +++ b/tests/run-macros/i6270/Test_2.scala @@ -1,4 +1,4 @@ -import api._ +import api.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/i6518/Macro_1.scala b/tests/run-macros/i6518/Macro_1.scala index 0185b311d332..471cfb9d1986 100644 --- a/tests/run-macros/i6518/Macro_1.scala +++ b/tests/run-macros/i6518/Macro_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def test(): String = ${ testImpl } private def testImpl(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* val classSym = TypeRepr.of[Function1].classSymbol.get classSym.declaredMethod("apply") classSym.declaredMethods diff --git a/tests/run-macros/i6622.scala b/tests/run-macros/i6622.scala index e883a212bf2f..eb11d150662c 100644 --- a/tests/run-macros/i6622.scala +++ b/tests/run-macros/i6622.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* object Test { diff --git a/tests/run-macros/i6679/Macro_1.scala b/tests/run-macros/i6679/Macro_1.scala index 663b23f7e7cd..50788d7bb7eb 100644 --- a/tests/run-macros/i6679/Macro_1.scala +++ b/tests/run-macros/i6679/Macro_1.scala @@ -1,7 +1,7 @@ -import scala.quoted._ +import scala.quoted.* def makeMatch[A: Type](head : Expr[A])(using qctx : Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val sacrifice = '{ $head match { case _ => ??? } } sacrifice.asTerm diff --git a/tests/run-macros/i6679/Test_2.scala b/tests/run-macros/i6679/Test_2.scala index 89e8042dbbbf..e2eab5d1a716 100644 --- a/tests/run-macros/i6679/Test_2.scala +++ b/tests/run-macros/i6679/Test_2.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Test { diff --git a/tests/run-macros/i6765-b/Macro_1.scala b/tests/run-macros/i6765-b/Macro_1.scala index 1beb85e13495..5e96fefca74b 100644 --- a/tests/run-macros/i6765-b/Macro_1.scala +++ b/tests/run-macros/i6765-b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def foo = ${fooImpl} diff --git a/tests/run-macros/i6765-c/Macro_1.scala b/tests/run-macros/i6765-c/Macro_1.scala index d8f3d3baf7bb..c3401a7f53da 100644 --- a/tests/run-macros/i6765-c/Macro_1.scala +++ b/tests/run-macros/i6765-c/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def foo(inline n: Int) = ${fooImpl('n)} diff --git a/tests/run-macros/i6765/Macro_1.scala b/tests/run-macros/i6765/Macro_1.scala index 15a8a1714772..13220473af90 100644 --- a/tests/run-macros/i6765/Macro_1.scala +++ b/tests/run-macros/i6765/Macro_1.scala @@ -1,9 +1,9 @@ -import scala.quoted._ +import scala.quoted.* inline def foo = ${fooImpl} def fooImpl(using Quotes) = { - import quotes.reflect._ + import quotes.reflect.* val res = Expr.ofList(List('{"One"})) Expr(res.show) } diff --git a/tests/run-macros/i6772/Macro_1.scala b/tests/run-macros/i6772/Macro_1.scala index e1bb395dbd77..1bf33e653292 100644 --- a/tests/run-macros/i6772/Macro_1.scala +++ b/tests/run-macros/i6772/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/run-macros/i6772/Test_2.scala b/tests/run-macros/i6772/Test_2.scala index 23805df36462..82587e1a9a02 100644 --- a/tests/run-macros/i6772/Test_2.scala +++ b/tests/run-macros/i6772/Test_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/i6803/Macro_1.scala b/tests/run-macros/i6803/Macro_1.scala index 795dd2fc4538..c09a2846f32b 100644 --- a/tests/run-macros/i6803/Macro_1.scala +++ b/tests/run-macros/i6803/Macro_1.scala @@ -1,7 +1,7 @@ package blah import scala.language.implicitConversions -import scala.quoted._ +import scala.quoted.* object AsObject { final class LineNo(val lineNo: Int) @@ -9,7 +9,7 @@ object AsObject { def unsafe(i: Int): LineNo = new LineNo(i) inline given LineNo = ${impl} private def impl(using Quotes): Expr[LineNo] = { - import quotes.reflect._ + import quotes.reflect.* '{unsafe(${Expr(Position.ofMacroExpansion.startLine)})} } } @@ -21,7 +21,7 @@ package AsPackage { def unsafe(i: Int): LineNo = new LineNo(i) inline given LineNo = ${impl} private def impl(using Quotes): Expr[LineNo] = { - import quotes.reflect._ + import quotes.reflect.* '{unsafe(${Expr(Position.ofMacroExpansion.startLine)})} } } diff --git a/tests/run-macros/i6803/Test_2.scala b/tests/run-macros/i6803/Test_2.scala index 63bc7923cea8..d55acc65364a 100644 --- a/tests/run-macros/i6803/Test_2.scala +++ b/tests/run-macros/i6803/Test_2.scala @@ -1,4 +1,4 @@ -import blah._ +import blah.* def testO(): Unit = { import AsObject.LineNo diff --git a/tests/run-macros/i6988/FirstArg_1.scala b/tests/run-macros/i6988/FirstArg_1.scala index d3f9176456df..85a89b7d0dac 100644 --- a/tests/run-macros/i6988/FirstArg_1.scala +++ b/tests/run-macros/i6988/FirstArg_1.scala @@ -6,10 +6,10 @@ object FirstArg { } object Macros { - import scala.quoted._ + import scala.quoted.* def argsImpl(using Quotes) : Expr[FirstArg] = { - import quotes.reflect._ + import quotes.reflect.* def enclosingClass(cur: Symbol = Symbol.spliceOwner): Symbol = if (cur.isClassDef) cur diff --git a/tests/run-macros/i7008/macro_1.scala b/tests/run-macros/i7008/macro_1.scala index 3fc9235507bc..b6781179c23c 100644 --- a/tests/run-macros/i7008/macro_1.scala +++ b/tests/run-macros/i7008/macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* case class Box[T](v: T) @@ -11,7 +11,7 @@ def mcrProxy(expr: Expr[Boolean])(using Quotes): Expr[Unit] = { } def mcrImpl[T](func: Expr[Seq[Box[T]] => Unit], expr: Expr[T])(using Quotes, Type[T]): Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val arg = Varargs(Seq('{(Box($expr))})) Expr.betaReduce('{$func($arg)}) } diff --git a/tests/run-macros/i7025/Macros_1.scala b/tests/run-macros/i7025/Macros_1.scala index 456902b1a617..8ee30d65d2c8 100644 --- a/tests/run-macros/i7025/Macros_1.scala +++ b/tests/run-macros/i7025/Macros_1.scala @@ -1,10 +1,10 @@ object Macros { - import scala.quoted._ + import scala.quoted.* inline def debug: Unit = ${Macros.debugImpl} def debugImpl(using Quotes): Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* def nearestEnclosingDef(owner: Symbol): Symbol = if owner.isClassDef then owner diff --git a/tests/run-macros/i7025b/Macros_1.scala b/tests/run-macros/i7025b/Macros_1.scala new file mode 100644 index 000000000000..e2207a3ee893 --- /dev/null +++ b/tests/run-macros/i7025b/Macros_1.scala @@ -0,0 +1,21 @@ +inline def debug: Unit = ${Macros.debugImpl} + +object Macros { + import scala.quoted._ + + def debugImpl(using Quotes): Expr[Unit] = { + import quotes.reflect._ + + def nearestEnclosingDef(owner: Symbol): Symbol = + if owner.isDefDef then owner + else if owner.isClassDef then owner + else nearestEnclosingDef(owner.owner) + + val sym = nearestEnclosingDef(Symbol.spliceOwner) + if sym.isDefDef then + val code = sym.signature.toString + '{ println(${Expr(code)}) } + else + '{()} + } +} diff --git a/tests/run-macros/i7025b/Test_2.scala b/tests/run-macros/i7025b/Test_2.scala new file mode 100644 index 000000000000..d59038c17823 --- /dev/null +++ b/tests/run-macros/i7025b/Test_2.scala @@ -0,0 +1,9 @@ +object Test { + def main(args: Array[String]): Unit = { + bar("world", 100, true) + } + + def bar(a1: String, a2: Long, a3: Boolean) = { + debug + } +} diff --git a/tests/run-macros/i7048/Lib_1.scala b/tests/run-macros/i7048/Lib_1.scala index 07c78587073b..3b9fdec5afde 100644 --- a/tests/run-macros/i7048/Lib_1.scala +++ b/tests/run-macros/i7048/Lib_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* trait IsExpr[T] { type Underlying diff --git a/tests/run-macros/i7519c/Macro_1.scala b/tests/run-macros/i7519c/Macro_1.scala index da7f7a2288f6..2d9632f5a44f 100644 --- a/tests/run-macros/i7519c/Macro_1.scala +++ b/tests/run-macros/i7519c/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.annotation.StaticAnnotation class Annot(in: Int) extends StaticAnnotation diff --git a/tests/run-macros/i7715/Macros_1.scala b/tests/run-macros/i7715/Macros_1.scala index b44c6487687a..2aa7e2e947c7 100644 --- a/tests/run-macros/i7715/Macros_1.scala +++ b/tests/run-macros/i7715/Macros_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def mcr(e: => Any): Any = ${mcrImpl('e)} def mcrImpl(e: Expr[Any])(using ctx: Quotes): Expr[Any] = diff --git a/tests/run-macros/i7716/Macro_1.scala b/tests/run-macros/i7716/Macro_1.scala index 01f4e5184a12..9bb5e7035584 100644 --- a/tests/run-macros/i7716/Macro_1.scala +++ b/tests/run-macros/i7716/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* trait Foo: def mcrImpl1(e: Expr[Any])(using ctx: Quotes): Expr[Any] = @@ -9,7 +9,7 @@ object Foo extends Foo: '{println(s"Hello ${$e}")} object Bar: - import Foo._ + import Foo.* inline def mcr1(e: => Any) = ${mcrImpl1('e)} inline def mcr2(e: => Any) = ${Foo.mcrImpl1('e)} diff --git a/tests/run-macros/i7887/Macro_1.scala b/tests/run-macros/i7887/Macro_1.scala index dc867bc512cd..9ba02c41ab23 100644 --- a/tests/run-macros/i7887/Macro_1.scala +++ b/tests/run-macros/i7887/Macro_1.scala @@ -1,5 +1,5 @@ def myMacroImpl(a: quoted.Expr[_])(using qctx: quoted.Quotes) = { - import scala.quoted.quotes.reflect._ + import scala.quoted.quotes.reflect.* def typed[A] = { implicit val t: quoted.Type[A] = a.asTerm.tpe.widen.asType.asInstanceOf[quoted.Type[A]] '{ diff --git a/tests/run-macros/i7898/Macro_1.scala b/tests/run-macros/i7898/Macro_1.scala index 8ac47bb1e1bd..9a87787b895e 100644 --- a/tests/run-macros/i7898/Macro_1.scala +++ b/tests/run-macros/i7898/Macro_1.scala @@ -1,9 +1,9 @@ -import scala.quoted._ +import scala.quoted.* object Main { def myMacroImpl(body: Expr[_])(using Quotes) : Expr[_] = { - import quotes.reflect._ + import quotes.reflect.* val bodyTerm = underlyingArgument(body).asTerm val showed = bodyTerm.show '{ @@ -17,6 +17,6 @@ object Main { } def underlyingArgument[T](expr: Expr[T])(using Quotes): Expr[T] = - import quotes.reflect._ + import quotes.reflect.* expr.asTerm.underlyingArgument.asExpr.asInstanceOf[Expr[T]] } diff --git a/tests/run-macros/i7964/Macro_1.scala b/tests/run-macros/i7964/Macro_1.scala index c2054c4372b6..d7923d197762 100644 --- a/tests/run-macros/i7964/Macro_1.scala +++ b/tests/run-macros/i7964/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* enum Num { // TODO derive a quoted.FromExpr case One diff --git a/tests/run-macros/i7987/Macros_1.scala b/tests/run-macros/i7987/Macros_1.scala index ecb136b23d49..e11dd698208e 100644 --- a/tests/run-macros/i7987/Macros_1.scala +++ b/tests/run-macros/i7987/Macros_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.deriving._ +import scala.quoted.* +import scala.deriving.* object Macros { diff --git a/tests/run-macros/i8007/Macro_1.scala b/tests/run-macros/i8007/Macro_1.scala index 56f72417ed86..2949aa68584a 100644 --- a/tests/run-macros/i8007/Macro_1.scala +++ b/tests/run-macros/i8007/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.deriving._ -import scala.quoted._ +import scala.deriving.* +import scala.quoted.* object Macro1 { @@ -17,7 +17,7 @@ object Macro1 { ${ test1Impl('value) } def test1Impl[T: Type](value: Expr[T])(using Quotes): Expr[List[String]] = { - import quotes.reflect._ + import quotes.reflect.* val mirrorTpe = Type.of[Mirror.Of[T]] diff --git a/tests/run-macros/i8007/Macro_2.scala b/tests/run-macros/i8007/Macro_2.scala index 4e38c86fd4b0..eb8e2ad6bebd 100644 --- a/tests/run-macros/i8007/Macro_2.scala +++ b/tests/run-macros/i8007/Macro_2.scala @@ -1,5 +1,5 @@ -import scala.deriving._ -import scala.quoted._ +import scala.deriving.* +import scala.quoted.* object Macro2 { @@ -21,7 +21,7 @@ object Macro2 { } def derived[T: Type](ev: Expr[Mirror.Of[T]])(using Quotes): Expr[JsonEncoder[T]] = { - import quotes.reflect._ + import quotes.reflect.* val fields = ev match { case '{ $m: Mirror.ProductOf[T] { type MirroredElemLabels = labels } } => @@ -43,7 +43,7 @@ object Macro2 { inline def test2[T](value: =>T): Unit = ${ test2Impl('value) } def test2Impl[T: Type](value: Expr[T])(using Quotes): Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val mirrorTpe = Type.of[Mirror.Of[T]] val mirrorExpr = Expr.summon(using mirrorTpe).get diff --git a/tests/run-macros/i8007/Macro_3.scala b/tests/run-macros/i8007/Macro_3.scala index 6848627da138..8a11dccb9a20 100644 --- a/tests/run-macros/i8007/Macro_3.scala +++ b/tests/run-macros/i8007/Macro_3.scala @@ -1,5 +1,5 @@ -import scala.deriving._ -import scala.quoted._ +import scala.deriving.* +import scala.quoted.* trait Eq[T] { @@ -33,7 +33,7 @@ object Eq { } given derived[T: Type](using q: Quotes): Expr[Eq[T]] = { - import quotes.reflect._ + import quotes.reflect.* val ev: Expr[Mirror.Of[T]] = Expr.summon(using Type.of[Mirror.Of[T]]).get diff --git a/tests/run-macros/i8007/Test_4.scala b/tests/run-macros/i8007/Test_4.scala index 742a1c6e3dea..de314d15df15 100644 --- a/tests/run-macros/i8007/Test_4.scala +++ b/tests/run-macros/i8007/Test_4.scala @@ -1,6 +1,6 @@ -import Macro1._ -import Macro2._ -import Macro3._ +import Macro1.* +import Macro2.* +import Macro3.* import Macro3.eqGen case class Person(name: String, age: Int) @@ -16,8 +16,8 @@ enum OptInv[+T] { } @main def Test() = { - import Opt._ - import Eq.{given, _} + import Opt.* + import Eq.{given, *} val t1 = test1(Person("Test", 23)) println(t1) diff --git a/tests/run-macros/i8115/Macro_2.scala b/tests/run-macros/i8115/Macro_2.scala index a8c4e0edb4b0..fe7aef1dde0f 100644 --- a/tests/run-macros/i8115/Macro_2.scala +++ b/tests/run-macros/i8115/Macro_2.scala @@ -1,6 +1,6 @@ package example -import scala.quoted._ +import scala.quoted.* object MyClassMaker { inline def make: MyClass = ${ makeImpl } diff --git a/tests/run-macros/i8115b/Macro_2.scala b/tests/run-macros/i8115b/Macro_2.scala index 23c546e7f47f..2d8a9901671f 100644 --- a/tests/run-macros/i8115b/Macro_2.scala +++ b/tests/run-macros/i8115b/Macro_2.scala @@ -1,6 +1,6 @@ package example -import scala.quoted._ +import scala.quoted.* object MyClassMaker { inline def make: MyClass = ${ makeImpl } diff --git a/tests/run-macros/i8306.scala b/tests/run-macros/i8306.scala index dbb9d6870f08..77431e13ee7f 100644 --- a/tests/run-macros/i8306.scala +++ b/tests/run-macros/i8306.scala @@ -1,4 +1,4 @@ -import scala.compiletime._ +import scala.compiletime.* case class A(i: Int) case class B(a: A) diff --git a/tests/run-macros/i8514/Macro_1.scala b/tests/run-macros/i8514/Macro_1.scala index b70c107026f3..cf2476ca659b 100644 --- a/tests/run-macros/i8514/Macro_1.scala +++ b/tests/run-macros/i8514/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class A class B extends A @@ -7,7 +7,7 @@ class C extends B inline def test(): Unit = ${ testExpr } def testExpr(using Quotes): Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* '{ println(${Expr(TypeRepr.of[Object].baseClasses.toString)}) diff --git a/tests/run-macros/i8514b/Macro_1.scala b/tests/run-macros/i8514b/Macro_1.scala index ffa2a67f3ec9..c7a43b5fb891 100644 --- a/tests/run-macros/i8514b/Macro_1.scala +++ b/tests/run-macros/i8514b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class A[+X[_], -Y] class P[T] @@ -7,7 +7,7 @@ class B extends A[P, String] inline def test(): Unit = ${ testExpr } def testExpr(using Quotes): Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val t = TypeRepr.of[B] val baseTypes = t.baseClasses.map(b => t.baseType(b)) diff --git a/tests/run-macros/i8520/Macro_1.scala b/tests/run-macros/i8520/Macro_1.scala index 67bf962e69f9..e582bc95cc52 100644 --- a/tests/run-macros/i8520/Macro_1.scala +++ b/tests/run-macros/i8520/Macro_1.scala @@ -1,9 +1,9 @@ -import scala.quoted._ +import scala.quoted.* inline def test[T[_]]: Unit = ${ testExpr[T] } def testExpr[T[_]: Type](using Quotes): Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* def variance(f: Flags) = if f.is(Flags.Covariant) then "+" else if f.is(Flags.Contravariant) then "-" diff --git a/tests/run-macros/i8530/Macro_1.scala b/tests/run-macros/i8530/Macro_1.scala index dc431c14ef14..0c15284141cb 100644 --- a/tests/run-macros/i8530/Macro_1.scala +++ b/tests/run-macros/i8530/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Succ: diff --git a/tests/run-macros/i8671/Macro_1.scala b/tests/run-macros/i8671/Macro_1.scala index 21adda3e15e8..c00d901a66e3 100644 --- a/tests/run-macros/i8671/Macro_1.scala +++ b/tests/run-macros/i8671/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* case class FileName private(name: String) diff --git a/tests/run-macros/i8671/Test_2.scala b/tests/run-macros/i8671/Test_2.scala index e2fc4f0416b2..7d0b62715288 100644 --- a/tests/run-macros/i8671/Test_2.scala +++ b/tests/run-macros/i8671/Test_2.scala @@ -1,4 +1,4 @@ -import FileName._ +import FileName.* @main def Test = { val fileName1: FileName = ToFileName("fileName1") diff --git a/tests/run-macros/i8745/Macro_1.scala b/tests/run-macros/i8745/Macro_1.scala index 23a44412789b..47325d7fb633 100644 --- a/tests/run-macros/i8745/Macro_1.scala +++ b/tests/run-macros/i8745/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Companion extends Trait trait Trait { diff --git a/tests/run-macros/i8745/Test_2.scala b/tests/run-macros/i8745/Test_2.scala index 6d6770c14338..b3a09ddfb3ff 100644 --- a/tests/run-macros/i8745/Test_2.scala +++ b/tests/run-macros/i8745/Test_2.scala @@ -1,6 +1,6 @@ -import Macro._ +import Macro.* @main def Test() = { //hello - import Companion._ + import Companion.* mac(fun("blah")) } diff --git a/tests/run-macros/i8745b/Macro_1.scala b/tests/run-macros/i8745b/Macro_1.scala index bebb6cf6c382..d51623aa565a 100644 --- a/tests/run-macros/i8745b/Macro_1.scala +++ b/tests/run-macros/i8745b/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Companion { def fun(first: String): String = "anything" diff --git a/tests/run-macros/i8745b/Test_2.scala b/tests/run-macros/i8745b/Test_2.scala index 6d6770c14338..b3a09ddfb3ff 100644 --- a/tests/run-macros/i8745b/Test_2.scala +++ b/tests/run-macros/i8745b/Test_2.scala @@ -1,6 +1,6 @@ -import Macro._ +import Macro.* @main def Test() = { //hello - import Companion._ + import Companion.* mac(fun("blah")) } diff --git a/tests/run-macros/i8746/Macro_1.scala b/tests/run-macros/i8746/Macro_1.scala index e8f8143b1f23..8ba4beda0d68 100644 --- a/tests/run-macros/i8746/Macro_1.scala +++ b/tests/run-macros/i8746/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def mac(): String = ${ macImpl() } diff --git a/tests/run-macros/i8746/Test_2.scala b/tests/run-macros/i8746/Test_2.scala index 9a3dce5970d0..a9c647cfc95c 100644 --- a/tests/run-macros/i8746/Test_2.scala +++ b/tests/run-macros/i8746/Test_2.scala @@ -1,4 +1,4 @@ -import Macro._ +import Macro.* @main def Test() = { // hello mac() diff --git a/tests/run-macros/i8746b/Macro_1.scala b/tests/run-macros/i8746b/Macro_1.scala index 8110716fa795..face5605e544 100644 --- a/tests/run-macros/i8746b/Macro_1.scala +++ b/tests/run-macros/i8746b/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def mac(inline tree: Any): String = ${ macImpl('tree) } diff --git a/tests/run-macros/i8746b/Test_2.scala b/tests/run-macros/i8746b/Test_2.scala index 251549d10349..15616dbd0527 100644 --- a/tests/run-macros/i8746b/Test_2.scala +++ b/tests/run-macros/i8746b/Test_2.scala @@ -1,6 +1,6 @@ -import Macro._ +import Macro.* -import Macro._ +import Macro.* @main def Test() = { //hello mac((x: String) => "anything") diff --git a/tests/run-macros/i8877/Macros_1.scala b/tests/run-macros/i8877/Macros_1.scala new file mode 100644 index 000000000000..92eb01938455 --- /dev/null +++ b/tests/run-macros/i8877/Macros_1.scala @@ -0,0 +1,20 @@ +//macros +import scala.quoted._ + +object Macros { + //a specialization of the `findOwner` function from `sourcecode` for our purposes + private def firstNonSyntheticOwner(using Quotes)(s: quotes.reflect.Symbol): quotes.reflect.Symbol = { + import quotes.reflect._ + if (s.flags.is(Flags.Synthetic)) firstNonSyntheticOwner(s.owner) + else s + } + + def genOwnerImpl()(using Quotes): Expr[String] = { + import quotes.reflect._ + Expr(firstNonSyntheticOwner(Symbol.spliceOwner).name) + } +} + +object Foo { + inline def genOwner: String = ${ Macros.genOwnerImpl() } +} diff --git a/tests/run-macros/i8877/Test_2.scala b/tests/run-macros/i8877/Test_2.scala new file mode 100644 index 000000000000..032efb5f0e6c --- /dev/null +++ b/tests/run-macros/i8877/Test_2.scala @@ -0,0 +1,5 @@ + +// main +@main def Test = { + println(Foo.genOwner) +} \ No newline at end of file diff --git a/tests/run-macros/i9206/Macros_1.scala b/tests/run-macros/i9206/Macros_1.scala index 83692c4960b8..14ed1539eb5d 100644 --- a/tests/run-macros/i9206/Macros_1.scala +++ b/tests/run-macros/i9206/Macros_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Inspect { inline def inspect[T <: AnyKind]: String = ${ inspectTpe[T] } diff --git a/tests/run-macros/i9206/Test_2.scala b/tests/run-macros/i9206/Test_2.scala index 425fa232e9ee..c9e0c2794022 100644 --- a/tests/run-macros/i9206/Test_2.scala +++ b/tests/run-macros/i9206/Test_2.scala @@ -1,4 +1,4 @@ -import Inspect._ +import Inspect.* object Test extends App { inspect[scala.collection.immutable.List[Int]] diff --git a/tests/run-macros/i9475/Macro_1.scala b/tests/run-macros/i9475/Macro_1.scala index a9092e6c6ee9..59379097ff49 100644 --- a/tests/run-macros/i9475/Macro_1.scala +++ b/tests/run-macros/i9475/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Exp { diff --git a/tests/run-macros/i9570/Macro_1.scala b/tests/run-macros/i9570/Macro_1.scala index c8a9aa196713..b02ce6fb645b 100644 --- a/tests/run-macros/i9570/Macro_1.scala +++ b/tests/run-macros/i9570/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -8,7 +8,7 @@ object Macros { case object HNil extends HList private def sizeImpl(e: Expr[HList], n:Int)(using qctx:Quotes): Expr[Int] = { - import quotes.reflect._ + import quotes.reflect.* e match { case '{HCons($_,$t)} => //case '{HCons($a,$t)} => diff --git a/tests/run-macros/i9570/Test_2.scala b/tests/run-macros/i9570/Test_2.scala index e8ddad50d187..5f53d619e2c5 100644 --- a/tests/run-macros/i9570/Test_2.scala +++ b/tests/run-macros/i9570/Test_2.scala @@ -1,7 +1,7 @@ object Test { def main(args: Array[String]): Unit = { - import Macros.HList._ + import Macros.HList.* val hl0n = size( HCons(("1",1), HCons(("2",2), HCons(("3",3),HNil))) ) println(s"size(?) = $hl0n") diff --git a/tests/run-macros/i9812b/Macro_1.scala b/tests/run-macros/i9812b/Macro_1.scala index ed1873195323..75cd0b5c19a8 100644 --- a/tests/run-macros/i9812b/Macro_1.scala +++ b/tests/run-macros/i9812b/Macro_1.scala @@ -1,5 +1,5 @@ -import quoted._ -import SomeEnum._ +import quoted.* +import SomeEnum.* trait Liftable[T] { /** Lift a value into an expression containing the construction of that value */ @@ -28,7 +28,7 @@ case object NIL extends Lst[Nothing] given IntLiftable[T <: Int]: Liftable[T] with def toExpr(x: T): Quotes ?=> Expr[T] = qctx ?=> { - import quotes.reflect._ + import quotes.reflect.* Literal(IntConstant(x)).asExpr.asInstanceOf[Expr[T]] } diff --git a/tests/run-macros/inferred-repeated-result/test_1.scala b/tests/run-macros/inferred-repeated-result/test_1.scala index c3e7d0a2ac5b..4e9291453c9a 100644 --- a/tests/run-macros/inferred-repeated-result/test_1.scala +++ b/tests/run-macros/inferred-repeated-result/test_1.scala @@ -1,9 +1,9 @@ object Macros { - import scala.quoted._ + import scala.quoted.* inline def go[T](inline t: T) = ${ impl('t) } def impl[T](expr: Expr[T])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val tree = expr.asTerm diff --git a/tests/run-macros/inline-case-objects/Macro_1.scala b/tests/run-macros/inline-case-objects/Macro_1.scala index 3839dfdd870a..d48a6cf9b2e0 100644 --- a/tests/run-macros/inline-case-objects/Macro_1.scala +++ b/tests/run-macros/inline-case-objects/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Macros { def impl(expr: Expr[Any]) (using Quotes): Expr[String] = diff --git a/tests/run-macros/inline-macro-inner-object/Macro_1.scala b/tests/run-macros/inline-macro-inner-object/Macro_1.scala index 132667b298ca..ef9c9fb537f0 100644 --- a/tests/run-macros/inline-macro-inner-object/Macro_1.scala +++ b/tests/run-macros/inline-macro-inner-object/Macro_1.scala @@ -1,6 +1,6 @@ package blah -import scala.quoted._ +import scala.quoted.* object A { inline def f: Unit = ${impl} diff --git a/tests/run-macros/inline-macro-inner-object/Test_2.scala b/tests/run-macros/inline-macro-inner-object/Test_2.scala index 6f078264f0f0..8209c8f045cc 100644 --- a/tests/run-macros/inline-macro-inner-object/Test_2.scala +++ b/tests/run-macros/inline-macro-inner-object/Test_2.scala @@ -1,4 +1,4 @@ -import blah._ +import blah.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala b/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala index 48f71e9f45f1..d8cf1c788851 100644 --- a/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala +++ b/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object E { diff --git a/tests/run-macros/inline-option/Macro_1.scala b/tests/run-macros/inline-option/Macro_1.scala index 4656859286ac..4021658bc17a 100644 --- a/tests/run-macros/inline-option/Macro_1.scala +++ b/tests/run-macros/inline-option/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/run-macros/inline-tuples-1/Macro_1.scala b/tests/run-macros/inline-tuples-1/Macro_1.scala index 76ba8fcb0dc0..031fb01cabe4 100644 --- a/tests/run-macros/inline-tuples-1/Macro_1.scala +++ b/tests/run-macros/inline-tuples-1/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Macros { def tup1(tup: Expr[Tuple1[Int]]) (using Quotes): Expr[Int] = Expr(tup.valueOrError.productIterator.map(_.asInstanceOf[Int]).sum) diff --git a/tests/run-macros/inline-tuples-2/Macro_1.scala b/tests/run-macros/inline-tuples-2/Macro_1.scala index 6cbd8d929df4..7027a1f2680a 100644 --- a/tests/run-macros/inline-tuples-2/Macro_1.scala +++ b/tests/run-macros/inline-tuples-2/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/run-macros/inline-varargs-1/Macro_1.scala b/tests/run-macros/inline-varargs-1/Macro_1.scala index 3dcd8b211931..ed58d1479059 100644 --- a/tests/run-macros/inline-varargs-1/Macro_1.scala +++ b/tests/run-macros/inline-varargs-1/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Macros { def sum(nums: Expr[Int]*) (using Quotes): Expr[Int] = Expr(nums.map(_.valueOrError).sum) diff --git a/tests/run-macros/is-in-typer/Macro_1.scala b/tests/run-macros/is-in-typer/Macro_1.scala new file mode 100644 index 000000000000..80157dec0845 --- /dev/null +++ b/tests/run-macros/is-in-typer/Macro_1.scala @@ -0,0 +1,9 @@ +import scala.quoted._ + +inline def isWhileTyping: Boolean = ${ whileTypeing } + +transparent inline def isWhileTypingTransparent: Boolean = ${ whileTypeing } + +private def whileTypeing(using Quotes): Expr[Boolean] = + import quotes.reflect._ + Expr(CompilationInfo.isWhileTyping) diff --git a/tests/run-macros/is-in-typer/Test_2.scala b/tests/run-macros/is-in-typer/Test_2.scala new file mode 100644 index 000000000000..5bd283c4aca4 --- /dev/null +++ b/tests/run-macros/is-in-typer/Test_2.scala @@ -0,0 +1,20 @@ + +@main def Test = + assert(!isWhileTyping) + assert(isWhileTypingTransparent) + assert(f1 == "afterTyper") + assert(f2 == "afterTyper") + assert(f3 == "inTyper") + assert(f4 == "inTyper") + +inline def f1 = + inline if isWhileTyping then "inTyper" else "afterTyper" + +inline def f2 = + inline if isWhileTypingTransparent /*delayed*/ then "inTyper" else "afterTyper" + +transparent inline def f3 = + inline if isWhileTyping /*forced*/ then "inTyper" else "afterTyper" + +transparent inline def f4 = + inline if isWhileTypingTransparent then "inTyper" else "afterTyper" diff --git a/tests/run-macros/lib-StringContext/StringContext.scala b/tests/run-macros/lib-StringContext/StringContext.scala index d695242e7148..f59f00c7db08 100644 --- a/tests/run-macros/lib-StringContext/StringContext.scala +++ b/tests/run-macros/lib-StringContext/StringContext.scala @@ -12,7 +12,7 @@ package scala - import java.lang.{ StringBuilder => JLSBuilder } + import java.lang.StringBuilder as JLSBuilder import scala.annotation.tailrec /** This class provides the basic mechanism to do String Interpolation. @@ -56,7 +56,7 @@ */ case class StringContext(parts: String*) { - import StringContext.{checkLengths => scCheckLengths, glob, standardInterpolator => scStandardInterpolator} + import StringContext.{checkLengths as scCheckLengths, glob, standardInterpolator as scStandardInterpolator} @deprecated("use same-named method on StringContext companion object", "2.13.0") def checkLengths(args: scala.collection.Seq[Any]): Unit = scCheckLengths(args, parts) diff --git a/tests/run-macros/macros-in-same-project1/Foo.scala b/tests/run-macros/macros-in-same-project1/Foo.scala index 000fb979a3d9..a001dbbcdf90 100644 --- a/tests/run-macros/macros-in-same-project1/Foo.scala +++ b/tests/run-macros/macros-in-same-project1/Foo.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { diff --git a/tests/run-macros/no-symbol/1.scala b/tests/run-macros/no-symbol/1.scala index ed33810c145b..e2187f6d8ff4 100644 --- a/tests/run-macros/no-symbol/1.scala +++ b/tests/run-macros/no-symbol/1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.deriving._ +import scala.quoted.* +import scala.deriving.* case class Foo(i: Int) case class Box[A](x: A) @@ -9,7 +9,7 @@ object Macro { ${ fooImpl[T] } def fooImpl[T](implicit t: Type[T], qctx: Quotes): Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* val sym = TypeTree.of[T].symbol if sym.isClassDef then '{ "symbol" } else if sym.isNoSymbol then '{ "no symbol" } diff --git a/tests/run-macros/no-symbol/2.scala b/tests/run-macros/no-symbol/2.scala index 0e9357d2cc20..cb85878e7bd9 100644 --- a/tests/run-macros/no-symbol/2.scala +++ b/tests/run-macros/no-symbol/2.scala @@ -1,6 +1,6 @@ object Test { def main(args: Array[String]): Unit = { assert(Macro.foo[Foo] == "symbol") - assert(Macro.foo[Box] == "no symbol") + assert(Macro.foo[Box[_]] == "no symbol") } } diff --git a/tests/run-macros/paramSymss/Macro_1.scala b/tests/run-macros/paramSymss/Macro_1.scala index 4c886b3476cf..65c31df30626 100644 --- a/tests/run-macros/paramSymss/Macro_1.scala +++ b/tests/run-macros/paramSymss/Macro_1.scala @@ -1,10 +1,10 @@ -import scala.quoted._ +import scala.quoted.* inline def showParamSyms(inline x: Any): String = ${ showParamSymsExpr('x) } def showParamSymsExpr(using Quotes)(x: Expr[Any]): Expr[String] = - import quotes.reflect._ + import quotes.reflect.* val '{ $y: Any } = x // Drop Inlined not to access the symbol val sym = y.asTerm.symbol Expr( diff --git a/tests/run-macros/power-macro/Macro_1.scala b/tests/run-macros/power-macro/Macro_1.scala index 98b288fe6838..57d468fd7dc1 100644 --- a/tests/run-macros/power-macro/Macro_1.scala +++ b/tests/run-macros/power-macro/Macro_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* inline def power(x: Double, inline n: Int) = ${ powerCode1('x, 'n) } diff --git a/tests/run-macros/quote-and-splice/Macros_1.scala b/tests/run-macros/quote-and-splice/Macros_1.scala index ea94b51d5365..e799318eac12 100644 --- a/tests/run-macros/quote-and-splice/Macros_1.scala +++ b/tests/run-macros/quote-and-splice/Macros_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/run-macros/quote-and-splice/Test_2.scala b/tests/run-macros/quote-and-splice/Test_2.scala index 962441add308..ea6af331aa14 100644 --- a/tests/run-macros/quote-and-splice/Test_2.scala +++ b/tests/run-macros/quote-and-splice/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import Macros._ + import Macros.* def main(args: Array[String]): Unit = { println(macro1) diff --git a/tests/run-macros/quote-change-owner/Macro_1.scala b/tests/run-macros/quote-change-owner/Macro_1.scala index 34001992a2a7..6859c704edff 100644 --- a/tests/run-macros/quote-change-owner/Macro_1.scala +++ b/tests/run-macros/quote-change-owner/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def assert2(expr: => Boolean): Unit = ${ assertImpl('expr) } def assertImpl(expr: Expr[Boolean])(using Quotes) = '{ diff --git a/tests/run-macros/quote-change-owner/Test_2.scala b/tests/run-macros/quote-change-owner/Test_2.scala index 17730efe0dda..5b7a93df917b 100644 --- a/tests/run-macros/quote-change-owner/Test_2.scala +++ b/tests/run-macros/quote-change-owner/Test_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { assert2 { diff --git a/tests/run-macros/quote-elide-prefix/quoted_1.scala b/tests/run-macros/quote-elide-prefix/quoted_1.scala index d44ad7ee6930..c8688717df43 100644 --- a/tests/run-macros/quote-elide-prefix/quoted_1.scala +++ b/tests/run-macros/quote-elide-prefix/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/run-macros/quote-elide-prefix/quoted_2.scala b/tests/run-macros/quote-elide-prefix/quoted_2.scala index f200e1ee815e..7795c5262139 100644 --- a/tests/run-macros/quote-elide-prefix/quoted_2.scala +++ b/tests/run-macros/quote-elide-prefix/quoted_2.scala @@ -1,6 +1,6 @@ object Test { - import Macro._ + import Macro.* def main(args: Array[String]): Unit = { def test = ff"Hello ${"World"}" diff --git a/tests/run-macros/quote-force/quoted_1.scala b/tests/run-macros/quote-force/quoted_1.scala index 4c3f0844dbbb..5bd36e032fde 100644 --- a/tests/run-macros/quote-force/quoted_1.scala +++ b/tests/run-macros/quote-force/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* case class Location(owners: List[String]) diff --git a/tests/run-macros/quote-force/quoted_2.scala b/tests/run-macros/quote-force/quoted_2.scala index 341cab5b2ce1..e385cee2c5b2 100644 --- a/tests/run-macros/quote-force/quoted_2.scala +++ b/tests/run-macros/quote-force/quoted_2.scala @@ -1,4 +1,4 @@ -import Location._ +import Location.* object Test { val loc1 = location diff --git a/tests/run-macros/quote-implicitMatch/Macro_1.scala b/tests/run-macros/quote-implicitMatch/Macro_1.scala index 1c8c2e445d25..2664b975cbbc 100644 --- a/tests/run-macros/quote-implicitMatch/Macro_1.scala +++ b/tests/run-macros/quote-implicitMatch/Macro_1.scala @@ -1,6 +1,6 @@ import collection.immutable.TreeSet import collection.immutable.HashSet -import scala.quoted._ +import scala.quoted.* inline def f1[T]() = ${ f1Impl[T] } diff --git a/tests/run-macros/quote-impure-by-name/quoted_1.scala b/tests/run-macros/quote-impure-by-name/quoted_1.scala index df3252efc958..28f4bf0c01a5 100644 --- a/tests/run-macros/quote-impure-by-name/quoted_1.scala +++ b/tests/run-macros/quote-impure-by-name/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Index[K, Keys](val index: String) extends AnyVal { diff --git a/tests/run-macros/quote-indexed-map-by-name/quoted_1.scala b/tests/run-macros/quote-indexed-map-by-name/quoted_1.scala index 6cff47d619bd..f05c189e1499 100644 --- a/tests/run-macros/quote-indexed-map-by-name/quoted_1.scala +++ b/tests/run-macros/quote-indexed-map-by-name/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class Index[K, Keys](val index: Int) extends AnyVal object Index { diff --git a/tests/run-macros/quote-inline-function/quoted_1.scala b/tests/run-macros/quote-inline-function/quoted_1.scala index 45317b7ded9f..46acf8a3cfc3 100644 --- a/tests/run-macros/quote-inline-function/quoted_1.scala +++ b/tests/run-macros/quote-inline-function/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -7,7 +7,7 @@ object Macros { inline def foreach3(start: Int, end: Int, inline f: Int => Unit): String = ${impl('start, 'end, 'f)} def impl(start: Expr[Int], end: Expr[Int], f: Expr[Int => Unit])(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* val res = '{ var i = $start val j = $end diff --git a/tests/run-macros/quote-inline-function/quoted_2.scala b/tests/run-macros/quote-inline-function/quoted_2.scala index b42249f4ee48..e38d607ca364 100644 --- a/tests/run-macros/quote-inline-function/quoted_2.scala +++ b/tests/run-macros/quote-inline-function/quoted_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/quote-matcher-inference/Macro_1.scala b/tests/run-macros/quote-matcher-inference/Macro_1.scala index bd704315dadf..03476dfe3434 100644 --- a/tests/run-macros/quote-matcher-inference/Macro_1.scala +++ b/tests/run-macros/quote-matcher-inference/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/run-macros/quote-matcher-inference/Test_2.scala b/tests/run-macros/quote-matcher-inference/Test_2.scala index 327112a64868..c046b95e8baf 100644 --- a/tests/run-macros/quote-matcher-inference/Test_2.scala +++ b/tests/run-macros/quote-matcher-inference/Test_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/quote-matcher-power/Macro_1.scala b/tests/run-macros/quote-matcher-power/Macro_1.scala index 32780c456e37..da21736282df 100644 --- a/tests/run-macros/quote-matcher-power/Macro_1.scala +++ b/tests/run-macros/quote-matcher-power/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/run-macros/quote-matcher-power/Test_2.scala b/tests/run-macros/quote-matcher-power/Test_2.scala index 89c4283e2b1b..69c1ba037f31 100644 --- a/tests/run-macros/quote-matcher-power/Test_2.scala +++ b/tests/run-macros/quote-matcher-power/Test_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/quote-matcher-runtime/quoted_1.scala b/tests/run-macros/quote-matcher-runtime/quoted_1.scala index e172073b997e..1f7646320747 100644 --- a/tests/run-macros/quote-matcher-runtime/quoted_1.scala +++ b/tests/run-macros/quote-matcher-runtime/quoted_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def matches[A, B](inline a: A, inline b: B): Unit = ${impl('a, 'b)} private def impl[A, B](a: Expr[A], b: Expr[B])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val res = quotes.asInstanceOf[scala.quoted.runtime.QuoteMatching].ExprMatch.unapply[Tuple, Tuple](a)(using b).map { tup => tup.toArray.toList.map { diff --git a/tests/run-macros/quote-matcher-runtime/quoted_2.scala b/tests/run-macros/quote-matcher-runtime/quoted_2.scala index a2a1e37b183b..47e812c52bdb 100644 --- a/tests/run-macros/quote-matcher-runtime/quoted_2.scala +++ b/tests/run-macros/quote-matcher-runtime/quoted_2.scala @@ -1,7 +1,7 @@ -import Macros._ +import Macros.* -import scala.quoted.runtime.Patterns._ +import scala.quoted.runtime.Patterns.* object Test { diff --git a/tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala b/tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala index 2aff8705ce06..f425cd25ae6d 100644 --- a/tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala +++ b/tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* diff --git a/tests/run-macros/quote-matcher-string-interpolator-2/quoted_2.scala b/tests/run-macros/quote-matcher-string-interpolator-2/quoted_2.scala index 2a85eca35e41..72719a78c466 100644 --- a/tests/run-macros/quote-matcher-string-interpolator-2/quoted_2.scala +++ b/tests/run-macros/quote-matcher-string-interpolator-2/quoted_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala b/tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala index c1dfd083e41a..4265383e8989 100644 --- a/tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala +++ b/tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* diff --git a/tests/run-macros/quote-matcher-string-interpolator-3/quoted_2.scala b/tests/run-macros/quote-matcher-string-interpolator-3/quoted_2.scala index 7ed4d71a1607..0f4dbdab1369 100644 --- a/tests/run-macros/quote-matcher-string-interpolator-3/quoted_2.scala +++ b/tests/run-macros/quote-matcher-string-interpolator-3/quoted_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/quote-matcher-string-interpolator/quoted_1.scala b/tests/run-macros/quote-matcher-string-interpolator/quoted_1.scala index 187ee69565d3..afb00ebdb38a 100644 --- a/tests/run-macros/quote-matcher-string-interpolator/quoted_1.scala +++ b/tests/run-macros/quote-matcher-string-interpolator/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* diff --git a/tests/run-macros/quote-matcher-string-interpolator/quoted_2.scala b/tests/run-macros/quote-matcher-string-interpolator/quoted_2.scala index 2a85eca35e41..72719a78c466 100644 --- a/tests/run-macros/quote-matcher-string-interpolator/quoted_2.scala +++ b/tests/run-macros/quote-matcher-string-interpolator/quoted_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala b/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala index aa05d84c1ecb..820f3d53db3d 100644 --- a/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -20,7 +20,7 @@ object Macros { '{ $sym.times(${lift(x)}, ${lift(y)}) } case _ => - import quotes.reflect._ + import quotes.reflect.* report.error("Expected explicit DSL", e.asTerm.pos) '{ ??? } diff --git a/tests/run-macros/quote-matcher-symantics-1/quoted_2.scala b/tests/run-macros/quote-matcher-symantics-1/quoted_2.scala index 3a09c1c25b94..c31d440732c0 100644 --- a/tests/run-macros/quote-matcher-symantics-1/quoted_2.scala +++ b/tests/run-macros/quote-matcher-symantics-1/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala b/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala index 7d6f234bf35d..3485f40cca37 100644 --- a/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -38,7 +38,7 @@ object Macros { case '{ envVar(${Expr(i)}) } => env(i) case _ => - import quotes.reflect._ + import quotes.reflect.* report.error("Expected explicit DSL " + e.show, e.asTerm.pos) ??? } @@ -52,7 +52,7 @@ object Macros { } ) case _ => - import quotes.reflect._ + import quotes.reflect.* report.error("Expected explicit DSL => DSL " + e.show, e.asTerm.pos) ??? } @@ -64,18 +64,18 @@ object Macros { object UnsafeExpr { def open[T1, R, X](f: Expr[T1 => R])(content: (Expr[R], [t] => Expr[t] => Expr[T1] => Expr[t]) => X)(using Quotes): X = { - import quotes.reflect._ + import quotes.reflect.* val (params, bodyExpr) = paramsAndBody[R](f) content(bodyExpr, [t] => (e: Expr[t]) => (v: Expr[T1]) => bodyFn[t](e.asTerm, params, List(v.asTerm)).asExpr.asInstanceOf[Expr[t]]) } private def paramsAndBody[R](using Quotes)(f: Expr[Any]): (List[quotes.reflect.ValDef], Expr[R]) = { - import quotes.reflect._ + import quotes.reflect.* val Block(List(DefDef("$anonfun", List(TermParamClause(params)), _, Some(body))), Closure(Ident("$anonfun"), None)) = f.asTerm.etaExpand(Symbol.spliceOwner) (params, body.asExpr.asInstanceOf[Expr[R]]) } private def bodyFn[t](using Quotes)(e: quotes.reflect.Term, params: List[quotes.reflect.ValDef], args: List[quotes.reflect.Term]): quotes.reflect.Term = { - import quotes.reflect._ + import quotes.reflect.* val map = params.map(_.symbol).zip(args).toMap new TreeMap { override def transformTerm(tree: Term)(owner: Symbol): Term = diff --git a/tests/run-macros/quote-matcher-symantics-2/quoted_2.scala b/tests/run-macros/quote-matcher-symantics-2/quoted_2.scala index 1b26bd657837..e4c9b3e2ceff 100644 --- a/tests/run-macros/quote-matcher-symantics-2/quoted_2.scala +++ b/tests/run-macros/quote-matcher-symantics-2/quoted_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala b/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala index e8570c48cc3f..1855fb10f856 100644 --- a/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -77,18 +77,18 @@ object Macros { object UnsafeExpr { def open[T1, R, X](f: Expr[T1 => R])(content: (Expr[R], [t] => Expr[t] => Expr[T1] => Expr[t]) => X)(using Quotes): X = { - import quotes.reflect._ + import quotes.reflect.* val (params, bodyExpr) = paramsAndBody[R](f) content(bodyExpr, [t] => (e: Expr[t]) => (v: Expr[T1]) => bodyFn[t](e.asTerm, params, List(v.asTerm)).asExpr.asInstanceOf[Expr[t]]) } private def paramsAndBody[R](using Quotes)(f: Expr[Any]): (List[quotes.reflect.ValDef], Expr[R]) = { - import quotes.reflect._ + import quotes.reflect.* val Block(List(DefDef("$anonfun", List(TermParamClause(params)), _, Some(body))), Closure(Ident("$anonfun"), None)) = f.asTerm.etaExpand(Symbol.spliceOwner) (params, body.asExpr.asInstanceOf[Expr[R]]) } private def bodyFn[t](using Quotes)(e: quotes.reflect.Term, params: List[quotes.reflect.ValDef], args: List[quotes.reflect.Term]): quotes.reflect.Term = { - import quotes.reflect._ + import quotes.reflect.* val map = params.map(_.symbol).zip(args).toMap new TreeMap { override def transformTerm(tree: Term)(owner: Symbol): Term = @@ -125,7 +125,7 @@ object Symantics { object Const { def unapply[T](expr: Expr[T])(using Quotes): Option[T] = { - import quotes.reflect._ + import quotes.reflect.* def rec(tree: Term): Option[T] = tree match { case Literal(c) => c match diff --git a/tests/run-macros/quote-matcher-symantics-3/quoted_2.scala b/tests/run-macros/quote-matcher-symantics-3/quoted_2.scala index 388789ad3373..f82bd6e43229 100644 --- a/tests/run-macros/quote-matcher-symantics-3/quoted_2.scala +++ b/tests/run-macros/quote-matcher-symantics-3/quoted_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/quote-matcher-type-bind/Macro_1.scala b/tests/run-macros/quote-matcher-type-bind/Macro_1.scala index 4692c1c277aa..921b646c7050 100644 --- a/tests/run-macros/quote-matcher-type-bind/Macro_1.scala +++ b/tests/run-macros/quote-matcher-type-bind/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/run-macros/quote-matcher-type-bind/Test_2.scala b/tests/run-macros/quote-matcher-type-bind/Test_2.scala index 4c388ce16d47..878bfc18d9af 100644 --- a/tests/run-macros/quote-matcher-type-bind/Test_2.scala +++ b/tests/run-macros/quote-matcher-type-bind/Test_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/quote-matching-open/Macro_1.scala b/tests/run-macros/quote-matching-open/Macro_1.scala index b01f8e5a1e72..94fdf1959e31 100644 --- a/tests/run-macros/quote-matching-open/Macro_1.scala +++ b/tests/run-macros/quote-matching-open/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { @@ -17,29 +17,29 @@ object Macro { object UnsafeExpr { def open[T1, R, X](f: Expr[T1 => R])(content: (Expr[R], [t] => Expr[t] => Expr[T1] => Expr[t]) => X)(using Quotes): X = { - import quotes.reflect._ + import quotes.reflect.* val (params, bodyExpr) = paramsAndBody[R](f) content(bodyExpr, [t] => (e: Expr[t]) => (v: Expr[T1]) => bodyFn[t](e.asTerm, params, List(v.asTerm)).asExpr.asInstanceOf[Expr[t]]) } def open[T1, T2, R, X](f: Expr[(T1, T2) => R])(content: (Expr[R], [t] => Expr[t] => (Expr[T1], Expr[T2]) => Expr[t]) => X)(using Quotes)(using DummyImplicit): X = { - import quotes.reflect._ + import quotes.reflect.* val (params, bodyExpr) = paramsAndBody[R](f) content(bodyExpr, [t] => (e: Expr[t]) => (v1: Expr[T1], v2: Expr[T2]) => bodyFn[t](e.asTerm, params, List(v1.asTerm, v2.asTerm)).asExpr.asInstanceOf[Expr[t]]) } def open[T1, T2, T3, R, X](f: Expr[(T1, T2, T3) => R])(content: (Expr[R], [t] => Expr[t] => (Expr[T1], Expr[T2], Expr[T3]) => Expr[t]) => X)(using Quotes)(using DummyImplicit, DummyImplicit): X = { - import quotes.reflect._ + import quotes.reflect.* val (params, bodyExpr) = paramsAndBody[R](f) content(bodyExpr, [t] => (e: Expr[t]) => (v1: Expr[T1], v2: Expr[T2], v3: Expr[T3]) => bodyFn[t](e.asTerm, params, List(v1.asTerm, v2.asTerm, v3.asTerm)).asExpr.asInstanceOf[Expr[t]]) } private def paramsAndBody[R](using Quotes)(f: Expr[Any]): (List[quotes.reflect.ValDef], Expr[R]) = { - import quotes.reflect._ + import quotes.reflect.* val Block(List(DefDef("$anonfun", List(TermParamClause(params)), _, Some(body))), Closure(Ident("$anonfun"), None)) = f.asTerm.etaExpand(Symbol.spliceOwner) (params, body.asExpr.asInstanceOf[Expr[R]]) } private def bodyFn[t](using Quotes)(e: quotes.reflect.Term, params: List[quotes.reflect.ValDef], args: List[quotes.reflect.Term]): quotes.reflect.Term = { - import quotes.reflect._ + import quotes.reflect.* val map = params.map(_.symbol).zip(args).toMap new TreeMap { override def transformTerm(tree: Term)(owner: Symbol): Term = diff --git a/tests/run-macros/quote-matching-open/Test_2.scala b/tests/run-macros/quote-matching-open/Test_2.scala index 3fa96cef8726..124e6ff21b2f 100644 --- a/tests/run-macros/quote-matching-open/Test_2.scala +++ b/tests/run-macros/quote-matching-open/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import Macro._ + import Macro.* def main(args: Array[String]): Unit = { println(openTest((x: Int) => x)) diff --git a/tests/run-macros/quote-matching-optimize-1/Macro_1.scala b/tests/run-macros/quote-matching-optimize-1/Macro_1.scala index 6909771f7f2f..316ae01853ec 100644 --- a/tests/run-macros/quote-matching-optimize-1/Macro_1.scala +++ b/tests/run-macros/quote-matching-optimize-1/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/run-macros/quote-matching-optimize-1/Test_2.scala b/tests/run-macros/quote-matching-optimize-1/Test_2.scala index de052ddc8445..cb3c4a0a193e 100644 --- a/tests/run-macros/quote-matching-optimize-1/Test_2.scala +++ b/tests/run-macros/quote-matching-optimize-1/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import Macro._ + import Macro.* def main(args: Array[String]): Unit = { val ls = List(1, 2, 3) diff --git a/tests/run-macros/quote-matching-optimize-2/Macro_1.scala b/tests/run-macros/quote-matching-optimize-2/Macro_1.scala index 89f52713c106..b7b2498dd7b4 100644 --- a/tests/run-macros/quote-matching-optimize-2/Macro_1.scala +++ b/tests/run-macros/quote-matching-optimize-2/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/run-macros/quote-matching-optimize-2/Test_2.scala b/tests/run-macros/quote-matching-optimize-2/Test_2.scala index bab33d5ba202..b5a57b8f4ccf 100644 --- a/tests/run-macros/quote-matching-optimize-2/Test_2.scala +++ b/tests/run-macros/quote-matching-optimize-2/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import Macro._ + import Macro.* def main(args: Array[String]): Unit = { val ls = List(1, 2, 3) diff --git a/tests/run-macros/quote-matching-optimize-3/Macro_1.scala b/tests/run-macros/quote-matching-optimize-3/Macro_1.scala index 7aefe30d20dd..feb3ac926214 100644 --- a/tests/run-macros/quote-matching-optimize-3/Macro_1.scala +++ b/tests/run-macros/quote-matching-optimize-3/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/run-macros/quote-matching-optimize-3/Test_2.scala b/tests/run-macros/quote-matching-optimize-3/Test_2.scala index fc6aa6c12a95..1290015a2c40 100644 --- a/tests/run-macros/quote-matching-optimize-3/Test_2.scala +++ b/tests/run-macros/quote-matching-optimize-3/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import Macro._ + import Macro.* def main(args: Array[String]): Unit = { val ls = List(1, 2, 3) diff --git a/tests/run-macros/quote-matching-optimize-4/Macro_1.scala b/tests/run-macros/quote-matching-optimize-4/Macro_1.scala index 86ea8cd6160f..01e1562b0770 100644 --- a/tests/run-macros/quote-matching-optimize-4/Macro_1.scala +++ b/tests/run-macros/quote-matching-optimize-4/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/run-macros/quote-matching-optimize-4/Test_2.scala b/tests/run-macros/quote-matching-optimize-4/Test_2.scala index abce7c9ca7d3..987fc01a1fd1 100644 --- a/tests/run-macros/quote-matching-optimize-4/Test_2.scala +++ b/tests/run-macros/quote-matching-optimize-4/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import Macro._ + import Macro.* def main(args: Array[String]): Unit = { val ls = List(1, 2, 3) diff --git a/tests/run-macros/quote-matching-optimize-5/Macro_1.scala b/tests/run-macros/quote-matching-optimize-5/Macro_1.scala index 463c30f74eb3..8224daf8563c 100644 --- a/tests/run-macros/quote-matching-optimize-5/Macro_1.scala +++ b/tests/run-macros/quote-matching-optimize-5/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/run-macros/quote-matching-optimize-5/Test_2.scala b/tests/run-macros/quote-matching-optimize-5/Test_2.scala index abce7c9ca7d3..987fc01a1fd1 100644 --- a/tests/run-macros/quote-matching-optimize-5/Test_2.scala +++ b/tests/run-macros/quote-matching-optimize-5/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import Macro._ + import Macro.* def main(args: Array[String]): Unit = { val ls = List(1, 2, 3) diff --git a/tests/run-macros/quote-sep-comp-2/Macro_1.scala b/tests/run-macros/quote-sep-comp-2/Macro_1.scala index c23bd5f1884b..0cef7f5f19df 100644 --- a/tests/run-macros/quote-sep-comp-2/Macro_1.scala +++ b/tests/run-macros/quote-sep-comp-2/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { def assertImpl(expr: Expr[Boolean])(using Quotes) = '{ println($expr) } diff --git a/tests/run-macros/quote-sep-comp/Macro_1.scala b/tests/run-macros/quote-sep-comp/Macro_1.scala index 611647b7d44a..d8da7f7deade 100644 --- a/tests/run-macros/quote-sep-comp/Macro_1.scala +++ b/tests/run-macros/quote-sep-comp/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def assert2(expr: => Boolean): Unit = ${ assertImpl('expr) } def assertImpl(expr: Expr[Boolean])(using Quotes) = '{ println($expr) } diff --git a/tests/run-macros/quote-sep-comp/Test_2.scala b/tests/run-macros/quote-sep-comp/Test_2.scala index 805fb8a6b079..11b704520db6 100644 --- a/tests/run-macros/quote-sep-comp/Test_2.scala +++ b/tests/run-macros/quote-sep-comp/Test_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { val x = 1 diff --git a/tests/run-macros/quote-simple-macro/quoted_1.scala b/tests/run-macros/quote-simple-macro/quoted_1.scala index 0bc43021a8a6..bd39612bf3ca 100644 --- a/tests/run-macros/quote-simple-macro/quoted_1.scala +++ b/tests/run-macros/quote-simple-macro/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def foo(inline i: Int, dummy: Int, j: Int): Int = ${ bar('i, 'j) } diff --git a/tests/run-macros/quote-simple-macro/quoted_2.scala b/tests/run-macros/quote-simple-macro/quoted_2.scala index f05e44fed20a..748608a7b453 100644 --- a/tests/run-macros/quote-simple-macro/quoted_2.scala +++ b/tests/run-macros/quote-simple-macro/quoted_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Macros._ +import scala.quoted.* +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/quote-toExprOfSeq/Macro_1.scala b/tests/run-macros/quote-toExprOfSeq/Macro_1.scala index b9a7ae0a1396..a4ccec66e2b0 100644 --- a/tests/run-macros/quote-toExprOfSeq/Macro_1.scala +++ b/tests/run-macros/quote-toExprOfSeq/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def seq = ${fooImpl} diff --git a/tests/run-macros/quote-toExprOfTuple/Macro_1.scala b/tests/run-macros/quote-toExprOfTuple/Macro_1.scala index e9eb070c3a14..95e1810b0988 100644 --- a/tests/run-macros/quote-toExprOfTuple/Macro_1.scala +++ b/tests/run-macros/quote-toExprOfTuple/Macro_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def t2[T0, T1](t0: T0, t1: T1): (T0, T1) = ${ impl2('{t0}, '{t1}) } def impl2[T0: Type, T1: Type](t0: Expr[T0], t1: Expr[T1])(using Quotes) : Expr[(T0, T1)] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* val seq = List(t0, t1) val res = Expr.ofTupleFromSeq(seq) diff --git a/tests/run-macros/quote-type-matcher-2/quoted_1.scala b/tests/run-macros/quote-type-matcher-2/quoted_1.scala index 4decd9a65ac4..d477f8b99e70 100644 --- a/tests/run-macros/quote-type-matcher-2/quoted_1.scala +++ b/tests/run-macros/quote-type-matcher-2/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { diff --git a/tests/run-macros/quote-type-matcher-2/quoted_2.scala b/tests/run-macros/quote-type-matcher-2/quoted_2.scala index 02de1c9c1ffb..e0729f75a17c 100644 --- a/tests/run-macros/quote-type-matcher-2/quoted_2.scala +++ b/tests/run-macros/quote-type-matcher-2/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/quote-type-matcher/quoted_1.scala b/tests/run-macros/quote-type-matcher/quoted_1.scala index dd382deb3dd8..346c73daeed2 100644 --- a/tests/run-macros/quote-type-matcher/quoted_1.scala +++ b/tests/run-macros/quote-type-matcher/quoted_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def matches[A, B]: Unit = ${ matchesExpr[A, B] } private def matchesExpr[A, B](using a: Type[A], b: Type[B])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val res = quotes.asInstanceOf[scala.quoted.runtime.QuoteMatching].TypeMatch.unapply[Tuple, Tuple](a)(using b).map { tup => tup.toArray.toList.map { diff --git a/tests/run-macros/quote-type-matcher/quoted_2.scala b/tests/run-macros/quote-type-matcher/quoted_2.scala index 0874ef7b0ec5..0202b71a70ad 100644 --- a/tests/run-macros/quote-type-matcher/quoted_2.scala +++ b/tests/run-macros/quote-type-matcher/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { diff --git a/tests/run-macros/quote-unrolled-foreach/quoted_1.scala b/tests/run-macros/quote-unrolled-foreach/quoted_1.scala index b218f135fe9f..c84cd639bda7 100644 --- a/tests/run-macros/quote-unrolled-foreach/quoted_1.scala +++ b/tests/run-macros/quote-unrolled-foreach/quoted_1.scala @@ -1,5 +1,5 @@ import scala.annotation.tailrec -import scala.quoted._ +import scala.quoted.* object Macro { diff --git a/tests/run-macros/quote-unrolled-foreach/quoted_2.scala b/tests/run-macros/quote-unrolled-foreach/quoted_2.scala index 39d4cf2ba9e3..4a700457cb6e 100644 --- a/tests/run-macros/quote-unrolled-foreach/quoted_2.scala +++ b/tests/run-macros/quote-unrolled-foreach/quoted_2.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/quote-whitebox/Macro_1.scala b/tests/run-macros/quote-whitebox/Macro_1.scala index 273e755426a2..a18fccbc166e 100644 --- a/tests/run-macros/quote-whitebox/Macro_1.scala +++ b/tests/run-macros/quote-whitebox/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { transparent inline def defaultOf(inline str: String): Any = ${ defaultOfImpl('str) } diff --git a/tests/run-macros/quote-whitebox/Test_2.scala b/tests/run-macros/quote-whitebox/Test_2.scala index 105fcad244b7..b6ac7209b98c 100644 --- a/tests/run-macros/quote-whitebox/Test_2.scala +++ b/tests/run-macros/quote-whitebox/Test_2.scala @@ -1,4 +1,4 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/quoted-expr-block/quoted_1.scala b/tests/run-macros/quoted-expr-block/quoted_1.scala index d392ef9b29dc..8d2403df4c10 100644 --- a/tests/run-macros/quoted-expr-block/quoted_1.scala +++ b/tests/run-macros/quoted-expr-block/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def replicate(inline times: Int, code: => Any) = ${replicateImpl('times, 'code)} diff --git a/tests/run-macros/quoted-matching-docs-2/Macro_1.scala b/tests/run-macros/quoted-matching-docs-2/Macro_1.scala index 9f0edee63294..8edaab8ad086 100644 --- a/tests/run-macros/quoted-matching-docs-2/Macro_1.scala +++ b/tests/run-macros/quoted-matching-docs-2/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* def sum(args: Int*): Int = args.sum diff --git a/tests/run-macros/quoted-matching-docs/Macro_1.scala b/tests/run-macros/quoted-matching-docs/Macro_1.scala index 5fa124b8ec1a..82ea6f956b78 100644 --- a/tests/run-macros/quoted-matching-docs/Macro_1.scala +++ b/tests/run-macros/quoted-matching-docs/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def sum(args: Int*): Int = ${ sumExpr('args) } @@ -22,6 +22,6 @@ private def sumExpr(argsExpr: Expr[Seq[Int]])(using Quotes) : Expr[Int] = { object UnsafeExpr { def underlyingArgument[T](expr: Expr[T])(using Quotes): Expr[T] = - import quotes.reflect._ + import quotes.reflect.* expr.asTerm.underlyingArgument.asExpr.asInstanceOf[Expr[T]] } \ No newline at end of file diff --git a/tests/run-macros/quoted-pattern-open-expr-0/Macro_1.scala b/tests/run-macros/quoted-pattern-open-expr-0/Macro_1.scala index 9f5fdc044415..3f1edf119876 100644 --- a/tests/run-macros/quoted-pattern-open-expr-0/Macro_1.scala +++ b/tests/run-macros/quoted-pattern-open-expr-0/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def test(inline e: Int): String = ${testExpr('e)} diff --git a/tests/run-macros/quoted-pattern-open-expr-simple-eval/Macro_1.scala b/tests/run-macros/quoted-pattern-open-expr-simple-eval/Macro_1.scala index 096911841e9a..c31cadae3ca7 100644 --- a/tests/run-macros/quoted-pattern-open-expr-simple-eval/Macro_1.scala +++ b/tests/run-macros/quoted-pattern-open-expr-simple-eval/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def eval(inline e: Int): Int = ${ evalExpr('e) } diff --git a/tests/run-macros/quoted-pattern-open-expr/Macro_1.scala b/tests/run-macros/quoted-pattern-open-expr/Macro_1.scala index 3416c9379ca5..8f759c9a7c7a 100644 --- a/tests/run-macros/quoted-pattern-open-expr/Macro_1.scala +++ b/tests/run-macros/quoted-pattern-open-expr/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def test(inline e: Int): String = ${testExpr('e)} diff --git a/tests/run-macros/quoted-pattern-type/Macro_1.scala b/tests/run-macros/quoted-pattern-type/Macro_1.scala index 9406a6f4cd04..ab3939e5ab9d 100644 --- a/tests/run-macros/quoted-pattern-type/Macro_1.scala +++ b/tests/run-macros/quoted-pattern-type/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Lib { diff --git a/tests/run-macros/quoted-pattern-type/Test_2.scala b/tests/run-macros/quoted-pattern-type/Test_2.scala index 60ae48cdfb92..d149c188d700 100644 --- a/tests/run-macros/quoted-pattern-type/Test_2.scala +++ b/tests/run-macros/quoted-pattern-type/Test_2.scala @@ -1,5 +1,5 @@ object Test { - import Lib._ + import Lib.* def main(args: Array[String]): Unit = { foo(true) diff --git a/tests/run-macros/quoted-toExprOfClass/Macros_1.scala b/tests/run-macros/quoted-toExprOfClass/Macros_1.scala index 0b9f33f5ddbc..e64bb1078f33 100644 --- a/tests/run-macros/quoted-toExprOfClass/Macros_1.scala +++ b/tests/run-macros/quoted-toExprOfClass/Macros_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* inline def wildcard: Map[String, Class[?]] = ${ wildcardMacro } inline def noWildcard: Map[String, Class[Int]] = ${ noWildcardMacro } diff --git a/tests/run-macros/refined-selectable-macro/Macro_1.scala b/tests/run-macros/refined-selectable-macro/Macro_1.scala index a648dc3a4a43..d8a81d2ebdfd 100644 --- a/tests/run-macros/refined-selectable-macro/Macro_1.scala +++ b/tests/run-macros/refined-selectable-macro/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macro { @@ -15,7 +15,7 @@ object Macro { } private def toTupleImpl(s: Expr[Selectable])(using qctx:Quotes) : Expr[Tuple] = { - import quotes.reflect._ + import quotes.reflect.* val repr = s.asTerm.tpe.widenTermRefByName.dealias @@ -49,7 +49,7 @@ object Macro { } private def fromTupleImpl[T: Type](s: Expr[Tuple], newRecord: Expr[Array[(String, Any)] => T])(using qctx:Quotes) : Expr[Any] = { - import quotes.reflect._ + import quotes.reflect.* val repr = s.asTerm.tpe.widenTermRefByName.dealias diff --git a/tests/run-macros/refined-selectable-macro/Macro_2.scala b/tests/run-macros/refined-selectable-macro/Macro_2.scala index 7d686a0e065a..f25d42b7926d 100644 --- a/tests/run-macros/refined-selectable-macro/Macro_2.scala +++ b/tests/run-macros/refined-selectable-macro/Macro_2.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import Macro._ +import scala.quoted.* +import Macro.* object Macro2 { // TODO should elems of `new Record` and `Record.fromUntypedTuple` be IArray[Object] @@ -12,7 +12,7 @@ object Macro2 { } object Record extends SelectableRecordCompanion[Record] { - import scala.quoted._ + import scala.quoted.* inline def apply[R <: Record](elems: (String, Any)*) : R = ${ applyImpl[R]('elems) } diff --git a/tests/run-macros/refined-selectable-macro/Test_3.scala b/tests/run-macros/refined-selectable-macro/Test_3.scala index 53a852c81e2b..8f8a9fc4d23a 100644 --- a/tests/run-macros/refined-selectable-macro/Test_3.scala +++ b/tests/run-macros/refined-selectable-macro/Test_3.scala @@ -1,7 +1,7 @@ -import Macro._ -import Macro2._ +import Macro.* +import Macro2.* -import scala.compiletime.testing._ +import scala.compiletime.testing.* object Test { diff --git a/tests/run-macros/reflect-dsl/assert_1.scala b/tests/run-macros/reflect-dsl/assert_1.scala index 9424226f6de9..a258f31e9e83 100644 --- a/tests/run-macros/reflect-dsl/assert_1.scala +++ b/tests/run-macros/reflect-dsl/assert_1.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert(condition: => Boolean): Unit = ${ assertImpl('condition, '{""}) } def assertImpl(cond: Expr[Boolean], clue: Expr[Any])(using Quotes): Expr[Unit] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* def isImplicitMethodType(tp: TypeRepr): Boolean = tp match case tp: MethodType => tp.isImplicit diff --git a/tests/run-macros/reflect-dsl/test_2.scala b/tests/run-macros/reflect-dsl/test_2.scala index 1525360a71f7..08ffce1b3747 100644 --- a/tests/run-macros/reflect-dsl/test_2.scala +++ b/tests/run-macros/reflect-dsl/test_2.scala @@ -1,5 +1,5 @@ object Test { - import scalatest._ + import scalatest.* case class Box[T](v: T) { def >(that: Box[T]): Boolean = this == that diff --git a/tests/run-macros/reflect-inline/assert_1.scala b/tests/run-macros/reflect-inline/assert_1.scala index d6b115529ea6..6c797be0fc85 100644 --- a/tests/run-macros/reflect-inline/assert_1.scala +++ b/tests/run-macros/reflect-inline/assert_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object api { extension (inline x: String) inline def stripMargin: String = diff --git a/tests/run-macros/reflect-inline/test_2.scala b/tests/run-macros/reflect-inline/test_2.scala index 2f36d7b52214..8d1a78c5e677 100644 --- a/tests/run-macros/reflect-inline/test_2.scala +++ b/tests/run-macros/reflect-inline/test_2.scala @@ -1,8 +1,8 @@ -import api._ +import api.* object Test { def main(args: Array[String]): Unit = { - val a: String = "5" + inline val a = "5" assert(typeChecks("|1 + 1".stripMargin)) assert(scala.compiletime.testing.typeChecks("|1 + 1".stripMargin)) assert(("|3 + " + a).stripMargin == "3 + 5") diff --git a/tests/run-macros/reflect-lambda/assert_1.scala b/tests/run-macros/reflect-lambda/assert_1.scala index 077635b93cef..7977a4ee9058 100644 --- a/tests/run-macros/reflect-lambda/assert_1.scala +++ b/tests/run-macros/reflect-lambda/assert_1.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* object lib { inline def assert(condition: => Boolean): Unit = ${ assertImpl('condition, '{""}) } def assertImpl(cond: Expr[Boolean], clue: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* cond.asTerm.underlyingArgument match { case t @ Apply(Select(lhs, op), Lambda(param :: Nil, Apply(Select(a, "=="), b :: Nil)) :: Nil) diff --git a/tests/run-macros/reflect-lambda/test_2.scala b/tests/run-macros/reflect-lambda/test_2.scala index bb712c81b477..3cd18153861d 100644 --- a/tests/run-macros/reflect-lambda/test_2.scala +++ b/tests/run-macros/reflect-lambda/test_2.scala @@ -1,5 +1,5 @@ object Test { - import lib._ + import lib.* case class IntList(args: Int*) { def exists(f: Int => Boolean): Boolean = args.exists(f) diff --git a/tests/run-macros/reflect-pos-fun/assert_1.scala b/tests/run-macros/reflect-pos-fun/assert_1.scala index 712983517b01..1b62fc643fc4 100644 --- a/tests/run-macros/reflect-pos-fun/assert_1.scala +++ b/tests/run-macros/reflect-pos-fun/assert_1.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert(condition: => Boolean): Unit = ${ assertImpl('condition) } def assertImpl(cond: Expr[Boolean])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* cond.asTerm.underlyingArgument match { case t @ Apply(TypeApply(Select(lhs, op), targs), rhs) => diff --git a/tests/run-macros/reflect-pos-fun/test_2.scala b/tests/run-macros/reflect-pos-fun/test_2.scala index b4d32b93a5cf..762bad12a5d4 100644 --- a/tests/run-macros/reflect-pos-fun/test_2.scala +++ b/tests/run-macros/reflect-pos-fun/test_2.scala @@ -1,5 +1,5 @@ object Test { - import scalatest._ + import scalatest.* def main(args: Array[String]): Unit = { val l = List(3, 5) diff --git a/tests/run-macros/reflect-select-constructor/assert_1.scala b/tests/run-macros/reflect-select-constructor/assert_1.scala index 3774fa5e98ba..ce469d9f9741 100644 --- a/tests/run-macros/reflect-select-constructor/assert_1.scala +++ b/tests/run-macros/reflect-select-constructor/assert_1.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert(condition: => Boolean): Unit = ${ assertImpl('condition, '{""}) } def assertImpl(cond: Expr[Boolean], clue: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* def isImplicitMethodType(tp: TypeRepr): Boolean = tp match case tp: MethodType => tp.isImplicit diff --git a/tests/run-macros/reflect-select-constructor/test_2.scala b/tests/run-macros/reflect-select-constructor/test_2.scala index 1525360a71f7..08ffce1b3747 100644 --- a/tests/run-macros/reflect-select-constructor/test_2.scala +++ b/tests/run-macros/reflect-select-constructor/test_2.scala @@ -1,5 +1,5 @@ object Test { - import scalatest._ + import scalatest.* case class Box[T](v: T) { def >(that: Box[T]): Boolean = this == that diff --git a/tests/run-macros/reflect-select-copy-2/assert_1.scala b/tests/run-macros/reflect-select-copy-2/assert_1.scala index 8b9c535ab5b9..0fd7f7cfbf7e 100644 --- a/tests/run-macros/reflect-select-copy-2/assert_1.scala +++ b/tests/run-macros/reflect-select-copy-2/assert_1.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert(condition: => Boolean): Unit = ${ assertImpl('condition, '{""}) } def assertImpl(cond: Expr[Boolean], clue: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* def isImplicitMethodType(tp: TypeRepr): Boolean = tp match case tp: MethodType => tp.isImplicit diff --git a/tests/run-macros/reflect-select-copy-2/test_2.scala b/tests/run-macros/reflect-select-copy-2/test_2.scala index 1525360a71f7..08ffce1b3747 100644 --- a/tests/run-macros/reflect-select-copy-2/test_2.scala +++ b/tests/run-macros/reflect-select-copy-2/test_2.scala @@ -1,5 +1,5 @@ object Test { - import scalatest._ + import scalatest.* case class Box[T](v: T) { def >(that: Box[T]): Boolean = this == that diff --git a/tests/run-macros/reflect-select-copy/assert_1.scala b/tests/run-macros/reflect-select-copy/assert_1.scala index af9a78fdb7d5..d4822ad2bc1e 100644 --- a/tests/run-macros/reflect-select-copy/assert_1.scala +++ b/tests/run-macros/reflect-select-copy/assert_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert(condition: => Boolean): Unit = ${ assertImpl('condition, '{""}) } def assertImpl(cond: Expr[Boolean], clue: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* cond.asTerm.underlyingArgument match { case Apply(select @ Select(lhs, op), rhs :: Nil) => diff --git a/tests/run-macros/reflect-select-copy/test_2.scala b/tests/run-macros/reflect-select-copy/test_2.scala index 435c487885a2..e411c7f19bd7 100644 --- a/tests/run-macros/reflect-select-copy/test_2.scala +++ b/tests/run-macros/reflect-select-copy/test_2.scala @@ -1,5 +1,5 @@ object Test { - import scalatest._ + import scalatest.* class Box(val x: Int) { def >(y: Int): Boolean = x > y diff --git a/tests/run-macros/reflect-select-symbol-constructor/assert_1.scala b/tests/run-macros/reflect-select-symbol-constructor/assert_1.scala index 4f1e8e50b948..6d155d794324 100644 --- a/tests/run-macros/reflect-select-symbol-constructor/assert_1.scala +++ b/tests/run-macros/reflect-select-symbol-constructor/assert_1.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert(condition: => Boolean): Unit = ${ assertImpl('condition, '{""}) } def assertImpl(cond: Expr[Boolean], clue: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* def isImplicitMethodType(tp: TypeRepr): Boolean = tp match case tp: MethodType => tp.isImplicit diff --git a/tests/run-macros/reflect-select-symbol-constructor/test_2.scala b/tests/run-macros/reflect-select-symbol-constructor/test_2.scala index 1525360a71f7..08ffce1b3747 100644 --- a/tests/run-macros/reflect-select-symbol-constructor/test_2.scala +++ b/tests/run-macros/reflect-select-symbol-constructor/test_2.scala @@ -1,5 +1,5 @@ object Test { - import scalatest._ + import scalatest.* case class Box[T](v: T) { def >(that: Box[T]): Boolean = this == that diff --git a/tests/run-macros/reflect-select-value-class/assert_1.scala b/tests/run-macros/reflect-select-value-class/assert_1.scala index 3774fa5e98ba..ce469d9f9741 100644 --- a/tests/run-macros/reflect-select-value-class/assert_1.scala +++ b/tests/run-macros/reflect-select-value-class/assert_1.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { inline def assert(condition: => Boolean): Unit = ${ assertImpl('condition, '{""}) } def assertImpl(cond: Expr[Boolean], clue: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ - import util._ + import quotes.reflect.* + import util.* def isImplicitMethodType(tp: TypeRepr): Boolean = tp match case tp: MethodType => tp.isImplicit diff --git a/tests/run-macros/reflect-select-value-class/test_2.scala b/tests/run-macros/reflect-select-value-class/test_2.scala index f1fa2581213d..92042638c75f 100644 --- a/tests/run-macros/reflect-select-value-class/test_2.scala +++ b/tests/run-macros/reflect-select-value-class/test_2.scala @@ -1,5 +1,5 @@ object Test { - import scalatest._ + import scalatest.* implicit class AnyOps(x: String) extends AnyVal { def *(y: String): String = x + ", " + y diff --git a/tests/run-macros/reflect-sourceCode.check b/tests/run-macros/reflect-sourceCode.check new file mode 100644 index 000000000000..e4e8e81b1acb --- /dev/null +++ b/tests/run-macros/reflect-sourceCode.check @@ -0,0 +1,7 @@ +args(0) +args( 0 ) +args( 0 /* ignore */) +f +f +{ f } +{ f; f } diff --git a/tests/run-macros/reflect-sourceCode/Macro_1.scala b/tests/run-macros/reflect-sourceCode/Macro_1.scala index f2d85af7234f..f07fde79c5ae 100644 --- a/tests/run-macros/reflect-sourceCode/Macro_1.scala +++ b/tests/run-macros/reflect-sourceCode/Macro_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object api { extension [T](x: => T) inline def reflect: String = ${ reflImpl('x) } private def reflImpl[T](x: Expr[T])(implicit qctx: Quotes): Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* Expr(x.asTerm.pos.sourceCode.get) } } diff --git a/tests/run-macros/reflect-sourceCode/Test_2.scala b/tests/run-macros/reflect-sourceCode/Test_2.scala index a1a6d6562473..d399f60adcdd 100644 --- a/tests/run-macros/reflect-sourceCode/Test_2.scala +++ b/tests/run-macros/reflect-sourceCode/Test_2.scala @@ -1,15 +1,15 @@ -import api._ +import api.* object Test { def f(implicit x: Int): Int = x * x def main(args: Array[String]): Unit = { implicit val x: Int = 10 - assert(args(0).reflect == "args(0)") - assert(args( 0 ).reflect == "args( 0 )") - assert(args( 0 /* ignore */).reflect == "args( 0 /* ignore */)") - assert(f.reflect == "f") - assert((f).reflect == "f") - assert( { f }.reflect == "{ f }") - assert( { f; f }.reflect == "{ f; f }") + println(args(0).reflect) + println(args( 0 ).reflect) + println(args( 0 /* ignore */).reflect) + println(f.reflect) + println((f).reflect) + println( { f }.reflect) + println( { f; f }.reflect) } } diff --git a/tests/run-macros/reflect-typeChecks/assert_1.scala b/tests/run-macros/reflect-typeChecks/assert_1.scala index db8d4fe3dd31..ccaec7b9eb71 100644 --- a/tests/run-macros/reflect-typeChecks/assert_1.scala +++ b/tests/run-macros/reflect-typeChecks/assert_1.scala @@ -1,9 +1,9 @@ -import scala.quoted._ +import scala.quoted.* object scalatest { - inline def assertCompile(inline code: String): Unit = ${ assertImpl('code, '{compiletime.testing.typeChecks(code)}, true) } - inline def assertNotCompile(inline code: String): Unit = ${ assertImpl('code, '{compiletime.testing.typeChecks(code)}, false) } + transparent inline def assertCompile(inline code: String): Unit = ${ assertImpl('code, '{compiletime.testing.typeChecks(code)}, true) } + transparent inline def assertNotCompile(inline code: String): Unit = ${ assertImpl('code, '{compiletime.testing.typeChecks(code)}, false) } def assertImpl(code: Expr[String], actual: Expr[Boolean], expect: Boolean)(using Quotes) : Expr[Unit] = { '{ assert(${Expr(expect)} == $actual) } diff --git a/tests/run-macros/reflect-typeChecks/test_2.scala b/tests/run-macros/reflect-typeChecks/test_2.scala index e83eb0c9503b..351edf8fd55e 100644 --- a/tests/run-macros/reflect-typeChecks/test_2.scala +++ b/tests/run-macros/reflect-typeChecks/test_2.scala @@ -1,5 +1,5 @@ object Test { - import scalatest._ + import scalatest.* trait Eq[T] implicit val eq: Eq[Int] = new Eq[Int] {} diff --git a/tests/run-macros/requiredSymbols/Macro_1.scala b/tests/run-macros/requiredSymbols/Macro_1.scala index 8a516081a80a..1ee1be3064b5 100644 --- a/tests/run-macros/requiredSymbols/Macro_1.scala +++ b/tests/run-macros/requiredSymbols/Macro_1.scala @@ -1,9 +1,9 @@ -import scala.quoted._ +import scala.quoted.* object Macro { inline def foo: String = ${ fooImpl } def fooImpl(using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* val list = List( Symbol.requiredPackage("java"), Symbol.requiredPackage("java.lang"), diff --git a/tests/run-macros/simple-interpreter/Macro_1.scala b/tests/run-macros/simple-interpreter/Macro_1.scala index 2a5f8a36ebe6..98ce017e563c 100644 --- a/tests/run-macros/simple-interpreter/Macro_1.scala +++ b/tests/run-macros/simple-interpreter/Macro_1.scala @@ -13,7 +13,7 @@ object Schema { * Assumes that all instances of schema come from `object Schema` */ object SchemaInterpreter { - import scala.quoted._ + import scala.quoted.* def interpretSchemaType[T: Type](schema: Expr[SchemaType[T]])(using Quotes): Option[SchemaType[T]] = schema match { @@ -39,7 +39,7 @@ object SchemaInterpreter { } object Macro { - import scala.quoted._ + import scala.quoted.* inline def useSchema[T](using inline schema: Schema[T]): String = ${ useSchemaExpr[T]('schema) } diff --git a/tests/run-macros/string-context-implicits/Macro_1.scala b/tests/run-macros/string-context-implicits/Macro_1.scala index b0049f9049d3..ccf1091fba3f 100644 --- a/tests/run-macros/string-context-implicits/Macro_1.scala +++ b/tests/run-macros/string-context-implicits/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* extension (sc: StringContext) inline def showMe(inline args: Any*): String = ${ showMeExpr('sc, 'args) } @@ -26,5 +26,6 @@ trait Show[-T] { def show(x: T): String } -given Show[Int] = x => s"Int($x)" -given Show[String] = x => s"Str($x)" +object Show: + given Show[Int] = x => s"Int($x)" + given Show[String] = x => s"Str($x)" diff --git a/tests/run-macros/tasty-argument-tree-1/quoted_1.scala b/tests/run-macros/tasty-argument-tree-1/quoted_1.scala index f25d0f2e3c18..8e5342b1cf0a 100644 --- a/tests/run-macros/tasty-argument-tree-1/quoted_1.scala +++ b/tests/run-macros/tasty-argument-tree-1/quoted_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def inspect[T](x: T): Unit = ${ impl('x) } def impl[T](x: Expr[T])(using q: Quotes) : Expr[Unit] = { - import q.reflect._ + import q.reflect.* val tree = x.asTerm given Printer[Tree] = Printer.TreeStructure '{ diff --git a/tests/run-macros/tasty-construct-types/Macro_1.scala b/tests/run-macros/tasty-construct-types/Macro_1.scala index aa896f8fb968..bbeeb4bc9d38 100644 --- a/tests/run-macros/tasty-construct-types/Macro_1.scala +++ b/tests/run-macros/tasty-construct-types/Macro_1.scala @@ -1,4 +1,4 @@ -import quoted._ +import quoted.* object Macros { inline def theTestBlock : Unit = ${ theTestBlockImpl } @@ -11,7 +11,7 @@ object Macros { class TestAnnotation extends scala.annotation.Annotation def theTestBlockImpl(using qctx : Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val x1T = ConstantType(IntConstant(1)) val x2T = OrType(ConstantType(IntConstant(1)), ConstantType(IntConstant(2))) diff --git a/tests/run-macros/tasty-create-method-symbol/Macro_1.scala b/tests/run-macros/tasty-create-method-symbol/Macro_1.scala index ecfed89ded8a..b5953e55402b 100644 --- a/tests/run-macros/tasty-create-method-symbol/Macro_1.scala +++ b/tests/run-macros/tasty-create-method-symbol/Macro_1.scala @@ -1,11 +1,11 @@ -import quoted._ +import quoted.* object Macros { inline def theTestBlock : Unit = ${ theTestBlockImpl } def theTestBlockImpl(using q: Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* // simple smoke test val sym1 : Symbol = Symbol.newMethod( diff --git a/tests/run-macros/tasty-dealias/quoted_1.scala b/tests/run-macros/tasty-dealias/quoted_1.scala index 7e77ea345572..a1ab806f9618 100644 --- a/tests/run-macros/tasty-dealias/quoted_1.scala +++ b/tests/run-macros/tasty-dealias/quoted_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def dealias[T]: String = ${ impl[T] } def impl[T: Type](using Quotes) : Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* Expr(TypeRepr.of[T].dealias.show) } } diff --git a/tests/run-macros/tasty-definitions-1/quoted_1.scala b/tests/run-macros/tasty-definitions-1/quoted_1.scala index f425384da21f..6ee80daeeb1d 100644 --- a/tests/run-macros/tasty-definitions-1/quoted_1.scala +++ b/tests/run-macros/tasty-definitions-1/quoted_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def testDefinitions(): Unit = ${testDefinitionsImpl} def testDefinitionsImpl(using q: Quotes) : Expr[Unit] = { - import q.reflect._ + import q.reflect.* val buff = List.newBuilder[String] def printout(x: => String): Unit = { diff --git a/tests/run-macros/tasty-eval/quoted_1.scala b/tests/run-macros/tasty-eval/quoted_1.scala index b8af0ac99d63..7a9cf4425d4f 100644 --- a/tests/run-macros/tasty-eval/quoted_1.scala +++ b/tests/run-macros/tasty-eval/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -17,7 +17,7 @@ object Macros { implicit def intIsEvalable: Valuable[Int] = new Valuable[Int] { override def value(e: Expr[Int])(using Quotes) : Option[Int] = { - import quotes.reflect._ + import quotes.reflect.* e.asTerm.tpe match { case pre: TermRef if pre.termSymbol.isValDef => diff --git a/tests/run-macros/tasty-eval/quoted_2.scala b/tests/run-macros/tasty-eval/quoted_2.scala index ac3adbcc9bcd..78cecb18a913 100644 --- a/tests/run-macros/tasty-eval/quoted_2.scala +++ b/tests/run-macros/tasty-eval/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { final val y = 5 diff --git a/tests/run-macros/tasty-extractors-1/quoted_1.scala b/tests/run-macros/tasty-extractors-1/quoted_1.scala index b46abc9d20a1..fd8c68ccb178 100644 --- a/tests/run-macros/tasty-extractors-1/quoted_1.scala +++ b/tests/run-macros/tasty-extractors-1/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -6,7 +6,7 @@ object Macros { ${ impl('x) } def impl[T](x: Expr[T])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val tree = x.asTerm val treeStr = Expr(tree.show(using Printer.TreeStructure)) diff --git a/tests/run-macros/tasty-extractors-1/quoted_2.scala b/tests/run-macros/tasty-extractors-1/quoted_2.scala index b0c052366225..788b0e691bb7 100644 --- a/tests/run-macros/tasty-extractors-1/quoted_2.scala +++ b/tests/run-macros/tasty-extractors-1/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-extractors-2.check b/tests/run-macros/tasty-extractors-2.check index a5a3c806c923..3fa60370e850 100644 --- a/tests/run-macros/tasty-extractors-2.check +++ b/tests/run-macros/tasty-extractors-2.check @@ -49,7 +49,7 @@ TypeRef(ThisType(TypeRef(NoPrefix(), "scala")), "Unit") Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", List(TermParamClause(Nil)), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(DefDef("a", Nil, Inferred(), Some(Literal(IntConstant(0))))))), Literal(UnitConstant()))) TypeRef(ThisType(TypeRef(NoPrefix(), "scala")), "Unit") -Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", List(TermParamClause(Nil)), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), TypeSelect(Select(Ident("_root_"), "scala"), "Product"), TypeSelect(Select(Ident("_root_"), "scala"), "Serializable")), Nil, None, List(DefDef("copy", List(TermParamClause(Nil)), Inferred(), Some(Apply(Select(New(Inferred()), ""), Nil))))), ValDef("Foo", TypeIdent("Foo$"), Some(Apply(Select(New(TypeIdent("Foo$")), ""), Nil))), ClassDef("Foo$", DefDef("", List(TermParamClause(Nil)), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, Some(ValDef("_", Singleton(Ident("Foo")), None)), List(DefDef("apply", List(TermParamClause(Nil)), Inferred(), Some(Apply(Select(New(Inferred()), ""), Nil))), DefDef("unapply", List(TermParamClause(List(ValDef("x$1", Inferred(), None)))), Singleton(Literal(BooleanConstant(true))), Some(Literal(BooleanConstant(true)))), DefDef("toString", Nil, Inferred(), Some(Literal(StringConstant("Foo"))))))), Literal(UnitConstant()))) +Inlined(None, Nil, Block(List(ClassDef("Foo", DefDef("", List(TermParamClause(Nil)), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), TypeSelect(Select(Ident("_root_"), "scala"), "Product"), TypeSelect(Select(Ident("_root_"), "scala"), "Serializable")), Nil, None, List(DefDef("hashCode", List(TermParamClause(Nil)), Inferred(), Some(Apply(Ident("_hashCode"), List(This(Some("Foo")))))), DefDef("equals", List(TermParamClause(List(ValDef("x$0", Inferred(), None)))), Inferred(), Some(Apply(Select(Apply(Select(This(Some("Foo")), "eq"), List(TypeApply(Select(Ident("x$0"), "$asInstanceOf$"), List(Inferred())))), "||"), List(Match(Ident("x$0"), List(CaseDef(Bind("x$0", Typed(Ident("_"), Inferred())), None, Apply(Select(Literal(BooleanConstant(true)), "&&"), List(Apply(Select(Ident("x$0"), "canEqual"), List(This(Some("Foo"))))))), CaseDef(Ident("_"), None, Literal(BooleanConstant(false))))))))), DefDef("toString", List(TermParamClause(Nil)), Inferred(), Some(Apply(Ident("_toString"), List(This(Some("Foo")))))), DefDef("canEqual", List(TermParamClause(List(ValDef("that", Inferred(), None)))), Inferred(), Some(TypeApply(Select(Ident("that"), "isInstanceOf"), List(Inferred())))), DefDef("productArity", Nil, Inferred(), Some(Literal(IntConstant(0)))), DefDef("productPrefix", Nil, Inferred(), Some(Literal(StringConstant("Foo")))), DefDef("productElement", List(TermParamClause(List(ValDef("n", Inferred(), None)))), Inferred(), Some(Match(Ident("n"), List(CaseDef(Ident("_"), None, Apply(Ident("throw"), List(Apply(Select(New(Inferred()), ""), List(Apply(Select(Ident("n"), "toString"), Nil)))))))))), DefDef("productElementName", List(TermParamClause(List(ValDef("n", Inferred(), None)))), Inferred(), Some(Match(Ident("n"), List(CaseDef(Ident("_"), None, Apply(Ident("throw"), List(Apply(Select(New(Inferred()), ""), List(Apply(Select(Ident("n"), "toString"), Nil)))))))))), DefDef("copy", List(TermParamClause(Nil)), Inferred(), Some(Apply(Select(New(Inferred()), ""), Nil))))), ValDef("Foo", TypeIdent("Foo$"), Some(Apply(Select(New(TypeIdent("Foo$")), ""), Nil))), ClassDef("Foo$", DefDef("", List(TermParamClause(Nil)), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil), Inferred()), Nil, Some(ValDef("_", Singleton(Ident("Foo")), None)), List(DefDef("apply", List(TermParamClause(Nil)), Inferred(), Some(Apply(Select(New(Inferred()), ""), Nil))), DefDef("unapply", List(TermParamClause(List(ValDef("x$1", Inferred(), None)))), Singleton(Literal(BooleanConstant(true))), Some(Literal(BooleanConstant(true)))), DefDef("toString", Nil, Inferred(), Some(Literal(StringConstant("Foo")))), TypeDef("MirroredMonoType", TypeBoundsTree(Inferred(), Inferred())), DefDef("fromProduct", List(TermParamClause(List(ValDef("x$0", Inferred(), None)))), Inferred(), Some(Apply(Select(New(Inferred()), ""), Nil)))))), Literal(UnitConstant()))) TypeRef(ThisType(TypeRef(NoPrefix(), "scala")), "Unit") Inlined(None, Nil, Block(List(ClassDef("Foo1", DefDef("", List(TermParamClause(List(ValDef("a", TypeIdent("Int"), None)))), Inferred(), None), List(Apply(Select(New(Inferred()), ""), Nil)), Nil, None, List(ValDef("a", Inferred(), None)))), Literal(UnitConstant()))) diff --git a/tests/run-macros/tasty-extractors-2/quoted_1.scala b/tests/run-macros/tasty-extractors-2/quoted_1.scala index 83e401e09cf7..14491d16ed0e 100644 --- a/tests/run-macros/tasty-extractors-2/quoted_1.scala +++ b/tests/run-macros/tasty-extractors-2/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -6,7 +6,7 @@ object Macros { ${ impl('x) } def impl[T](x: Expr[T])(using q: Quotes) : Expr[Unit] = { - import q.reflect._ + import q.reflect.* val tree = x.asTerm diff --git a/tests/run-macros/tasty-extractors-2/quoted_2.scala b/tests/run-macros/tasty-extractors-2/quoted_2.scala index f2e9908649b9..9a0b21d49855 100644 --- a/tests/run-macros/tasty-extractors-2/quoted_2.scala +++ b/tests/run-macros/tasty-extractors-2/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-extractors-3/quoted_1.scala b/tests/run-macros/tasty-extractors-3/quoted_1.scala index 6f20cb701bd1..435a0b70a351 100644 --- a/tests/run-macros/tasty-extractors-3/quoted_1.scala +++ b/tests/run-macros/tasty-extractors-3/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -7,7 +7,7 @@ object Macros { ${impl('x)} def impl[T](x: Expr[T])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val buff = new StringBuilder val traverser = new TreeTraverser { diff --git a/tests/run-macros/tasty-extractors-3/quoted_2.scala b/tests/run-macros/tasty-extractors-3/quoted_2.scala index 3a5676a765fe..c58b4ad25080 100644 --- a/tests/run-macros/tasty-extractors-3/quoted_2.scala +++ b/tests/run-macros/tasty-extractors-3/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-extractors-constants-1/quoted_1.scala b/tests/run-macros/tasty-extractors-constants-1/quoted_1.scala index 2616f626a6c7..f106dd843566 100644 --- a/tests/run-macros/tasty-extractors-constants-1/quoted_1.scala +++ b/tests/run-macros/tasty-extractors-constants-1/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* diff --git a/tests/run-macros/tasty-extractors-types/quoted_1.scala b/tests/run-macros/tasty-extractors-types/quoted_1.scala index 626f5f0acf57..e59407f3ab2b 100644 --- a/tests/run-macros/tasty-extractors-types/quoted_1.scala +++ b/tests/run-macros/tasty-extractors-types/quoted_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { implicit inline def printType[T]: Unit = ${ impl[T] } def impl[T: Type](using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* '{ println(${Expr(TypeTree.of[T].show(using Printer.TreeStructure))}) println(${Expr(TypeRepr.of[T].show(using Printer.TypeReprStructure))}) diff --git a/tests/run-macros/tasty-extractors-types/quoted_2.scala b/tests/run-macros/tasty-extractors-types/quoted_2.scala index 6e19f6cb53a8..b65e5df59c3a 100644 --- a/tests/run-macros/tasty-extractors-types/quoted_2.scala +++ b/tests/run-macros/tasty-extractors-types/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-getfile-implicit-by-name-fun-context/Macro_1.scala b/tests/run-macros/tasty-getfile-implicit-by-name-fun-context/Macro_1.scala index 6fc28ac4403f..bb478331aa64 100644 --- a/tests/run-macros/tasty-getfile-implicit-by-name-fun-context/Macro_1.scala +++ b/tests/run-macros/tasty-getfile-implicit-by-name-fun-context/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object SourceFiles { diff --git a/tests/run-macros/tasty-getfile-implicit-fun-context/Macro_1.scala b/tests/run-macros/tasty-getfile-implicit-fun-context/Macro_1.scala index eab7808ac0fb..d0835e186bfd 100644 --- a/tests/run-macros/tasty-getfile-implicit-fun-context/Macro_1.scala +++ b/tests/run-macros/tasty-getfile-implicit-fun-context/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object SourceFiles { diff --git a/tests/run-macros/tasty-getfile/Macro_1.scala b/tests/run-macros/tasty-getfile/Macro_1.scala index 5e9ccb58e1f0..e0d61b3c6659 100644 --- a/tests/run-macros/tasty-getfile/Macro_1.scala +++ b/tests/run-macros/tasty-getfile/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object SourceFiles { diff --git a/tests/run-macros/tasty-implicit-fun-context-2/Macro_1.scala b/tests/run-macros/tasty-implicit-fun-context-2/Macro_1.scala index ab3a214605db..d99132b853f3 100644 --- a/tests/run-macros/tasty-implicit-fun-context-2/Macro_1.scala +++ b/tests/run-macros/tasty-implicit-fun-context-2/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Foo { diff --git a/tests/run-macros/tasty-indexed-map/quoted_1.scala b/tests/run-macros/tasty-indexed-map/quoted_1.scala index 999d56f7f95e..7cbd7d71d542 100644 --- a/tests/run-macros/tasty-indexed-map/quoted_1.scala +++ b/tests/run-macros/tasty-indexed-map/quoted_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* class MyMap[Keys](private val underlying: Array[Int]) extends AnyVal { def get[K <: String](implicit i: Index[K, Keys]): Int = underlying(i.index) @@ -25,7 +25,7 @@ object Index { implicit inline def succ[K, H, T](implicit prev: => Index[K, T]): Index[K, (H, T)] = ${succImpl[K, H, T]} def succImpl[K, H, T](implicit qctx: Quotes, k: Type[K], h: Type[H], t: Type[T]): Expr[Index[K, (H, T)]] = { - import quotes.reflect._ + import quotes.reflect.* def name(tp: TypeRepr): String = tp match { case ConstantType(StringConstant(str)) => str diff --git a/tests/run-macros/tasty-interpolation-1/Macro.scala b/tests/run-macros/tasty-interpolation-1/Macro.scala index bf5ab7091f1c..4baa52aa2b90 100644 --- a/tests/run-macros/tasty-interpolation-1/Macro.scala +++ b/tests/run-macros/tasty-interpolation-1/Macro.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* import scala.language.implicitConversions object Macro { @@ -55,7 +55,7 @@ abstract class MacroStringInterpolator[T] { protected def interpolate(strCtx: StringContext, argExprs: List[Expr[Any]]) (using Quotes): Expr[T] protected def getStaticStringContext(strCtxExpr: Expr[StringContext])(using Quotes) : StringContext = { - import quotes.reflect._ + import quotes.reflect.* strCtxExpr.asTerm.underlyingArgument match { case Select(Typed(Apply(_, List(Apply(_, List(Typed(Repeated(strCtxArgTrees, _), Inferred()))))), _), _) => val strCtxArgs = strCtxArgTrees.map { @@ -69,7 +69,7 @@ abstract class MacroStringInterpolator[T] { } protected def getArgsList(argsExpr: Expr[Seq[Any]])(using Quotes) : List[Expr[Any]] = { - import quotes.reflect._ + import quotes.reflect.* argsExpr.asTerm.underlyingArgument match { case Typed(Repeated(args, _), _) => args.map(_.asExpr) case tree => throw new NotStaticlyKnownError("Expected statically known argument list", tree.asExpr) diff --git a/tests/run-macros/tasty-interpolation-1/Test_2.scala b/tests/run-macros/tasty-interpolation-1/Test_2.scala index 716adac21f45..eba94ccce355 100644 --- a/tests/run-macros/tasty-interpolation-1/Test_2.scala +++ b/tests/run-macros/tasty-interpolation-1/Test_2.scala @@ -1,4 +1,4 @@ -import Macro._ +import Macro.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-linenumber-2/quoted_1.scala b/tests/run-macros/tasty-linenumber-2/quoted_1.scala index 6205e871457b..39e40fda8556 100644 --- a/tests/run-macros/tasty-linenumber-2/quoted_1.scala +++ b/tests/run-macros/tasty-linenumber-2/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class LineNumber(val value: Int) { override def toString: String = value.toString @@ -9,7 +9,7 @@ object LineNumber { implicit inline def line: LineNumber = ${lineImpl} def lineImpl(using Quotes) : Expr[LineNumber] = { - import quotes.reflect._ + import quotes.reflect.* '{new LineNumber(${Expr(Position.ofMacroExpansion.startLine)})} } diff --git a/tests/run-macros/tasty-linenumber-2/quoted_2.scala b/tests/run-macros/tasty-linenumber-2/quoted_2.scala index 253f4f85ead9..3682de15f841 100644 --- a/tests/run-macros/tasty-linenumber-2/quoted_2.scala +++ b/tests/run-macros/tasty-linenumber-2/quoted_2.scala @@ -1,5 +1,5 @@ -import LineNumber._ +import LineNumber.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-linenumber/quoted_1.scala b/tests/run-macros/tasty-linenumber/quoted_1.scala index c6d71a1c60e8..3ed3c3b68fd9 100644 --- a/tests/run-macros/tasty-linenumber/quoted_1.scala +++ b/tests/run-macros/tasty-linenumber/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* class LineNumber(val value: Int) { override def toString: String = value.toString @@ -10,7 +10,7 @@ object LineNumber { ${lineImpl(Type.of[T])} def lineImpl(x: Type[Unit])(using Quotes) : Expr[LineNumber] = { - import quotes.reflect._ + import quotes.reflect.* '{new LineNumber(${Expr(Position.ofMacroExpansion.startLine)})} } diff --git a/tests/run-macros/tasty-linenumber/quoted_2.scala b/tests/run-macros/tasty-linenumber/quoted_2.scala index 253f4f85ead9..3682de15f841 100644 --- a/tests/run-macros/tasty-linenumber/quoted_2.scala +++ b/tests/run-macros/tasty-linenumber/quoted_2.scala @@ -1,5 +1,5 @@ -import LineNumber._ +import LineNumber.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-location/quoted_1.scala b/tests/run-macros/tasty-location/quoted_1.scala index ae84485437be..c7679c9493b5 100644 --- a/tests/run-macros/tasty-location/quoted_1.scala +++ b/tests/run-macros/tasty-location/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* case class Location(owners: List[String]) @@ -7,7 +7,7 @@ object Location { implicit inline def location: Location = ${impl} def impl(using Quotes) : Expr[Location] = { - import quotes.reflect._ + import quotes.reflect.* def listOwnerNames(sym: Symbol, acc: List[String]): List[String] = if (sym == defn.RootClass || sym == defn.EmptyPackageClass) acc diff --git a/tests/run-macros/tasty-location/quoted_2.scala b/tests/run-macros/tasty-location/quoted_2.scala index 42589dc32db5..089d41f584e9 100644 --- a/tests/run-macros/tasty-location/quoted_2.scala +++ b/tests/run-macros/tasty-location/quoted_2.scala @@ -1,5 +1,5 @@ -import Location._ +import Location.* object Test { val loc1 = location diff --git a/tests/run-macros/tasty-macro-assert/quoted_1.scala b/tests/run-macros/tasty-macro-assert/quoted_1.scala index da2afd1126b6..69cb7ceced5f 100644 --- a/tests/run-macros/tasty-macro-assert/quoted_1.scala +++ b/tests/run-macros/tasty-macro-assert/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Asserts { @@ -13,7 +13,7 @@ object Asserts { ${impl('cond)} def impl(cond: Expr[Boolean])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val tree = cond.asTerm diff --git a/tests/run-macros/tasty-macro-assert/quoted_2.scala b/tests/run-macros/tasty-macro-assert/quoted_2.scala index 06fb973ca4bd..32b5aab0cbc7 100644 --- a/tests/run-macros/tasty-macro-assert/quoted_2.scala +++ b/tests/run-macros/tasty-macro-assert/quoted_2.scala @@ -1,5 +1,5 @@ -import Asserts._ +import Asserts.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-macro-const/quoted_1.scala b/tests/run-macros/tasty-macro-const/quoted_1.scala index 6f33602e4a48..337183e16df4 100644 --- a/tests/run-macros/tasty-macro-const/quoted_1.scala +++ b/tests/run-macros/tasty-macro-const/quoted_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def natConst(x: Int): Int = ${ natConstImpl('x) } def natConstImpl(x: Expr[Int])(using Quotes) : Expr[Int] = { - import quotes.reflect._ + import quotes.reflect.* val xTree: Term = x.asTerm xTree match { case Inlined(_, _, Literal(IntConstant(n))) => diff --git a/tests/run-macros/tasty-macro-const/quoted_2.scala b/tests/run-macros/tasty-macro-const/quoted_2.scala index 101f5a6488c6..2c8ea5f3f816 100644 --- a/tests/run-macros/tasty-macro-const/quoted_2.scala +++ b/tests/run-macros/tasty-macro-const/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-macro-positions/quoted_1.scala b/tests/run-macros/tasty-macro-positions/quoted_1.scala index e0f7f02e9760..d53cd16088b9 100644 --- a/tests/run-macros/tasty-macro-positions/quoted_1.scala +++ b/tests/run-macros/tasty-macro-positions/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -9,7 +9,7 @@ object Macros { inline def fun3[T]: Unit = ${ impl2(using Type.of[T]) } def impl(x: Expr[Any])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val pos = posStr(x.asTerm.underlyingArgument.pos) val code = x.asTerm.underlyingArgument.show '{ @@ -19,7 +19,7 @@ object Macros { } def impl2[T](using x: Type[T])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val pos = posStr(TypeTree.of[T].pos) val code = TypeTree.of[T].show '{ @@ -29,7 +29,7 @@ object Macros { } def posStr(using Quotes)(pos: quotes.reflect.Position): Expr[String] = { - import quotes.reflect._ + import quotes.reflect.* Expr(s"${pos.sourceFile.jpath.getFileName.toString}:[${pos.start}..${pos.end}]") } } diff --git a/tests/run-macros/tasty-macro-positions/quoted_2.scala b/tests/run-macros/tasty-macro-positions/quoted_2.scala index 105dfe581364..ebd032d4417d 100644 --- a/tests/run-macros/tasty-macro-positions/quoted_2.scala +++ b/tests/run-macros/tasty-macro-positions/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-original-source/Macros_1.scala b/tests/run-macros/tasty-original-source/Macros_1.scala index fc733e3037ae..07d1f8e42e96 100644 --- a/tests/run-macros/tasty-original-source/Macros_1.scala +++ b/tests/run-macros/tasty-original-source/Macros_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { implicit inline def withSource(arg: Any): (String, Any) = ${ impl('arg) } private def impl(arg: Expr[Any])(using Quotes) : Expr[(String, Any)] = { - import quotes.reflect._ + import quotes.reflect.* val source = Expr(arg.asTerm.underlyingArgument.pos.sourceCode.get.toString) '{Tuple2($source, $arg)} } diff --git a/tests/run-macros/tasty-original-source/Test_2.scala b/tests/run-macros/tasty-original-source/Test_2.scala index 9a49456af140..2aae18d26d24 100644 --- a/tests/run-macros/tasty-original-source/Test_2.scala +++ b/tests/run-macros/tasty-original-source/Test_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-overload-secondargs/Macro_1.scala b/tests/run-macros/tasty-overload-secondargs/Macro_1.scala index 91c74945c92b..6967116c01ba 100644 --- a/tests/run-macros/tasty-overload-secondargs/Macro_1.scala +++ b/tests/run-macros/tasty-overload-secondargs/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object X: @@ -22,7 +22,7 @@ object Macro: } def mThenImpl[A:Type, B:Type, S<:(A=>B) :Type, R:Type](x:Expr[S])(using Quotes):Expr[R] = - import quotes.reflect._ + import quotes.reflect.* val fun = '{X}.asTerm val returnType = TypeRepr.of[(S) => ?] val firstPart = Select.overloaded(fun,"andThen", diff --git a/tests/run-macros/tasty-positioned/quoted_1.scala b/tests/run-macros/tasty-positioned/quoted_1.scala index 50c5c79911ae..e6664c6a1774 100644 --- a/tests/run-macros/tasty-positioned/quoted_1.scala +++ b/tests/run-macros/tasty-positioned/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* case class Position(path: String, start: Int, end: Int, startLine: Int, startColumn: Int, endLine: Int, endColumn: Int) @@ -10,7 +10,7 @@ object Positioned { implicit inline def apply[T](x: => T): Positioned[T] = ${impl('x)} def impl[T](x: Expr[T])(implicit ev: Type[T], qctx: Quotes): Expr[Positioned[T]] = { - import quotes.reflect.{Position => Pos, _} + import quotes.reflect.{Position as Pos, *} val pos = Pos.ofMacroExpansion val path = Expr(pos.sourceFile.jpath.toString) diff --git a/tests/run-macros/tasty-positioned/quoted_2.scala b/tests/run-macros/tasty-positioned/quoted_2.scala index 2ef194c72f63..a39449ea2f37 100644 --- a/tests/run-macros/tasty-positioned/quoted_2.scala +++ b/tests/run-macros/tasty-positioned/quoted_2.scala @@ -1,5 +1,5 @@ -import Positioned._ +import Positioned.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-seal-method/quoted_1.scala b/tests/run-macros/tasty-seal-method/quoted_1.scala index 735270480998..bcedc1d08515 100644 --- a/tests/run-macros/tasty-seal-method/quoted_1.scala +++ b/tests/run-macros/tasty-seal-method/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Asserts { @@ -7,7 +7,7 @@ object Asserts { /** Replaces last argument list by 0s */ def zeroLastArgsImpl(x: Expr[Int])(using Quotes) : Expr[Int] = { - import quotes.reflect._ + import quotes.reflect.* // For simplicity assumes that all parameters are Int and parameter lists have no more than 3 elements x.asTerm.underlyingArgument match { case Apply(fn, args) => @@ -29,7 +29,7 @@ object Asserts { /** Replaces all argument list by 0s */ def zeroAllArgsImpl(x: Expr[Int])(using Quotes) : Expr[Int] = { - import quotes.reflect._ + import quotes.reflect.* // For simplicity assumes that all parameters are Int and parameter lists have no more than 3 elements def rec(term: Term): Term = term match { case Apply(fn, args) => diff --git a/tests/run-macros/tasty-seal-method/quoted_2.scala b/tests/run-macros/tasty-seal-method/quoted_2.scala index e4f34a4615d0..4232bf008209 100644 --- a/tests/run-macros/tasty-seal-method/quoted_2.scala +++ b/tests/run-macros/tasty-seal-method/quoted_2.scala @@ -1,5 +1,5 @@ -import Asserts._ +import Asserts.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/tasty-simplified/quoted_1.scala b/tests/run-macros/tasty-simplified/quoted_1.scala index bf3b2e2287d8..6635f5afd7c7 100644 --- a/tests/run-macros/tasty-simplified/quoted_1.scala +++ b/tests/run-macros/tasty-simplified/quoted_1.scala @@ -1,12 +1,12 @@ import scala.annotation.tailrec -import scala.quoted._ +import scala.quoted.* object Macros { inline def simplified[T <: Tuple]: Seq[String] = ${ impl[T] } def impl[T: Type](using Quotes) : Expr[Seq[String]] = { - import quotes.reflect._ + import quotes.reflect.* def unpackTuple(tp: TypeRepr): List[TypeRepr] = { @tailrec diff --git a/tests/run-macros/tasty-string-interpolation-reporter-test/Macros_1.scala b/tests/run-macros/tasty-string-interpolation-reporter-test/Macros_1.scala index 23cca5a1ba7a..14d43bd98657 100644 --- a/tests/run-macros/tasty-string-interpolation-reporter-test/Macros_1.scala +++ b/tests/run-macros/tasty-string-interpolation-reporter-test/Macros_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.language.implicitConversions @@ -23,7 +23,7 @@ object Macro { case ('{ StringContext(${Varargs(parts)}*) }, Varargs(args)) => val reporter = new Reporter { def errorOnPart(msg: String, partIdx: Int): Unit = { - import quotes.reflect._ + import quotes.reflect.* report.error(msg, parts(partIdx).asTerm.pos) } } @@ -37,7 +37,7 @@ object Macro { val errors = List.newBuilder[Expr[(Int, Int, Int, String)]] val reporter = new Reporter { def errorOnPart(msg: String, partIdx: Int): Unit = { - import quotes.reflect._ + import quotes.reflect.* val pos = parts(partIdx).asTerm.pos errors += '{ Tuple4(${Expr(partIdx)}, ${Expr(pos.start)}, ${Expr(pos.end)}, ${Expr(msg)}) } } diff --git a/tests/run-macros/tasty-string-interpolation-reporter-test/Test_2.scala b/tests/run-macros/tasty-string-interpolation-reporter-test/Test_2.scala index 8b9424bfecb0..2e459e98f290 100644 --- a/tests/run-macros/tasty-string-interpolation-reporter-test/Test_2.scala +++ b/tests/run-macros/tasty-string-interpolation-reporter-test/Test_2.scala @@ -7,12 +7,12 @@ object Test { } def posTests() = { - import Foo._ + import Foo.* assertEquals(foo"abc${"123"}def", "abc123def") } def negTests() = { - import TestFooErrors._ + import TestFooErrors.* assertEquals(foo"a#c${"123"}def", List((0, 256, 259, "Cannot use #"))) assertEquals(foo"abc${"123"}#ef", List((1, 342, 345, "Cannot use #"))) assertEquals(foo"a#c${"123"}#ef", List((0, 406, 409, "Cannot use #"), (1, 417, 420, "Cannot use #"))) diff --git a/tests/run-macros/tasty-subtyping/quoted_1.scala b/tests/run-macros/tasty-subtyping/quoted_1.scala index 3622d1277f54..bf3cc844f6c7 100644 --- a/tests/run-macros/tasty-subtyping/quoted_1.scala +++ b/tests/run-macros/tasty-subtyping/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -9,13 +9,13 @@ object Macros { ${isSubTypeOfImpl[T, U]} def isTypeEqualImpl[T: Type, U: Type](using Quotes) : Expr[Boolean] = { - import quotes.reflect._ + import quotes.reflect.* val isTypeEqual = TypeRepr.of[T] =:= TypeRepr.of[U] Expr(isTypeEqual) } def isSubTypeOfImpl[T: Type, U: Type](using Quotes) : Expr[Boolean] = { - import quotes.reflect._ + import quotes.reflect.* val isTypeEqual = TypeRepr.of[T] <:< TypeRepr.of[U] Expr(isTypeEqual) } diff --git a/tests/run-macros/tasty-subtyping/quoted_2.scala b/tests/run-macros/tasty-subtyping/quoted_2.scala index 1223787c2d1e..57f7eec3a25f 100644 --- a/tests/run-macros/tasty-subtyping/quoted_2.scala +++ b/tests/run-macros/tasty-subtyping/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { type A diff --git a/tests/run-macros/tasty-tree-map/quoted_1.scala b/tests/run-macros/tasty-tree-map/quoted_1.scala index a4363f60b599..e502d845591e 100644 --- a/tests/run-macros/tasty-tree-map/quoted_1.scala +++ b/tests/run-macros/tasty-tree-map/quoted_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros: implicit inline def identityMaped[T](x: => T): T = ${ MacrosImpl.impl('x) } object MacrosImpl: def impl[T: Type](x: Expr[T])(using Quotes) : Expr[T] = { - import quotes.reflect._ + import quotes.reflect.* val identityMap = new TreeMap { } val transformed = identityMap.transformTerm(x.asTerm)(Symbol.spliceOwner).asExprOf[T] transformed diff --git a/tests/run-macros/tasty-tree-map/quoted_2.scala b/tests/run-macros/tasty-tree-map/quoted_2.scala index 40e8aeaa7386..85923f1471f9 100644 --- a/tests/run-macros/tasty-tree-map/quoted_2.scala +++ b/tests/run-macros/tasty-tree-map/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* class Annot extends scala.annotation.Annotation @@ -30,7 +30,7 @@ object Test { println(identityMaped({ def f(a: Int*): Int = a.sum; f(47, 1) })) println(identityMaped(((a: Int) => a)(49))) println(identityMaped({ type A = Int; 50: A })) - println(identityMaped({ import scala.{Int => I}; 51: I })) + println(identityMaped({ import scala.{Int as I}; 51: I })) println(identityMaped(52 match { case x => x })) println(identityMaped(53 match { case x: Int => x })) println(identityMaped((0: Any) match { case _: Int | _: Double => 54 })) diff --git a/tests/run-macros/tasty-typeof/Macro_1.scala b/tests/run-macros/tasty-typeof/Macro_1.scala index fdc54f5cd844..005e8f5a96a1 100644 --- a/tests/run-macros/tasty-typeof/Macro_1.scala +++ b/tests/run-macros/tasty-typeof/Macro_1.scala @@ -1,11 +1,11 @@ -import scala.quoted._ +import scala.quoted.* object Macros { inline def testTypeOf(): Unit = ${ testTypeOfImpl } private def testTypeOfImpl(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* '{ assert(${Expr(TypeRepr.of[Unit] =:= TypeRepr.of[Unit])}, "Unit") assert(${Expr(TypeRepr.of[Byte] =:= TypeRepr.of[Byte])}, "Byte") diff --git a/tests/run-macros/tasty-unsafe-let/quoted_1.scala b/tests/run-macros/tasty-unsafe-let/quoted_1.scala index fe8b3c7b86d2..1f366506f768 100644 --- a/tests/run-macros/tasty-unsafe-let/quoted_1.scala +++ b/tests/run-macros/tasty-unsafe-let/quoted_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object Macros { @@ -6,11 +6,11 @@ object Macros { ${ impl('rhs, 'body) } private def impl[T: Type](rhs: Expr[T], body: Expr[T => Unit])(using Quotes) : Expr[Unit] = { - import quotes.reflect._ + import quotes.reflect.* val rhsTerm = rhs.asTerm - import quotes.reflect._ + import quotes.reflect.* ValDef.let(Symbol.spliceOwner, rhsTerm) { rhsId => Expr.betaReduce('{$body(${rhsId.asExpr.asInstanceOf[Expr[T]]})}).asTerm // Dangerous uncheked cast! }.asExprOf[Unit] diff --git a/tests/run-macros/tasty-unsafe-let/quoted_2.scala b/tests/run-macros/tasty-unsafe-let/quoted_2.scala index 10189f718ff9..5b19696d00ff 100644 --- a/tests/run-macros/tasty-unsafe-let/quoted_2.scala +++ b/tests/run-macros/tasty-unsafe-let/quoted_2.scala @@ -1,5 +1,5 @@ -import Macros._ +import Macros.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/type-show/Macro_1.scala b/tests/run-macros/type-show/Macro_1.scala index c20f592dbfef..57a74a3a24f9 100644 --- a/tests/run-macros/type-show/Macro_1.scala +++ b/tests/run-macros/type-show/Macro_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* object TypeToolbox { inline def show[A]: String = ${ showImpl[A] } diff --git a/tests/run-macros/type-show/Test_2.scala b/tests/run-macros/type-show/Test_2.scala index 471d19840338..ee33205413f1 100644 --- a/tests/run-macros/type-show/Test_2.scala +++ b/tests/run-macros/type-show/Test_2.scala @@ -1,6 +1,6 @@ object Test { - import TypeToolbox._ + import TypeToolbox.* def main(args: Array[String]): Unit = { val x = 5 assert(show[x.type] == "x.type") diff --git a/tests/run-macros/whitebox-inline-macro/Macro_1.scala b/tests/run-macros/whitebox-inline-macro/Macro_1.scala new file mode 100644 index 000000000000..bac54fe3301c --- /dev/null +++ b/tests/run-macros/whitebox-inline-macro/Macro_1.scala @@ -0,0 +1,11 @@ +import scala.quoted._ + +object Macros { + + inline def blackbox: Int = ${one} + + transparent inline def whitebox: Int = ${one} + + private def one(using Quotes): Expr[Int] = Expr(1) + +} diff --git a/tests/run-macros/whitebox-inline-macro/Test_2.scala b/tests/run-macros/whitebox-inline-macro/Test_2.scala new file mode 100644 index 000000000000..07f6bea5319b --- /dev/null +++ b/tests/run-macros/whitebox-inline-macro/Test_2.scala @@ -0,0 +1,12 @@ +import scala.quoted._ +import Macros._ + +object Test { + def main(args: Array[String]): Unit = { + val a: Int = blackbox + val b: 1 = whitebox + + assert(a == 1) + assert(b == 1) + } +} diff --git a/tests/run-macros/xml-interpolation-1/Test_2.scala b/tests/run-macros/xml-interpolation-1/Test_2.scala index 9a3d8d64161b..2d51c6433097 100644 --- a/tests/run-macros/xml-interpolation-1/Test_2.scala +++ b/tests/run-macros/xml-interpolation-1/Test_2.scala @@ -1,4 +1,4 @@ -import XmlQuote._ +import XmlQuote.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/xml-interpolation-1/XmlQuote_1.scala b/tests/run-macros/xml-interpolation-1/XmlQuote_1.scala index 9a359bcfc661..81ec927c3338 100644 --- a/tests/run-macros/xml-interpolation-1/XmlQuote_1.scala +++ b/tests/run-macros/xml-interpolation-1/XmlQuote_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.language.implicitConversions @@ -13,7 +13,7 @@ object XmlQuote { def impl(receiver: Expr[SCOps], args: Expr[Seq[Any]]) (using Quotes) : Expr[Xml] = { - import quotes.reflect._ + import quotes.reflect.* // for debugging purpose def pp(tree: Tree): Unit = { diff --git a/tests/run-macros/xml-interpolation-2/Test_2.scala b/tests/run-macros/xml-interpolation-2/Test_2.scala index ef060d87e864..c1be23324695 100644 --- a/tests/run-macros/xml-interpolation-2/Test_2.scala +++ b/tests/run-macros/xml-interpolation-2/Test_2.scala @@ -1,4 +1,4 @@ -import XmlQuote._ +import XmlQuote.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/xml-interpolation-2/XmlQuote_1.scala b/tests/run-macros/xml-interpolation-2/XmlQuote_1.scala index 47bb2b079548..1aba40352092 100644 --- a/tests/run-macros/xml-interpolation-2/XmlQuote_1.scala +++ b/tests/run-macros/xml-interpolation-2/XmlQuote_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* import scala.language.implicitConversions @@ -14,7 +14,7 @@ object XmlQuote { implicit inline def SCOps(ctx: => StringContext): SCOps = new SCOps(ctx) def impl(receiver: Expr[SCOps], args: Expr[Seq[Any]])(using Quotes) : Expr[Xml] = { - import quotes.reflect._ + import quotes.reflect.* // for debugging purpose def pp(tree: Tree): Unit = { diff --git a/tests/run-macros/xml-interpolation-3/Test_2.scala b/tests/run-macros/xml-interpolation-3/Test_2.scala index 9a3d8d64161b..2d51c6433097 100644 --- a/tests/run-macros/xml-interpolation-3/Test_2.scala +++ b/tests/run-macros/xml-interpolation-3/Test_2.scala @@ -1,4 +1,4 @@ -import XmlQuote._ +import XmlQuote.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/xml-interpolation-3/XmlQuote_1.scala b/tests/run-macros/xml-interpolation-3/XmlQuote_1.scala index 0dae5174e017..5f3505be3fe7 100644 --- a/tests/run-macros/xml-interpolation-3/XmlQuote_1.scala +++ b/tests/run-macros/xml-interpolation-3/XmlQuote_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.language.implicitConversions diff --git a/tests/run-macros/xml-interpolation-4/Macros_1.scala b/tests/run-macros/xml-interpolation-4/Macros_1.scala index ef0416817acd..48930ea47f12 100644 --- a/tests/run-macros/xml-interpolation-4/Macros_1.scala +++ b/tests/run-macros/xml-interpolation-4/Macros_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.language.implicitConversions diff --git a/tests/run-macros/xml-interpolation-4/Test_2.scala b/tests/run-macros/xml-interpolation-4/Test_2.scala index 58a2e4d8a05c..89746f4a7592 100644 --- a/tests/run-macros/xml-interpolation-4/Test_2.scala +++ b/tests/run-macros/xml-interpolation-4/Test_2.scala @@ -1,4 +1,4 @@ -import XmlQuote._ +import XmlQuote.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/xml-interpolation-5/Macros_1.scala b/tests/run-macros/xml-interpolation-5/Macros_1.scala index 889696b0335f..b5cd9cb768ca 100644 --- a/tests/run-macros/xml-interpolation-5/Macros_1.scala +++ b/tests/run-macros/xml-interpolation-5/Macros_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.language.implicitConversions diff --git a/tests/run-macros/xml-interpolation-5/Test_2.scala b/tests/run-macros/xml-interpolation-5/Test_2.scala index 37549d857ddb..f822ef37e560 100644 --- a/tests/run-macros/xml-interpolation-5/Test_2.scala +++ b/tests/run-macros/xml-interpolation-5/Test_2.scala @@ -1,4 +1,4 @@ -import XmlQuote._ +import XmlQuote.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/xml-interpolation-6/Macros_1.scala b/tests/run-macros/xml-interpolation-6/Macros_1.scala index f723a57123c1..2660d0aef623 100644 --- a/tests/run-macros/xml-interpolation-6/Macros_1.scala +++ b/tests/run-macros/xml-interpolation-6/Macros_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.language.implicitConversions diff --git a/tests/run-macros/xml-interpolation-6/Test_2.scala b/tests/run-macros/xml-interpolation-6/Test_2.scala index 37549d857ddb..f822ef37e560 100644 --- a/tests/run-macros/xml-interpolation-6/Test_2.scala +++ b/tests/run-macros/xml-interpolation-6/Test_2.scala @@ -1,4 +1,4 @@ -import XmlQuote._ +import XmlQuote.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-macros/xml-interpolation-7/Macros_1.scala b/tests/run-macros/xml-interpolation-7/Macros_1.scala index d41af1bb8d2e..854e20d3c592 100644 --- a/tests/run-macros/xml-interpolation-7/Macros_1.scala +++ b/tests/run-macros/xml-interpolation-7/Macros_1.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.language.implicitConversions diff --git a/tests/run-macros/xml-interpolation-7/Test_2.scala b/tests/run-macros/xml-interpolation-7/Test_2.scala index 367ead05b0a8..296ad2598827 100644 --- a/tests/run-macros/xml-interpolation-7/Test_2.scala +++ b/tests/run-macros/xml-interpolation-7/Test_2.scala @@ -1,4 +1,4 @@ -import XmlQuote._ +import XmlQuote.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-staging/abstract-int-quote.scala b/tests/run-staging/abstract-int-quote.scala index c3070086104b..4f034909c0ff 100644 --- a/tests/run-staging/abstract-int-quote.scala +++ b/tests/run-staging/abstract-int-quote.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test: diff --git a/tests/run-staging/expr-matches.scala b/tests/run-staging/expr-matches.scala index 58eec89f2ace..4e53e0f9a3d2 100644 --- a/tests/run-staging/expr-matches.scala +++ b/tests/run-staging/expr-matches.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/i11152.scala b/tests/run-staging/i11152.scala index 6edfab3e85b6..3ebfae25e2f0 100644 --- a/tests/run-staging/i11152.scala +++ b/tests/run-staging/i11152.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/i11184.scala b/tests/run-staging/i11184.scala new file mode 100644 index 000000000000..5ef3e2a037a7 --- /dev/null +++ b/tests/run-staging/i11184.scala @@ -0,0 +1,22 @@ +import scala.quoted._ + +object Test { + def main(args: Array[String]): Unit = { + given staging.Compiler = staging.Compiler.make(getClass.getClassLoader) + staging.run(genCode) + } +} + +inline def isTrue1: Boolean = true + +object Foo: + inline def isTrue2: Boolean = true + +inline def isTrue3(): Boolean = true + +inline def oneOf: String = + inline if isTrue1 then "foo" else "bar" + inline if Foo.isTrue2 then "foo" else "bar" + inline if isTrue3() then "foo" else "bar" + +def genCode(using Quotes) = '{ oneOf } diff --git a/tests/run-staging/i3823-b.scala b/tests/run-staging/i3823-b.scala index 5e45612bb15f..6169ff118dda 100644 --- a/tests/run-staging/i3823-b.scala +++ b/tests/run-staging/i3823-b.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { diff --git a/tests/run-staging/i3823-c.scala b/tests/run-staging/i3823-c.scala index bc60ed26ce8e..ce511ea20607 100644 --- a/tests/run-staging/i3823-c.scala +++ b/tests/run-staging/i3823-c.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { diff --git a/tests/run-staging/i3823.scala b/tests/run-staging/i3823.scala index 67c96f3f6637..55a9947a144a 100644 --- a/tests/run-staging/i3823.scala +++ b/tests/run-staging/i3823.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { diff --git a/tests/run-staging/i3847-b.scala b/tests/run-staging/i3847-b.scala index 089927bb7c5b..838dbc6cc4b1 100644 --- a/tests/run-staging/i3847-b.scala +++ b/tests/run-staging/i3847-b.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* import scala.reflect.ClassTag object Arrays { @@ -16,7 +16,7 @@ object Arrays { object Test { given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { - import Arrays._ + import Arrays.* implicit val ct: Expr[ClassTag[Int]] = '{ClassTag.Int} val arr: Expr[Array[List[Int]]] = Expr(Array[List[Int]](List(1, 2, 3))) println(arr.show) diff --git a/tests/run-staging/i3847.scala b/tests/run-staging/i3847.scala index 5c7c17decb9e..66f0d9c268bf 100644 --- a/tests/run-staging/i3847.scala +++ b/tests/run-staging/i3847.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* import scala.reflect.ClassTag object Arrays { @@ -16,7 +16,7 @@ object Arrays { object Test { implicit val toolbox: scala.quoted.staging.Compiler = scala.quoted.staging.Compiler.make(this.getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { - import Arrays._ + import Arrays.* implicit val ct: Expr[ClassTag[Int]] = '{ClassTag.Int} val arr: Expr[Array[Int]] = Expr(Array[Int](1, 2, 3)) println(arr.show) diff --git a/tests/run-staging/i3876-b.scala b/tests/run-staging/i3876-b.scala index c37026de4a31..eda1b6a77bd7 100644 --- a/tests/run-staging/i3876-b.scala +++ b/tests/run-staging/i3876-b.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3876-c.scala b/tests/run-staging/i3876-c.scala index 9995817303cc..de2be818b545 100644 --- a/tests/run-staging/i3876-c.scala +++ b/tests/run-staging/i3876-c.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { implicit def toolbox: scala.quoted.staging.Compiler = scala.quoted.staging.Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3876-d.scala b/tests/run-staging/i3876-d.scala index 87c9394f4e11..cd22aaf90400 100644 --- a/tests/run-staging/i3876-d.scala +++ b/tests/run-staging/i3876-d.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3876-e.scala b/tests/run-staging/i3876-e.scala index f9195a89c633..3950899c1f4c 100644 --- a/tests/run-staging/i3876-e.scala +++ b/tests/run-staging/i3876-e.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3876.scala b/tests/run-staging/i3876.scala index 0b3c4fdf7229..1e5f991257cc 100644 --- a/tests/run-staging/i3876.scala +++ b/tests/run-staging/i3876.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3946.scala b/tests/run-staging/i3946.scala index 768a22eb8a27..73aa4883e792 100644 --- a/tests/run-staging/i3946.scala +++ b/tests/run-staging/i3946.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3947.scala b/tests/run-staging/i3947.scala index 18dbde6803f8..cf83bae1ccb9 100644 --- a/tests/run-staging/i3947.scala +++ b/tests/run-staging/i3947.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/i3947b.scala b/tests/run-staging/i3947b.scala index 4692f98cd825..fb1d0f19d995 100644 --- a/tests/run-staging/i3947b.scala +++ b/tests/run-staging/i3947b.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/i3947b2.scala b/tests/run-staging/i3947b2.scala index aae1e363e325..33d76753b1a4 100644 --- a/tests/run-staging/i3947b2.scala +++ b/tests/run-staging/i3947b2.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/i3947b3.scala b/tests/run-staging/i3947b3.scala index ff69aeb5fd91..fd9ec26d15a6 100644 --- a/tests/run-staging/i3947b3.scala +++ b/tests/run-staging/i3947b3.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/i3947c.scala b/tests/run-staging/i3947c.scala index 5d676d784afc..963ff3750fbd 100644 --- a/tests/run-staging/i3947c.scala +++ b/tests/run-staging/i3947c.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3947d.scala b/tests/run-staging/i3947d.scala index e9bb565a3394..44c46ee169ef 100644 --- a/tests/run-staging/i3947d.scala +++ b/tests/run-staging/i3947d.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3947d2.scala b/tests/run-staging/i3947d2.scala index 9ad505021ddb..0108893a7b78 100644 --- a/tests/run-staging/i3947d2.scala +++ b/tests/run-staging/i3947d2.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3947e.scala b/tests/run-staging/i3947e.scala index 9e9c79858f56..64f4e51dfdda 100644 --- a/tests/run-staging/i3947e.scala +++ b/tests/run-staging/i3947e.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3947f.scala b/tests/run-staging/i3947f.scala index 8f5853f5dabe..8acbb2b9678b 100644 --- a/tests/run-staging/i3947f.scala +++ b/tests/run-staging/i3947f.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/i3947g.scala b/tests/run-staging/i3947g.scala index 2f0fb441976d..548566213321 100644 --- a/tests/run-staging/i3947g.scala +++ b/tests/run-staging/i3947g.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3947i.scala b/tests/run-staging/i3947i.scala index c44ca7813220..bc5151528de6 100644 --- a/tests/run-staging/i3947i.scala +++ b/tests/run-staging/i3947i.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3947j.scala b/tests/run-staging/i3947j.scala index ba2c1010acaa..19b7c4a7f77d 100644 --- a/tests/run-staging/i3947j.scala +++ b/tests/run-staging/i3947j.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i4044a.scala b/tests/run-staging/i4044a.scala index fffb3f582d6c..0915adfe7e69 100644 --- a/tests/run-staging/i4044a.scala +++ b/tests/run-staging/i4044a.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* class Foo { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i4044b.scala b/tests/run-staging/i4044b.scala index 562d74c5c6ba..35ee33f87931 100644 --- a/tests/run-staging/i4044b.scala +++ b/tests/run-staging/i4044b.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* sealed abstract class VarRef[T] { def update(expr: Expr[T])(using Quotes): Expr[Unit] diff --git a/tests/run-staging/i4044c.scala b/tests/run-staging/i4044c.scala index 1346e3b97b01..2a2839655ccb 100644 --- a/tests/run-staging/i4044c.scala +++ b/tests/run-staging/i4044c.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* class Foo { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i4044d.scala b/tests/run-staging/i4044d.scala index f3a7c6e6bebb..221582f68d6f 100644 --- a/tests/run-staging/i4044d.scala +++ b/tests/run-staging/i4044d.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* class Foo { def foo: Unit = { diff --git a/tests/run-staging/i4044e.scala b/tests/run-staging/i4044e.scala index 96b13eec7470..298e4703351b 100644 --- a/tests/run-staging/i4044e.scala +++ b/tests/run-staging/i4044e.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* class Foo { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i4044f.scala b/tests/run-staging/i4044f.scala index 1107428a3074..c3cc7686621e 100644 --- a/tests/run-staging/i4044f.scala +++ b/tests/run-staging/i4044f.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* class Foo { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i4350.scala b/tests/run-staging/i4350.scala index 3065042b3e49..9a488cd50086 100644 --- a/tests/run-staging/i4350.scala +++ b/tests/run-staging/i4350.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* class Foo[T: Type] { def q(using Quotes) = '{(null: Any).asInstanceOf[T]} diff --git a/tests/run-staging/i4591.scala b/tests/run-staging/i4591.scala index 9b31015ae82d..f37dd2898e8b 100644 --- a/tests/run-staging/i4591.scala +++ b/tests/run-staging/i4591.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/i4730.scala b/tests/run-staging/i4730.scala index 66583a31969c..4c3d9b23cb10 100644 --- a/tests/run-staging/i4730.scala +++ b/tests/run-staging/i4730.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i5144.scala b/tests/run-staging/i5144.scala index b1dc4ac6feef..fe51412931c7 100644 --- a/tests/run-staging/i5144.scala +++ b/tests/run-staging/i5144.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i5144b.scala b/tests/run-staging/i5144b.scala index 056b19c33b46..f9ef56666af2 100644 --- a/tests/run-staging/i5144b.scala +++ b/tests/run-staging/i5144b.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i5152.scala b/tests/run-staging/i5152.scala index e89eed3b4e04..d140bf8459a7 100644 --- a/tests/run-staging/i5152.scala +++ b/tests/run-staging/i5152.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i5161.scala b/tests/run-staging/i5161.scala index 1851a0200466..0509b12ec5ba 100644 --- a/tests/run-staging/i5161.scala +++ b/tests/run-staging/i5161.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) @@ -8,7 +8,7 @@ object Test { case Int2(x: Int) case Add(e1: Exp, e2: Exp) } - import Exp._ + import Exp.* def evalTest(e: Exp)(using Quotes): Expr[Option[Int]] = e match { case Int2(x) => '{ Some(${Expr(x)}) } diff --git a/tests/run-staging/i5161b.scala b/tests/run-staging/i5161b.scala index 8777b90ed27f..2c6f0c3474d0 100644 --- a/tests/run-staging/i5161b.scala +++ b/tests/run-staging/i5161b.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i5247.scala b/tests/run-staging/i5247.scala index 86c27af39c8d..7e6f7d46e1f6 100644 --- a/tests/run-staging/i5247.scala +++ b/tests/run-staging/i5247.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i5376.scala b/tests/run-staging/i5376.scala index be6ea755857a..37b8e3cf5efe 100644 --- a/tests/run-staging/i5376.scala +++ b/tests/run-staging/i5376.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i5434.scala b/tests/run-staging/i5434.scala index 199392390f93..0581ccbe397a 100644 --- a/tests/run-staging/i5434.scala +++ b/tests/run-staging/i5434.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i5965.scala b/tests/run-staging/i5965.scala index b77246fe7853..78b57557ca11 100644 --- a/tests/run-staging/i5965.scala +++ b/tests/run-staging/i5965.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/i5965b.scala b/tests/run-staging/i5965b.scala index ddf9f4226c2d..1d4612313c0e 100644 --- a/tests/run-staging/i5965b.scala +++ b/tests/run-staging/i5965b.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/i5997.scala b/tests/run-staging/i5997.scala index faf5675aac15..854a9fc98315 100644 --- a/tests/run-staging/i5997.scala +++ b/tests/run-staging/i5997.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i6263.scala b/tests/run-staging/i6263.scala index 5b69b12b7660..0b7fd06c1885 100644 --- a/tests/run-staging/i6263.scala +++ b/tests/run-staging/i6263.scala @@ -1,5 +1,5 @@ -import quoted._ -import scala.quoted.staging._ +import quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/i6281.scala b/tests/run-staging/i6281.scala index 92a14c21536a..a6667a41d7bc 100644 --- a/tests/run-staging/i6281.scala +++ b/tests/run-staging/i6281.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* sealed trait HList sealed trait HNil extends HList diff --git a/tests/run-staging/i6754.scala b/tests/run-staging/i6754.scala index 686c402d516b..e11ea596f6e7 100644 --- a/tests/run-staging/i6754.scala +++ b/tests/run-staging/i6754.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = diff --git a/tests/run-staging/i6992/Macro_1.scala b/tests/run-staging/i6992/Macro_1.scala index b03cf874f19b..09cacfd9e1eb 100644 --- a/tests/run-staging/i6992/Macro_1.scala +++ b/tests/run-staging/i6992/Macro_1.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object macros { @@ -14,12 +14,12 @@ object macros { package scala { object MyTest { - import macros._ + import macros.* given Compiler = Compiler.make(getClass.getClassLoader) def mcrImpl(body: Expr[Any])(using ctx: Quotes): Expr[Any] = { - import ctx.reflect._ + import ctx.reflect.* try { body match { case '{$x: Foo} => Expr(run(x).x) diff --git a/tests/run-staging/i6992/Test_2.scala b/tests/run-staging/i6992/Test_2.scala index 13ff747a80c5..01ce6977c72c 100644 --- a/tests/run-staging/i6992/Test_2.scala +++ b/tests/run-staging/i6992/Test_2.scala @@ -1,4 +1,4 @@ -import macros._ +import macros.* object Test { val foo = new Foo diff --git a/tests/run-staging/i7142.scala b/tests/run-staging/i7142.scala index a8323e8a2668..5ec9b0785d30 100644 --- a/tests/run-staging/i7142.scala +++ b/tests/run-staging/i7142.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ -import scala.util.control.NonLocalReturns._ +import scala.quoted.* +import scala.quoted.staging.* +import scala.util.control.NonLocalReturns.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i7381.scala b/tests/run-staging/i7381.scala index d84fb72c858d..1bdc21277e22 100644 --- a/tests/run-staging/i7381.scala +++ b/tests/run-staging/i7381.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/i7897.scala b/tests/run-staging/i7897.scala index 2b0952971761..21909f4306d6 100644 --- a/tests/run-staging/i7897.scala +++ b/tests/run-staging/i7897.scala @@ -1,4 +1,4 @@ -import scala.quoted._, staging._ +import scala.quoted._, staging.* object Test: given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/i8178.scala b/tests/run-staging/i8178.scala index c0aeb545bad2..3a29cf9abfd5 100644 --- a/tests/run-staging/i8178.scala +++ b/tests/run-staging/i8178.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* def foo(n: Int, t: Expr[Int])(using Quotes): Expr[Int] = if (n == 0) t diff --git a/tests/run-staging/i8585.scala b/tests/run-staging/i8585.scala index e525e056a336..ef099579fbcf 100644 --- a/tests/run-staging/i8585.scala +++ b/tests/run-staging/i8585.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* import scala.quoted.staging.{run, withQuotes, Compiler} object Test { diff --git a/tests/run-staging/inline-at-level-2.scala b/tests/run-staging/inline-at-level-2.scala index 9d0689296032..0d2335ac1004 100644 --- a/tests/run-staging/inline-at-level-2.scala +++ b/tests/run-staging/inline-at-level-2.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/inline-quote.scala b/tests/run-staging/inline-quote.scala index 0af500dafebe..07b35d614894 100644 --- a/tests/run-staging/inline-quote.scala +++ b/tests/run-staging/inline-quote.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/liftables.scala b/tests/run-staging/liftables.scala index 758333946ced..f30c01280ed5 100644 --- a/tests/run-staging/liftables.scala +++ b/tests/run-staging/liftables.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { diff --git a/tests/run-staging/multi-staging.scala b/tests/run-staging/multi-staging.scala index e94e6b84f434..d94528f18e4b 100644 --- a/tests/run-staging/multi-staging.scala +++ b/tests/run-staging/multi-staging.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = diff --git a/tests/run-staging/quote-ackermann-1.scala b/tests/run-staging/quote-ackermann-1.scala index f0f1d5891087..de689f5559be 100644 --- a/tests/run-staging/quote-ackermann-1.scala +++ b/tests/run-staging/quote-ackermann-1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/quote-fun-app-1.scala b/tests/run-staging/quote-fun-app-1.scala index 2f92275a6ccc..804899e45fd5 100644 --- a/tests/run-staging/quote-fun-app-1.scala +++ b/tests/run-staging/quote-fun-app-1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/quote-function-applied-to.scala b/tests/run-staging/quote-function-applied-to.scala index ddbc472e3b2d..454b8bb6e1a8 100644 --- a/tests/run-staging/quote-function-applied-to.scala +++ b/tests/run-staging/quote-function-applied-to.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-staging/quote-lambda.scala b/tests/run-staging/quote-lambda.scala index 216be6f9f027..8e85c40e3637 100644 --- a/tests/run-staging/quote-lambda.scala +++ b/tests/run-staging/quote-lambda.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-lib.scala b/tests/run-staging/quote-lib.scala index 527adaa21958..25a829f01d8c 100644 --- a/tests/run-staging/quote-lib.scala +++ b/tests/run-staging/quote-lib.scala @@ -1,12 +1,12 @@ -import scala.quoted._ -import scala.quoted.staging._ - -import liftable.Units._ -import liftable.Lets._ -import liftable.Loops._ -import liftable.Lists._ -import liftable.Exprs._ +import scala.quoted.* +import scala.quoted.staging.* + +import liftable.Units.* +import liftable.Lets.* +import liftable.Loops.* +import liftable.Lists.* +import liftable.Exprs.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-lift-Array.scala b/tests/run-staging/quote-lift-Array.scala index 6fd9f7c82416..b65695097f11 100644 --- a/tests/run-staging/quote-lift-Array.scala +++ b/tests/run-staging/quote-lift-Array.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { implicit val toolbox: scala.quoted.staging.Compiler = scala.quoted.staging.Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { diff --git a/tests/run-staging/quote-lift-BigDecimal.scala b/tests/run-staging/quote-lift-BigDecimal.scala index 8f3cff7f8494..39c5b79d532d 100644 --- a/tests/run-staging/quote-lift-BigDecimal.scala +++ b/tests/run-staging/quote-lift-BigDecimal.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = println(run { diff --git a/tests/run-staging/quote-lift-BigInt.scala b/tests/run-staging/quote-lift-BigInt.scala index 607828798c9a..de4b5296741d 100644 --- a/tests/run-staging/quote-lift-BigInt.scala +++ b/tests/run-staging/quote-lift-BigInt.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = println(run { diff --git a/tests/run-staging/quote-lift-IArray.scala b/tests/run-staging/quote-lift-IArray.scala index 2733a7e12fc8..8219ce96f063 100644 --- a/tests/run-staging/quote-lift-IArray.scala +++ b/tests/run-staging/quote-lift-IArray.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-nested-1.scala b/tests/run-staging/quote-nested-1.scala index 222247b55290..e22699992e38 100644 --- a/tests/run-staging/quote-nested-1.scala +++ b/tests/run-staging/quote-nested-1.scala @@ -1,5 +1,5 @@ -import quoted._ -import scala.quoted.staging._ +import quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-nested-2.scala b/tests/run-staging/quote-nested-2.scala index 6616dada2577..7769bcd4707e 100644 --- a/tests/run-staging/quote-nested-2.scala +++ b/tests/run-staging/quote-nested-2.scala @@ -1,5 +1,5 @@ -import quoted._ -import scala.quoted.staging._ +import quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-nested-3.scala b/tests/run-staging/quote-nested-3.scala index d07489199a21..303df1ad79e9 100644 --- a/tests/run-staging/quote-nested-3.scala +++ b/tests/run-staging/quote-nested-3.scala @@ -1,5 +1,5 @@ -import quoted._ -import scala.quoted.staging._ +import quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-nested-4.scala b/tests/run-staging/quote-nested-4.scala index ae1457592c0f..d986b2299265 100644 --- a/tests/run-staging/quote-nested-4.scala +++ b/tests/run-staging/quote-nested-4.scala @@ -1,5 +1,5 @@ -import quoted._ -import scala.quoted.staging._ +import quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-nested-5.scala b/tests/run-staging/quote-nested-5.scala index 4a807b403e4b..919b9c1bfad4 100644 --- a/tests/run-staging/quote-nested-5.scala +++ b/tests/run-staging/quote-nested-5.scala @@ -1,5 +1,5 @@ -import quoted._ -import scala.quoted.staging._ +import quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-nested-6.scala b/tests/run-staging/quote-nested-6.scala index d7599a2dbf7d..193e7b2f4676 100644 --- a/tests/run-staging/quote-nested-6.scala +++ b/tests/run-staging/quote-nested-6.scala @@ -1,5 +1,5 @@ -import quoted._ -import scala.quoted.staging._ +import quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-owners-2.scala b/tests/run-staging/quote-owners-2.scala index 4d51093c9efd..4e17d9d7a3c5 100644 --- a/tests/run-staging/quote-owners-2.scala +++ b/tests/run-staging/quote-owners-2.scala @@ -1,6 +1,6 @@ -import quoted._ -import scala.quoted.staging._ +import quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-owners.scala b/tests/run-staging/quote-owners.scala index b012c5084d0d..d3850d9d7801 100644 --- a/tests/run-staging/quote-owners.scala +++ b/tests/run-staging/quote-owners.scala @@ -1,5 +1,5 @@ -import quoted._ -import scala.quoted.staging._ +import quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-staging/quote-run-2.scala b/tests/run-staging/quote-run-2.scala index 480972336de9..3b69514cf908 100644 --- a/tests/run-staging/quote-run-2.scala +++ b/tests/run-staging/quote-run-2.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-run-b.scala b/tests/run-staging/quote-run-b.scala index b4e0a4dd8913..479b4c60aec5 100644 --- a/tests/run-staging/quote-run-b.scala +++ b/tests/run-staging/quote-run-b.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-staging/quote-run-c.scala b/tests/run-staging/quote-run-c.scala index 4ac8b9121a43..7cb21efe56f0 100644 --- a/tests/run-staging/quote-run-c.scala +++ b/tests/run-staging/quote-run-c.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-staging/quote-run-constants.scala b/tests/run-staging/quote-run-constants.scala index f73d24721054..a48f290557d8 100644 --- a/tests/run-staging/quote-run-constants.scala +++ b/tests/run-staging/quote-run-constants.scala @@ -1,7 +1,7 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-staging/quote-run-large.scala b/tests/run-staging/quote-run-large.scala index a6943da60a5f..048ff69f67dc 100644 --- a/tests/run-staging/quote-run-large.scala +++ b/tests/run-staging/quote-run-large.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-staging/quote-run-many.scala b/tests/run-staging/quote-run-many.scala index 0896e0e3ba8f..9f635eeab5e9 100644 --- a/tests/run-staging/quote-run-many.scala +++ b/tests/run-staging/quote-run-many.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-staging/quote-run-staged-interpreter.scala b/tests/run-staging/quote-run-staged-interpreter.scala index d31b617a905d..2f2d977f6d4e 100644 --- a/tests/run-staging/quote-run-staged-interpreter.scala +++ b/tests/run-staging/quote-run-staged-interpreter.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* enum Exp { case Num(n: Int) @@ -9,7 +9,7 @@ enum Exp { } object Test { - import Exp._ + import Exp.* def compile(e: Exp, env: Map[String, Expr[Int]], keepLets: Boolean)(using Quotes): Expr[Int] = { def compileImpl(e: Exp, env: Map[String, Expr[Int]]): Expr[Int] = e match { diff --git a/tests/run-staging/quote-run-with-settings.scala b/tests/run-staging/quote-run-with-settings.scala index 380613d1c34f..b4a5712759dc 100644 --- a/tests/run-staging/quote-run-with-settings.scala +++ b/tests/run-staging/quote-run-with-settings.scala @@ -1,8 +1,8 @@ import java.nio.file.{Files, Paths} -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-staging/quote-run.scala b/tests/run-staging/quote-run.scala index 7368757ff7aa..4fb14a791040 100644 --- a/tests/run-staging/quote-run.scala +++ b/tests/run-staging/quote-run.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-staging/quote-show-blocks.scala b/tests/run-staging/quote-show-blocks.scala index c2f44ac832e8..204546ae62ed 100644 --- a/tests/run-staging/quote-show-blocks.scala +++ b/tests/run-staging/quote-show-blocks.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-simple-hole.scala b/tests/run-staging/quote-simple-hole.scala index f25af11d24a0..1f33ea7ced58 100644 --- a/tests/run-staging/quote-simple-hole.scala +++ b/tests/run-staging/quote-simple-hole.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-toExprOfTuple.scala b/tests/run-staging/quote-toExprOfTuple.scala index 5c19952f1516..ef128b0dd785 100644 --- a/tests/run-staging/quote-toExprOfTuple.scala +++ b/tests/run-staging/quote-toExprOfTuple.scala @@ -1,6 +1,6 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-two-captured-ref.scala b/tests/run-staging/quote-two-captured-ref.scala index 5f82b8fd71e4..cecb5d11ab19 100644 --- a/tests/run-staging/quote-two-captured-ref.scala +++ b/tests/run-staging/quote-two-captured-ref.scala @@ -1,5 +1,5 @@ -import quoted._ -import scala.quoted.staging._ +import quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-type-matcher.scala b/tests/run-staging/quote-type-matcher.scala index fb4434873486..e1d213d98019 100644 --- a/tests/run-staging/quote-type-matcher.scala +++ b/tests/run-staging/quote-type-matcher.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* import scala.reflect.ClassTag object Test { diff --git a/tests/run-staging/quote-type-tags.scala b/tests/run-staging/quote-type-tags.scala index 918f703c5133..27e3bbca3928 100644 --- a/tests/run-staging/quote-type-tags.scala +++ b/tests/run-staging/quote-type-tags.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-unrolled-foreach.scala b/tests/run-staging/quote-unrolled-foreach.scala index f532244b2e86..a286e72a3e37 100644 --- a/tests/run-staging/quote-unrolled-foreach.scala +++ b/tests/run-staging/quote-unrolled-foreach.scala @@ -1,6 +1,6 @@ import scala.annotation.tailrec -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-valueof-list.scala b/tests/run-staging/quote-valueof-list.scala index 87403684b2d5..00d1774b169c 100644 --- a/tests/run-staging/quote-valueof-list.scala +++ b/tests/run-staging/quote-valueof-list.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/quote-valueof.scala b/tests/run-staging/quote-valueof.scala index 29bf7c1631ee..db6cd12e3015 100644 --- a/tests/run-staging/quote-valueof.scala +++ b/tests/run-staging/quote-valueof.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/quote-var.scala b/tests/run-staging/quote-var.scala index ebde4a7edf1c..9c6bbcc4bd5f 100644 --- a/tests/run-staging/quote-var.scala +++ b/tests/run-staging/quote-var.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { diff --git a/tests/run-staging/shonan-hmm-simple.scala b/tests/run-staging/shonan-hmm-simple.scala index e17c998ed65e..36f0ac218482 100644 --- a/tests/run-staging/shonan-hmm-simple.scala +++ b/tests/run-staging/shonan-hmm-simple.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* trait Ring[T]: val zero: T diff --git a/tests/run-staging/shonan-hmm/Blas.scala b/tests/run-staging/shonan-hmm/Blas.scala index 4c5f873c3888..bee4bf23daa8 100644 --- a/tests/run-staging/shonan-hmm/Blas.scala +++ b/tests/run-staging/shonan-hmm/Blas.scala @@ -1,9 +1,9 @@ -import scala.quoted._ +import scala.quoted.* class Blas1[Idx, T, Unt](tring: Ring[T], vec: VecOp[Idx, Unt]) { - import tring._ - import vec._ + import tring.* + import vec.* implicit class Blas1VecOps(v1: Vec[Idx, T]) { def `*.`(v2: Vec[Idx, T]): Vec[Idx, T] = v1.zipWith(v2, mul) @@ -16,8 +16,8 @@ class Blas1[Idx, T, Unt](tring: Ring[T], vec: VecOp[Idx, Unt]) { } class Blas2[Idx, T, Unt](tring: Ring[T], vec: VecROp[Idx, T, Unt]) extends Blas1[Idx, T, Unt](tring, vec) { - import tring._ - import vec._ + import tring.* + import vec.* implicit class Blas2VecOps(v1: Vec[Idx, T]) { def dot(v2: Vec[Idx, T]): T = reduce(add, zero, v1 `*.` v2) diff --git a/tests/run-staging/shonan-hmm/Complex.scala b/tests/run-staging/shonan-hmm/Complex.scala index cf71da66da1b..ad6d7cf535c4 100644 --- a/tests/run-staging/shonan-hmm/Complex.scala +++ b/tests/run-staging/shonan-hmm/Complex.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* case class Complex[T](re: T, im: T) diff --git a/tests/run-staging/shonan-hmm/Lifters.scala b/tests/run-staging/shonan-hmm/Lifters.scala index bfe71c6cd750..4a2de3715f12 100644 --- a/tests/run-staging/shonan-hmm/Lifters.scala +++ b/tests/run-staging/shonan-hmm/Lifters.scala @@ -1,8 +1,8 @@ -import UnrolledExpr._ +import UnrolledExpr.* import scala.reflect.ClassTag -import scala.quoted._ +import scala.quoted.* object Lifters { implicit def LiftedClassTag[T: Type: ClassTag] (using Quotes): Expr[ClassTag[T]] = { diff --git a/tests/run-staging/shonan-hmm/MVmult.scala b/tests/run-staging/shonan-hmm/MVmult.scala index 5a26c7c629b4..210c62a4d891 100644 --- a/tests/run-staging/shonan-hmm/MVmult.scala +++ b/tests/run-staging/shonan-hmm/MVmult.scala @@ -1,9 +1,9 @@ -import scala.quoted._ +import scala.quoted.* class MVmult[Idx, T, Unt](tring: Ring[T], vec: VecROp[Idx, T, Unt]) { private[this] val blas2 = new Blas2(tring, vec) - import blas2._ + import blas2.* def mvmult(vout: OVec[Idx, T, Unt], a: Vec[Idx, Vec[Idx, T]], v: Vec[Idx, T]): Unt = vout := a * v override def toString(): String = s"MVmult($tring, $vec)" } @@ -54,7 +54,7 @@ object MVmult { } def mvmult_ac(a: Array[Array[Int]])(using Quotes): Expr[(Array[Int], Array[Int]) => Unit] = { - import Lifters._ + import Lifters.* '{ val arr = ${Expr(a)} ${ @@ -65,7 +65,7 @@ object MVmult { } def mvmult_opt(a: Array[Array[Int]])(using Quotes): Expr[(Array[Int], Array[Int]) => Unit] = { - import Lifters._ + import Lifters.* '{ val arr = ${Expr(a)} ${ @@ -76,7 +76,7 @@ object MVmult { } def mvmult_roll(a: Array[Array[Int]])(using Quotes): Expr[(Array[Int], Array[Int]) => Unit] = { - import Lifters._ + import Lifters.* '{ val arr = ${Expr(a)} ${ @@ -99,7 +99,7 @@ object MVmult { } def initRows[T: Type](a: Array[Array[Int]])(cont: Array[Expr[Array[Int]]] => Expr[T])(using Quotes): Expr[T] = { - import Lifters._ + import Lifters.* def loop(i: Int, acc: List[Expr[Array[Int]]]): Expr[T] = { if (i >= a.length) cont(acc.toArray.reverse) else if (a(i).count(_ != 0) < VecRStaOptDynInt.threshold) { @@ -148,13 +148,13 @@ object MVmult { } def copy_row1(using Quotes): Array[Int] => (Expr[Int] => Expr[Int]) = v => { - import Lifters._ + import Lifters.* val arr = Expr(v) i => '{ ($arr).apply($i) } } def copy_row_let(using Quotes): Array[Int] => (Expr[Int] => Expr[Int]) = v => { - import Lifters._ + import Lifters.* val arr: Expr[Array[Int]] = ??? // FIXME used genlet v i => '{ ($arr).apply($i) } } diff --git a/tests/run-staging/shonan-hmm/PV.scala b/tests/run-staging/shonan-hmm/PV.scala index 46e56b7d4ab7..a0d9eb6ba0c5 100644 --- a/tests/run-staging/shonan-hmm/PV.scala +++ b/tests/run-staging/shonan-hmm/PV.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* sealed trait PV[T] diff --git a/tests/run-staging/shonan-hmm/Ring.scala b/tests/run-staging/shonan-hmm/Ring.scala index 4b88955d7d6e..c7b89fd6aa56 100644 --- a/tests/run-staging/shonan-hmm/Ring.scala +++ b/tests/run-staging/shonan-hmm/Ring.scala @@ -1,5 +1,5 @@ -import scala.quoted._ +import scala.quoted.* trait Ring[T] { def zero: T @@ -34,7 +34,7 @@ class RingIntExpr(using Quotes) extends Ring[Expr[Int]] { } case class RingComplex[U](u: Ring[U]) extends Ring[Complex[U]] { - import u._ + import u.* val zero = Complex(u.zero, u.zero) val one = Complex(u.one, u.zero) val add = (x, y) => Complex(x.re + y.re, x.im + y.im) @@ -47,8 +47,8 @@ case class RingPV[U: ToExpr](staRing: Ring[U], dynRing: Ring[Expr[U]])(using Quo type T = PV[U] val dyn = Dyns.dyn[U] - import staRing._ - import dynRing._ + import staRing.* + import dynRing.* val zero: T = Sta(staRing.zero) val one: T = Sta(staRing.one) diff --git a/tests/run-staging/shonan-hmm/Test.scala b/tests/run-staging/shonan-hmm/Test.scala index cb909487ddb8..b689ad146af3 100644 --- a/tests/run-staging/shonan-hmm/Test.scala +++ b/tests/run-staging/shonan-hmm/Test.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* // DYNAMIC @@ -11,14 +11,14 @@ object Test { { val intComplex = new RingComplex(RingInt) - import intComplex._ + import intComplex.* println(Complex(1, 2) * Complex(4, 2)) } { val intExprComplex = new RingComplex(new RingIntExpr) - import intExprComplex._ + import intExprComplex.* val res = Complex('{1}, '{2}) * Complex('{4}, '{2}) println(s"Complex(${res.re.show}, ${res.im.show})") @@ -26,7 +26,7 @@ object Test { // { // val intExprComplex = implicitly[Ring[Expr[Complex[Int]]]] - // import intExprComplex._ + // import intExprComplex.* // val res = '{Complex(1, 2)} * '{Complex(4, 2)} // println(res.show) diff --git a/tests/run-staging/shonan-hmm/UnrolledExpr.scala b/tests/run-staging/shonan-hmm/UnrolledExpr.scala index eb52ac72b8a0..f73b446aed93 100644 --- a/tests/run-staging/shonan-hmm/UnrolledExpr.scala +++ b/tests/run-staging/shonan-hmm/UnrolledExpr.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import Lifters._ +import scala.quoted.* +import Lifters.* object UnrolledExpr { @@ -19,7 +19,7 @@ object UnrolledExpr { } class UnrolledExpr[T: ToExpr, It <: Iterable[T]](xs: It) { - import UnrolledExpr._ + import UnrolledExpr.* def foreach[U](f: T => Expr[U])(using Quotes): Expr[Unit] = block(xs.map(f), '{}) diff --git a/tests/run-staging/shonan-hmm/Vec.scala b/tests/run-staging/shonan-hmm/Vec.scala index 68ad9f43f8b6..b1864f056ee8 100644 --- a/tests/run-staging/shonan-hmm/Vec.scala +++ b/tests/run-staging/shonan-hmm/Vec.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* case class Vec[Idx, T](size: Idx, get: Idx => T) { def apply(idx: Idx): T = get(idx) diff --git a/tests/run-staging/shonan-hmm/VecOp.scala b/tests/run-staging/shonan-hmm/VecOp.scala index 930330640f8c..eb56bc9ac748 100644 --- a/tests/run-staging/shonan-hmm/VecOp.scala +++ b/tests/run-staging/shonan-hmm/VecOp.scala @@ -1,4 +1,4 @@ -import scala.quoted._ +import scala.quoted.* trait VecOp[Idx, Unt] { def iter: Vec[Idx, Unt] => Unt diff --git a/tests/run-staging/shonan-hmm/VecROp.scala b/tests/run-staging/shonan-hmm/VecROp.scala index 1182df2479f4..44cac1693f84 100644 --- a/tests/run-staging/shonan-hmm/VecROp.scala +++ b/tests/run-staging/shonan-hmm/VecROp.scala @@ -1,12 +1,12 @@ -import scala.quoted._ +import scala.quoted.* trait VecROp[Idx, T, Unt] extends VecOp[Idx, Unt] { def reduce: ((T, T) => T, T, Vec[Idx, T]) => T } class StaticVecR[T](r: Ring[T]) extends VecSta with VecROp[Int, T, Unit] { - import r._ + import r.* def reduce: ((T, T) => T, T, Vec[Int, T]) => T = { (plus, zero, vec) => var sum = zero for (i <- 0 until vec.size) diff --git a/tests/run-staging/shonan-hmm/Vmults.scala b/tests/run-staging/shonan-hmm/Vmults.scala index 982104399ec2..a041b395747a 100644 --- a/tests/run-staging/shonan-hmm/Vmults.scala +++ b/tests/run-staging/shonan-hmm/Vmults.scala @@ -1,8 +1,8 @@ -import scala.quoted._ +import scala.quoted.* class Vmult[Idx, T, Unt](tring: Ring[T], vec: VecOp[Idx, Unt]) { private[this] val blas = new Blas1(tring, vec) - import blas._ + import blas.* def vmult(vout: OVec[Idx, T, Unt], v1: Vec[Idx, T], v2: Vec[Idx, T]): Unt = vout := v1 `*.` v2 override def toString(): String = s"Vmult($tring, $vec)" } diff --git a/tests/run-staging/staged-streams_1.scala b/tests/run-staging/staged-streams_1.scala index 218918776a4c..3018f85aaf21 100644 --- a/tests/run-staging/staged-streams_1.scala +++ b/tests/run-staging/staged-streams_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* import language.experimental.namedTypeArguments /** @@ -65,7 +65,7 @@ object Test { case AtMost1 case Many } - import Cardinality._ + import Cardinality.* trait StagedStream[A] case class Linear[A](producer: Producer[A]) extends StagedStream[A] diff --git a/tests/run-staging/staged-tuples/StagedTuple.scala b/tests/run-staging/staged-tuples/StagedTuple.scala index 1a1f10b47eea..bbc6471172aa 100644 --- a/tests/run-staging/staged-tuples/StagedTuple.scala +++ b/tests/run-staging/staged-tuples/StagedTuple.scala @@ -1,6 +1,6 @@ package scala.internal -import scala.quoted._ +import scala.quoted.* import scala.runtime.TupleXXL diff --git a/tests/run-staging/staged-tuples/Test.scala b/tests/run-staging/staged-tuples/Test.scala index eff7e9f848ed..034cd57858c2 100644 --- a/tests/run-staging/staged-tuples/Test.scala +++ b/tests/run-staging/staged-tuples/Test.scala @@ -1,5 +1,5 @@ import scala.quoted.staging.run -import scala.internal.StagedTuple._ +import scala.internal.StagedTuple.* object Test { diff --git a/tests/run-staging/tasty-extractors-constants-2/quoted_1.scala b/tests/run-staging/tasty-extractors-constants-2/quoted_1.scala index d14a0490d6f4..a881a524c52e 100644 --- a/tests/run-staging/tasty-extractors-constants-2/quoted_1.scala +++ b/tests/run-staging/tasty-extractors-constants-2/quoted_1.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Macros { diff --git a/tests/run-staging/unliftables.scala b/tests/run-staging/unliftables.scala index b0f6bd4e51ec..763f5b55aab8 100644 --- a/tests/run-staging/unliftables.scala +++ b/tests/run-staging/unliftables.scala @@ -1,5 +1,5 @@ -import scala.quoted._ -import scala.quoted.staging._ +import scala.quoted.* +import scala.quoted.staging.* object Test { given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { diff --git a/tests/run-with-compiler/intmaptest.scala b/tests/run-with-compiler/intmaptest.scala index c12cb03e979d..b9cefbcce0c9 100644 --- a/tests/run-with-compiler/intmaptest.scala +++ b/tests/run-with-compiler/intmaptest.scala @@ -34,7 +34,7 @@ object Generator: val nums: Generator[Integer] = range(NumLimit).map(Integer(_)) @main def Test = - import Generator._ + import Generator.* val map1 = dotty.tools.dotc.util.IntMap[Integer]() val map2 = scala.collection.mutable.HashMap[Integer, Integer]() diff --git a/tests/run-with-compiler/maptest.scala b/tests/run-with-compiler/maptest.scala index 9a4b42981d94..f22955b7ac50 100644 --- a/tests/run-with-compiler/maptest.scala +++ b/tests/run-with-compiler/maptest.scala @@ -34,7 +34,7 @@ object Generator: val nums: Generator[Integer] = range(NumLimit).map(Integer(_)) @main def Test = - import Generator._ + import Generator.* val map1 = dotty.tools.dotc.util.HashMap[Integer, Integer]() val map2 = scala.collection.mutable.HashMap[Integer, Integer]() diff --git a/tests/run-with-compiler/settest.scala b/tests/run-with-compiler/settest.scala index 3a725990b840..5a4066aac54f 100644 --- a/tests/run-with-compiler/settest.scala +++ b/tests/run-with-compiler/settest.scala @@ -34,7 +34,7 @@ object Generator: val nums: Generator[Integer] = range(NumLimit).map(Integer(_)) @main def Test = - import Generator._ + import Generator.* val set1 = dotty.tools.dotc.util.HashSet[Int]() val set2 = scala.collection.mutable.HashSet[Int]() diff --git a/tests/run/CollectionTests.scala b/tests/run/CollectionTests.scala index cba6725d676f..6ecc30f78aef 100644 --- a/tests/run/CollectionTests.scala +++ b/tests/run/CollectionTests.scala @@ -1,4 +1,4 @@ -import Predef.{augmentString => _, wrapString => _, _} +import Predef.{augmentString as _, wrapString as _, *} import scala.reflect.ClassTag /** A strawman architecture for new collections. It contains some @@ -522,7 +522,7 @@ object CollectionStrawMan5 { } object Test { - import CollectionStrawMan5._ + import CollectionStrawMan5.* def seqOps(xs: Seq[Int]) = { val x1 = xs.foldLeft("")(_ + _) diff --git a/tests/run/ConfManagement.scala b/tests/run/ConfManagement.scala index f73445b5af08..bccff0d7c822 100644 --- a/tests/run/ConfManagement.scala +++ b/tests/run/ConfManagement.scala @@ -26,7 +26,7 @@ object ConfManagement: end Conference end ConfManagement -import ConfManagement._ +import ConfManagement.* val Smith = Person("Smith") val Peters = Person("Peters") diff --git a/tests/run/IArrayOps.check b/tests/run/IArrayOps.check new file mode 100644 index 000000000000..847906991768 --- /dev/null +++ b/tests/run/IArrayOps.check @@ -0,0 +1,162 @@ +ArraySeq(1, 2, 3) +true +false +ArraySeq(1, 9, 3) +ArraySeq(1, a, 3) +ArraySeq(1, 2, 3, 0) +ArraySeq(1, 1, 2, 3) +ArraySeq(1, 5, 4, 3) +1 +1 +ArraySeq(1, 5, 4, 3) +ArraySeq(5, 4, 3) +ArraySeq() +ArraySeq(1, 2, 3, 5, 4, 5, 6) +ArraySeq(1, 2, 3, 5, 4, 5, 6) +ArraySeq(1, 2, 3, 7) +ArraySeq(8, 1, 2, 3) +ArraySeq(1, 2, 3, 5, 4, 5, 6) +ArraySeq(5, 4, 5, 6, 12, 13, 14) +ArraySeq(12, 13, 14, 5, 4, 5, 6) +123 +1-2-3 +(1,2,3) +ArraySeq(1, 2, 3, 5) +ArraySeq(1, 2, 3, 5, 4, 5, 6) +ArraySeq(1, 2, 3, 1, 4) +ArraySeq(5, 1, 2, 3) +ArraySeq(5, 6, 1, 2, 3) +ArraySeq(2, 6) +Some(2) +List(ArraySeq(1), ArraySeq(2), ArraySeq(3)) +List(ArraySeq(1, 2), ArraySeq(1, 3), ArraySeq(2, 3)) +List(ArraySeq(1, 2, 3)) +ArraySeq(1, 2, 3, 5, 4, 5, 6) +ArraySeq(1, 2, 3, 8, 9) +false +true +false +true +false +ArraySeq(3) +ArraySeq(3) +ArraySeq(1, 2, 3) +ArraySeq(5, 4, 6) +ArraySeq(5, 4) +false +false +true +true +Some(1) +Some(2) +6 +6 +6 +6 +6 +6 +Map(1 -> ArraySeq(1), 2 -> ArraySeq(2), 3 -> ArraySeq(3)) +Map(0 -> ArraySeq(2), 1 -> ArraySeq(1, 3)) +Map(1 -> ArraySeq(1), 2 -> ArraySeq(2), 3 -> ArraySeq(3)) +Map(0 -> ArraySeq(2), 1 -> ArraySeq(1, 3)) +Map(1 -> 1, 2 -> 2, 3 -> 3) +Map(0 -> 2, 1 -> 13) +List(ArraySeq(1, 2), ArraySeq(3)) +0 +1 +-1 +1 +0 +1 +0 +1 +List(ArraySeq(1, 2, 3), ArraySeq(1, 2), ArraySeq(1), ArraySeq()) +List(ArraySeq(1, 2, 3), ArraySeq(2, 3), ArraySeq(3), ArraySeq()) +ArraySeq(1, 2) +ArraySeq(2, 3) +true +3 +ArraySeq(1, 2, 3).lazyZip(ArraySeq(5, 4, 5, 6)) +List((1,5), (2,4), (3,5)) +0 +1 +-1 +3 +Some(3) +3 +Some(3) +1 +Some(1) +1 +Some(1) +123 +1-2-3 +(1,2,3) +ArraySeq((1,5), (2,4), (3,5)) +ArraySeq((1,5), (2,5), (3,5)) +ArraySeq((1,5), (2,5), (3,4)) +ArraySeq((1,5), (2,5), (3,4)) +ArraySeq(1, 2) +ArraySeq(a, b) +ArraySeq(1, 2) +ArraySeq(a, b) +ArraySeq(x, y) +ArraySeq(1, 2, 3, 0, 0, 0) +ArraySeq(1, 2, 3) +ArraySeq() +ArraySeq() +ArraySeq(1, 2, 3) +ArraySeq(1, 6, 7, 8, 9) +List(ArraySeq(1, 2, 3), ArraySeq(1, 3, 2), ArraySeq(2, 1, 3), ArraySeq(2, 3, 1), ArraySeq(3, 1, 2), ArraySeq(3, 2, 1)) +6 +6 +List(1, 2, 3) +List(3, 2, 1) +true +false +1 +0 +-1 +-1 +1 +List(ArraySeq(1, 2), ArraySeq(2, 3)) +List(ArraySeq(5, 4, 5), ArraySeq(5, 6)) +ArraySeq(6, 5, 5, 4) +true +true +1 +2 +3 +ArraySeq(1, 2, 3) +ArraySeq((1,0), (2,1), (3,2)) +List(1, 2, 3) +Vector(1, 2, 3) +ArrayBuffer(1, 2, 3) +ArraySeq(1, 2, 3) +ArraySeq(1, 2, 3) +List(1, 2, 3) +Set(1, 2, 3) +Vector(1, 2, 3) +ArrayView(1, 2, 3) +Map(1 -> 5, 2 -> 4, 3 -> 5) +Map(1 -> 5, 2 -> 4, 3 -> 5) +ArraySeq() +true +false +false +ArraySeq(1, 2, 2, 3) +Found(1) +ArraySeq(1, 3) +(2,4) +(2,6) +(3,4) +(3,6) +ArraySeq((2,4), (2,6), (3,4), (3,6)) +ArraySeq() +ArraySeq(ArraySeq(1, 4), ArraySeq(2, 5), ArraySeq(3, 6)) +false +ArraySeq(a, b) +ArraySeq(1, 2, 4, 1, 2, 3, 9, 10) +List((1,5), (1,4), (1,5), (1,6), (1,5), (1,4), (1,5), (1,6), (1,5), (1,4), (1,5), (1,6)) +List((1,true,1,2,3,4,5.0,6.0,a,abc,xyz,())) +ArraySeq((1,true,1,2,3,4,5.0,6.0,a,abc,xyz,())) diff --git a/tests/run/IArrayOps.scala b/tests/run/IArrayOps.scala new file mode 100644 index 000000000000..81a6e3c2a11b --- /dev/null +++ b/tests/run/IArrayOps.scala @@ -0,0 +1,280 @@ +@main def Test: Unit = + val iarr1 = IArray(1, 2, 3) + val iarr2 = IArray(5, 4, 5, 6) + + println(iarr1.toSeq) + println(iarr1.contains(1)) + println(iarr1.contains(4)) + println(iarr1.updated(1, 9).toSeq) + println(iarr1.updated(1, "a").toSeq) + + val arr = Array(0, 0, 0, 0) + iarr1.copyToArray(arr) + println(arr.toSeq) + iarr1.copyToArray(arr, 1) + println(arr.toSeq) + iarr2.copyToArray(arr, 1, 2) + println(arr.toSeq) + + println(arr.count(_ == 1)) + println(arr.count(_ <= 2)) + + println(arr.drop(0).toSeq) + println(arr.drop(1).toSeq) + println(arr.drop(6).toSeq) + + println((iarr1 ++ iarr2).toSeq) + println((iarr1 ++ iarr2.toSeq).toSeq) + println((iarr1 :+ 7).toSeq) + println((8 +: iarr1).toSeq) + println((iarr1 :++ iarr2).toSeq) + println((iarr2 :++ List(12, 13, 14)).toSeq) + println((List(12, 13, 14) ++: iarr2).toSeq) + + val sb = StringBuilder() + iarr1.addString(sb).append("\n") + iarr1.addString(sb, "-").append("\n") + iarr1.addString(sb, "(", ",", ")") + println(sb) + + println(iarr1.appended(5).toSeq) + println(iarr1.appendedAll(iarr2).toSeq) + println(iarr1.appendedAll(List(1, 4)).toSeq) + println(iarr1.prepended(5).toSeq) + println(iarr1.prependedAll(List(5, 6)).toSeq) + + println(iarr1.collect { case x if x % 2 == 1 => 2 * x }.toSeq) + println(iarr1.collectFirst { case x if x % 2 == 1 => 2 * x }) + + println(iarr1.combinations(1).map(_.toSeq).toSeq) + println(iarr1.combinations(2).map(_.toSeq).toSeq) + println(iarr1.combinations(3).map(_.toSeq).toSeq) + + println(iarr1.concat(iarr2).toSeq) + println(iarr1.concat(List(8, 9)).toSeq) + println(iarr1.containsSlice(iarr2)) + println(iarr1.containsSlice(List(2, 3))) + + println(iarr1.corresponds(iarr2)(_ == _)) + println(iarr1.corresponds(List(1, 2, 3))(_ == _)) + println(iarr1.corresponds(List(2, 4, 6))(_ == 2 * _)) + + println(iarr1.diff(List(1, 2)).toSeq) + println(iarr1.diff(IArray(1, 2)).toSeq) + + println(iarr1.distinct.toSeq) + println(iarr2.distinct.toSeq) + println(iarr2.distinctBy(_ % 2 == 1).toSeq) + + println(iarr1.startsWith(IArray(2, 3))) + println(iarr1.startsWith(List(2, 3))) + println(iarr1.endsWith(IArray(2, 3))) + println(iarr1.endsWith(List(2, 3))) + println(iarr1.findLast(_ <= 1)) + println(iarr1.findLast(_ <= 2)) + + println(iarr1.fold(0)(_ + _)) + println(iarr1.foldLeft(0)(_ + _)) + println(iarr1.foldRight(0)(_ + _)) + + println(iarr1.reduce(_ + _)) + println(iarr1.reduceLeft(_ + _)) + println(iarr1.reduceRight(_ + _)) + + println(iarr1.groupBy(identity).mapValues(_.toSeq).toMap) + println(iarr1.groupBy(_ % 2).mapValues(_.toSeq).toMap) + + println(iarr1.groupMap(identity)(_.toString).mapValues(_.toSeq).toMap) + println(iarr1.groupMap(_ % 2)(_.toString).mapValues(_.toSeq).toMap) + + println(iarr1.groupMapReduce(identity)(_.toString)(_ + _).mapValues(_.toSeq).toMap) + println(iarr1.groupMapReduce(_ % 2)(_.toString)(_ + _).mapValues(_.toSeq).toMap) + + println(iarr1.grouped(2).map(_.toSeq).toList) + + println(iarr1.indexOfSlice(IArray(1, 2))) + println(iarr1.indexOfSlice(List(2, 3))) + println(iarr1.indexOfSlice(IArray(1, 2), 1)) + println(iarr1.indexOfSlice(List(2, 3), 1)) + println(iarr1.lastIndexOfSlice(IArray(1, 2))) + println(iarr1.lastIndexOfSlice(List(2, 3))) + println(iarr1.lastIndexOfSlice(IArray(1, 2), 1)) + println(iarr1.lastIndexOfSlice(List(2, 3), 1)) + + println(iarr1.inits.map(_.toSeq).toList) + println(iarr1.tails.map(_.toSeq).toList) + println(iarr1.intersect(List(1, 2)).toSeq) + println(iarr1.intersect(List(2, 3)).toSeq) + println(iarr1.isTraversableAgain) + println(iarr1.knownSize) + println(iarr1.lazyZip(iarr2)) + println(iarr1.lazyZip(iarr2.toSeq).toList) + println(iarr1.lengthCompare(3)) + println(iarr1.lengthCompare(1)) + println(iarr1.lengthCompare(4)) + + println(iarr1.max) + println(iarr1.maxOption) + println(iarr1.maxBy(identity)) + println(iarr1.maxByOption(identity)) + println(iarr1.min) + println(iarr1.minOption) + println(iarr1.minBy(identity)) + println(iarr1.minByOption(identity)) + + println(iarr1.mkString) + println(iarr1.mkString("-")) + println(iarr1.mkString("(", ",", ")")) + + println(iarr1.zip(iarr2.toSeq).toSeq) + println(iarr1.zip(Iterator(5, 5, 5)).toSeq) + println(iarr1.zipAll(IArray(5, 5), 3, 4).toSeq) + println(iarr1.zipAll(List(5, 5), 3, 4).toSeq) + + println(IArray((1, 'a'), (2, 'b')).unzip._1.toSeq) + println(IArray((1, 'a'), (2, 'b')).unzip._2.toSeq) + println(IArray((1, 'a', "x"), (2, 'b', "y")).unzip3._1.toSeq) + println(IArray((1, 'a', "x"), (2, 'b', "y")).unzip3._2.toSeq) + println(IArray((1, 'a', "x"), (2, 'b', "y")).unzip3._3.toSeq) + + println(iarr1.padTo(6, 0).toSeq) + println(iarr1.partitionMap[Int, Int](i => Left(i))._1.toSeq) + println(iarr1.partitionMap[Int, Int](i => Left(i))._2.toSeq) + println(iarr1.partitionMap[Int, Int](i => Right(i))._1.toSeq) + println(iarr1.partitionMap[Int, Int](i => Right(i))._2.toSeq) + println(iarr1.patch(1, List(6, 7, 8, 9), 2).toSeq) + println(iarr1.permutations.map(_.toSeq).toList) + + println(iarr1.sum) + println(iarr1.product) + + println(iarr1.iterator.toList) + println(iarr1.reverseIterator.toList) + + println(iarr1.sameElements(iarr1)) + println(iarr1.sameElements(iarr2.toSeq)) + + println(iarr1.segmentLength(_ < 2)) + println(iarr1.segmentLength(_ < 2, 1)) + + println(iarr1.sizeCompare(iarr2)) + println(iarr1.sizeCompare(iarr2.toSeq)) + println(iarr1.sizeCompare(1)) + + println(iarr1.sliding(2).map(_.toSeq).toList) + println(iarr2.sliding(3, 2).map(_.toSeq).toList) + + println(iarr2.sortBy(i => -i).toSeq) + + println(iarr1.startsWith(Iterator(1, 2), 0)) + println(iarr1.startsWith(Iterator(2, 3), 1)) + + println(iarr1.tapEach(x => println(x)).toSeq) + + println(iarr1.zipWithIndex.toSeq) + + println(iarr1.to(List)) + println(iarr1.to(Vector)) + println(iarr1.toBuffer) + println(iarr1.toIndexedSeq) + println(iarr1.toIterable) + println(iarr1.toList) + println(iarr1.toSet) + println(iarr1.toVector) + println(iarr1.view) + println(iarr1.zip(iarr2).toMap) + println(iarr1.zip(iarr2.toSeq).toMap) + + println(iarr1.empty) + println(iarr1.isTraversableAgain) + println(iarr1.lengthIs < 2) + println(iarr1.sizeIs < 2) + + iarr1.stepper + + println(IArray(List(1, 2), List(2, 3)).flatten.toSeq) + + println(iarr1.search(2)) + + println(iarr1.withFilter(_ != 2).map(identity).toSeq) + + for + x <- iarr1 + if x != 1 + y <- iarr2 + if y != 5 + if y != 65 + do + println((x, y)) + + println( + (for + x <- iarr1 + if x != 1 + y <- iarr2.toSeq + if y != 5 + if y != 65 + yield + (x, y) + ).toSeq) + + println(IArray[IArray[Int]]().transpose.map(_.toSeq).toSeq) + println(IArray(IArray(1, 2, 3), IArray(4, 5, 6)).transpose.map(_.toSeq).toSeq) + + println(IArray.equals(IArray("a"), IArray("b"))) + println(IArray.from(List("a", "b")).toSeq) + + val iab = IArray.newBuilder[Int] + iab += 1 + iab += 2 + iab.addOne(4) + iab.addAll(iarr1) + iab.addAll(Array(9)) + iab.addAll(Seq(10)) + println(iab.result().toSeq) + + + println( + (for + x <- List(1) + y <- iarr1 + y <- iarr2 + yield + (x, y) + ).toSeq) + + println( + (for + x1 <- List(1) + x2 <- IArray(true) + x3 <- IArray(1: Byte) + x4 <- IArray(2: Short) + x5 <- IArray(3) + x6 <- IArray(4L) + x7 <- IArray(5f) + x8 <- IArray(6d) + x9 <- IArray('a') + x10 <- IArray("abc") + x11 <- IArray("xyz": Any) + x12 <- IArray(()) + yield + (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) + ).toSeq) + + println( + (for + x1 <- IArray(1) + x2 <- IArray(true) + x3 <- IArray(1: Byte) + x4 <- IArray(2: Short) + x5 <- IArray(3) + x6 <- IArray(4L) + x7 <- IArray(5f) + x8 <- IArray(6d) + x9 <- IArray('a') + x10 <- IArray("abc") + x11 <- IArray("xyz": Any) + x12 <- IArray(()) + yield + (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) + ).toSeq) diff --git a/tests/run/LazyValsLongs.scala b/tests/run/LazyValsLongs.scala index 0a9a963c1c4a..d4f855cac06f 100644 --- a/tests/run/LazyValsLongs.scala +++ b/tests/run/LazyValsLongs.scala @@ -22,7 +22,7 @@ class I { object Test { def main(args: Array[String]): Unit = { val c = new I - import c._ + import c.* val l1 = List(A1, A2, A3, diff --git a/tests/run/Meter.scala b/tests/run/Meter.scala index 5fe82a87e964..3b92cbe773bf 100644 --- a/tests/run/Meter.scala +++ b/tests/run/Meter.scala @@ -46,8 +46,8 @@ package b { protected def proprint = Console.print("<<<") } } -import a._ -import _root_.b._ +import a.* +import _root_.b.* object Test extends App { { diff --git a/tests/run/MeterCaseClass.scala b/tests/run/MeterCaseClass.scala index 4bc29cf8161a..75790f08d5c6 100644 --- a/tests/run/MeterCaseClass.scala +++ b/tests/run/MeterCaseClass.scala @@ -43,8 +43,8 @@ package b { protected def proprint = Console.print("<<<") } } -import a._ -import _root_.b._ +import a.* +import _root_.b.* object Test extends App { { diff --git a/tests/run/Pouring2.scala b/tests/run/Pouring2.scala index d0d5241431da..bce2b961ab47 100644 --- a/tests/run/Pouring2.scala +++ b/tests/run/Pouring2.scala @@ -3,7 +3,7 @@ class Pouring(capacity: Vector[Int]) { type Content = Vector[Int] sealed trait Move { - import Move._ + import Move.* def apply(content: Content): Content = this match { case Empty(g) => content.updated(g, 0) case Fill(g) => content.updated(g, capacity(g)) diff --git a/tests/run/ReplacementMatching.scala b/tests/run/ReplacementMatching.scala index d8880568e897..846f1c0a0966 100644 --- a/tests/run/ReplacementMatching.scala +++ b/tests/run/ReplacementMatching.scala @@ -1,7 +1,7 @@ -import util.matching._ +import util.matching.* diff --git a/tests/run/Signals.scala b/tests/run/Signals.scala index 1246896e940b..bf5232bcd2d4 100644 --- a/tests/run/Signals.scala +++ b/tests/run/Signals.scala @@ -1,5 +1,5 @@ -import annotation.unchecked._ +import annotation.unchecked.* import compiletime.uninitialized package frp: @@ -38,7 +38,7 @@ package frp: end Var end frp -import frp._ +import frp.* class BankAccount: def balance: Signal[Int] = myBalance diff --git a/tests/run/Signals1.scala b/tests/run/Signals1.scala index cc83d4730152..78b7b12d8d10 100644 --- a/tests/run/Signals1.scala +++ b/tests/run/Signals1.scala @@ -1,5 +1,5 @@ -import annotation.unchecked._ +import annotation.unchecked.* package frp: trait Signal[+T]: @@ -50,7 +50,7 @@ package frp: end Signal end frp -import frp._ +import frp.* class BankAccount: def balance: Signal[Int] = myBalance diff --git a/tests/run/byname-implicits-17.scala b/tests/run/byname-implicits-17.scala index 676f7fe82c8d..cf93a32dfa80 100644 --- a/tests/run/byname-implicits-17.scala +++ b/tests/run/byname-implicits-17.scala @@ -70,7 +70,7 @@ object Show { } object Test extends App { - import ListInstances._ + import ListInstances.* val sl = Show[List[Int]] assert(sl.show(List(1, 2, 3)) == "Left((1, (Left((2, (Left((3, (Right(Left(())), ()), ()), ())") } diff --git a/tests/run/case-class-serializable.scala b/tests/run/case-class-serializable.scala index 10fc28a6fcab..abb68cdfa621 100644 --- a/tests/run/case-class-serializable.scala +++ b/tests/run/case-class-serializable.scala @@ -10,7 +10,7 @@ object Test { // From https://github.com/scala/scala/pull/5278 object SerDes { - import java.io._ + import java.io.* def assertNotSerializable(a: AnyRef): Unit = { try { diff --git a/tests/run/cochis-example.scala b/tests/run/cochis-example.scala index 446f52e59c3e..93ce9323d2f7 100644 --- a/tests/run/cochis-example.scala +++ b/tests/run/cochis-example.scala @@ -1,5 +1,5 @@ -import Predef.{assert, $conforms => _} +import Predef.{assert, $conforms as _} trait A { given id[X]: (X => X) = x => x def trans[X](x: X)(using f: X => X) = f(x) // (2) diff --git a/tests/run/cochis.scala b/tests/run/cochis.scala index 07037432965c..d0f782937afb 100644 --- a/tests/run/cochis.scala +++ b/tests/run/cochis.scala @@ -1,4 +1,4 @@ -import Predef.{$conforms => _, _} +import Predef.{$conforms as _, *} trait A { diff --git a/tests/run/collections.scala b/tests/run/collections.scala index 516d3e038601..ceb169b398af 100644 --- a/tests/run/collections.scala +++ b/tests/run/collections.scala @@ -1,4 +1,4 @@ -import scala.collection._ +import scala.collection.* import scala.language.postfixOps object Test extends App { diff --git a/tests/run/colltest.scala b/tests/run/colltest.scala index 22404f0e9ed5..9114b0bc6df0 100644 --- a/tests/run/colltest.scala +++ b/tests/run/colltest.scala @@ -1,4 +1,4 @@ -import collection.mutable._ +import collection.mutable.* class TestSet(s0: Set[Int], s1: Set[Int]) { val Iterations = 10 val Range = 100000 diff --git a/tests/run/colltest1.scala b/tests/run/colltest1.scala index 4248e3d99c96..4de99dbcd5dc 100644 --- a/tests/run/colltest1.scala +++ b/tests/run/colltest1.scala @@ -1,7 +1,7 @@ /* * filter: inliner warnings; re-run with */ -import scala.collection._ +import scala.collection.* import scala.language.postfixOps object Test extends App { diff --git a/tests/run/colltest5/CollectionStrawMan5_1.scala b/tests/run/colltest5/CollectionStrawMan5_1.scala index 2ab82377d363..e480b7e8c088 100644 --- a/tests/run/colltest5/CollectionStrawMan5_1.scala +++ b/tests/run/colltest5/CollectionStrawMan5_1.scala @@ -1,7 +1,7 @@ package colltest5 package strawman.collections -import Predef.{augmentString => _, wrapString => _, _} +import Predef.{augmentString as _, wrapString as _, *} import scala.reflect.ClassTag import annotation.unchecked.uncheckedVariance import annotation.tailrec diff --git a/tests/run/colltest5/CollectionTests_2.scala b/tests/run/colltest5/CollectionTests_2.scala index 1a0bf37acb00..9e2a55e8306a 100644 --- a/tests/run/colltest5/CollectionTests_2.scala +++ b/tests/run/colltest5/CollectionTests_2.scala @@ -1,9 +1,9 @@ -import Predef.{augmentString => _, wrapString => _, _} +import Predef.{augmentString as _, wrapString as _, *} import scala.reflect.ClassTag object Test { - import colltest5.strawman.collections._ - import CollectionStrawMan5._ + import colltest5.strawman.collections.* + import CollectionStrawMan5.* def seqOps(xs: Seq[Int]) = { val x1 = xs.foldLeft("")(_ + _) diff --git a/tests/run/colltest6/CollectionStrawMan6_1.scala b/tests/run/colltest6/CollectionStrawMan6_1.scala index 91f77f553cce..bed5c476b96d 100644 --- a/tests/run/colltest6/CollectionStrawMan6_1.scala +++ b/tests/run/colltest6/CollectionStrawMan6_1.scala @@ -1,14 +1,14 @@ package colltest6 package strawman.collections -import Predef.{augmentString => _, wrapString => _, _} +import Predef.{augmentString as _, wrapString as _, *} import scala.reflect.ClassTag import annotation.unchecked.uncheckedVariance import annotation.tailrec import compiletime.uninitialized class LowPriority { - import CollectionStrawMan6._ + import CollectionStrawMan6.* /** Convert array to iterable via view. Lower priority than ArrayOps */ implicit def arrayToView[T](xs: Array[T]): ArrayView[T] = new ArrayView[T](xs) diff --git a/tests/run/colltest6/CollectionTests_2.scala b/tests/run/colltest6/CollectionTests_2.scala index 124a526b4f0f..e41392842cf5 100644 --- a/tests/run/colltest6/CollectionTests_2.scala +++ b/tests/run/colltest6/CollectionTests_2.scala @@ -1,9 +1,9 @@ -import Predef.{augmentString => _, wrapString => _, intArrayOps => _, booleanArrayOps => _, genericArrayOps => _, refArrayOps => _, wrapIntArray => _, wrapBooleanArray => _, wrapRefArray => _, genericWrapArray => _, _} +import Predef.{augmentString as _, wrapString as _, intArrayOps as _, booleanArrayOps as _, genericArrayOps as _, refArrayOps as _, wrapIntArray as _, wrapBooleanArray as _, wrapRefArray as _, genericWrapArray as _, *} import scala.reflect.ClassTag object Test { - import colltest6.strawman.collections._ - import CollectionStrawMan6._ + import colltest6.strawman.collections.* + import CollectionStrawMan6.* def seqOps(xs: Seq[Int]) = { val x1 = xs.foldLeft("")(_ + _) diff --git a/tests/run/config.scala b/tests/run/config.scala index 8476ab673fc4..7f4cf6f23c88 100644 --- a/tests/run/config.scala +++ b/tests/run/config.scala @@ -6,8 +6,8 @@ case class Config(name: String, age: Int) object Imperative { - import Configs._ - import Exceptions._ + import Configs.* + import Exceptions.* // Algebraic Effects @@ -62,8 +62,8 @@ object Exceptions { } object Test extends App { - import Configs._ - import Exceptions._ + import Configs.* + import Exceptions.* def readName: Configured[Possibly[Name]] = { val parts = config.name.split(" ") @@ -117,9 +117,9 @@ object OptionTest extends App { } object FancyStuff { - import Configs._ - import Exceptions._ - import Test._ + import Configs.* + import Exceptions.* + import Test.* type PC[T] = Possibly[Configured[T]] diff --git a/tests/run/curried-mirror.scala b/tests/run/curried-mirror.scala index 9655160ef89a..84c544c7318b 100644 --- a/tests/run/curried-mirror.scala +++ b/tests/run/curried-mirror.scala @@ -1,4 +1,4 @@ -import scala.deriving._ +import scala.deriving.* object Test extends App { case class Prod0(i: Int) diff --git a/tests/run/deadlock.scala b/tests/run/deadlock.scala index 2cc1d883e3ed..bc4a933dc238 100644 --- a/tests/run/deadlock.scala +++ b/tests/run/deadlock.scala @@ -1,6 +1,6 @@ // from https://github.com/rickynils/scalacheck/issues/290 -import scala.concurrent._ -import scala.concurrent.duration._ +import scala.concurrent.* +import scala.concurrent.duration.* import java.util.concurrent.Executors object Test { diff --git a/tests/run/defunctionalized.scala b/tests/run/defunctionalized.scala index aa236b8d22fb..6c1b749e40b8 100644 --- a/tests/run/defunctionalized.scala +++ b/tests/run/defunctionalized.scala @@ -18,7 +18,7 @@ def filter(f: Filter, elems: List[Int]): List[Int] = elems match val xs = List(1, 2, 3, 4, 5) -import Filter._ +import Filter.* @main def Test = println(filter(IsOdd , xs)) diff --git a/tests/run/derived-specificity.scala b/tests/run/derived-specificity.scala index 1dc0eda43da5..1518fe0e01fe 100644 --- a/tests/run/derived-specificity.scala +++ b/tests/run/derived-specificity.scala @@ -1,4 +1,4 @@ -import scala.deriving._ +import scala.deriving.* object Test extends App { case class Foo() derives Bar, Baz @@ -20,9 +20,9 @@ object Test extends App { } val bar = implicitly[Bar[Foo]] - assert(bar.id == "Bar.derived") + assert(bar.id == "Bar.derived") val baz = implicitly[Baz[Foo]] - assert(baz.id == "Baz.derived") + assert(baz.id == "Baz.derived") } diff --git a/tests/run/deriving.scala b/tests/run/deriving.scala index 87bd1e088388..b995241c58dd 100644 --- a/tests/run/deriving.scala +++ b/tests/run/deriving.scala @@ -8,7 +8,7 @@ sealed trait U // U MUST NOT have a companion here! case class C() extends U object Test extends App { - import deriving._ + import deriving.* case class AA[X >: Null <: AnyRef](x: X, y: X, z: String) diff --git a/tests/run/duration-coarsest.scala b/tests/run/duration-coarsest.scala index 21d35c9b2e3f..ab2a18e1099e 100644 --- a/tests/run/duration-coarsest.scala +++ b/tests/run/duration-coarsest.scala @@ -1,4 +1,4 @@ -import scala.concurrent.duration._ +import scala.concurrent.duration.* import scala.language.postfixOps object Test extends App { diff --git a/tests/run/elidable-noflags.scala b/tests/run/elidable-noflags.scala index 1b9c5118bb3d..ad955af65ecb 100644 --- a/tests/run/elidable-noflags.scala +++ b/tests/run/elidable-noflags.scala @@ -1,5 +1,5 @@ -import annotation._ -import elidable._ +import annotation.* +import elidable.* object Test { @elidable(FINEST) def f1() = println("Good for me, I was not elided.") diff --git a/tests/run/enum-Color.scala b/tests/run/enum-Color.scala index b00493dc00b9..3d968a251aa8 100644 --- a/tests/run/enum-Color.scala +++ b/tests/run/enum-Color.scala @@ -8,7 +8,7 @@ object Test { for (color <- Color.values) { println(s"$color: ${color.toString}") assert(Color.valueOf(color.toString) eq color) - import Color._ + import Color.* color match { case Red | Green | Blue => } diff --git a/tests/run/enum-HList.scala b/tests/run/enum-HList.scala index c019cb6cc78c..476b4a3284af 100644 --- a/tests/run/enum-HList.scala +++ b/tests/run/enum-HList.scala @@ -4,7 +4,7 @@ enum HLst { } object Test { - import HLst._ + import HLst.* def length(hl: HLst): Int = hl match { case HCons(_, tl) => 1 + length(tl) case HNil => 0 diff --git a/tests/run/enum-List1.scala b/tests/run/enum-List1.scala index f3e672e53571..121ee3b16974 100644 --- a/tests/run/enum-List1.scala +++ b/tests/run/enum-List1.scala @@ -3,7 +3,7 @@ enum List[T] { case Nil() } object Test { - import List._ + import List.* val xs = Cons(1, Cons(2, Cons(3, Nil()))) def main(args: Array[String]) = println(xs) } diff --git a/tests/run/enum-List2.scala b/tests/run/enum-List2.scala index 9ceb3d278f7e..e6cbaed3839b 100644 --- a/tests/run/enum-List2.scala +++ b/tests/run/enum-List2.scala @@ -3,7 +3,7 @@ enum List[+T] { case Nil } object Test { - import List._ + import List.* val xs = Cons(1, Cons(2, Cons(3, Nil))) def main(args: Array[String]) = println(xs) } diff --git a/tests/run/enum-List2a.scala b/tests/run/enum-List2a.scala index 9ceb3d278f7e..e6cbaed3839b 100644 --- a/tests/run/enum-List2a.scala +++ b/tests/run/enum-List2a.scala @@ -3,7 +3,7 @@ enum List[+T] { case Nil } object Test { - import List._ + import List.* val xs = Cons(1, Cons(2, Cons(3, Nil))) def main(args: Array[String]) = println(xs) } diff --git a/tests/run/enum-Option.scala b/tests/run/enum-Option.scala index 5762b4089317..b1248e788103 100644 --- a/tests/run/enum-Option.scala +++ b/tests/run/enum-Option.scala @@ -12,7 +12,7 @@ object Option { } object Test { - import Option._ + import Option.* def main(args: Array[String]) = { assert(Some(None).isDefined) Option("22") match { case Option.Some(x) => assert(x == "22") } diff --git a/tests/run/enum-Option1.scala b/tests/run/enum-Option1.scala index 407ece47a025..04181ec58a14 100644 --- a/tests/run/enum-Option1.scala +++ b/tests/run/enum-Option1.scala @@ -12,7 +12,7 @@ object Option1 { } object Test { - import Option1._ + import Option1.* def main(args: Array[String]) = { assert(Some1(None1).isDefined) Option1("22") match { case Option1.Some1(x) => assert(x == "22") } diff --git a/tests/run/enum-Tree.scala b/tests/run/enum-Tree.scala index 77f08c997bad..b2a0591046f8 100644 --- a/tests/run/enum-Tree.scala +++ b/tests/run/enum-Tree.scala @@ -11,7 +11,7 @@ enum Tree[T] { } object Test { - import Tree._ + import Tree.* def eval[T](e: Tree[T]): T = e match { case True => true diff --git a/tests/run/enum-nat.scala b/tests/run/enum-nat.scala index 47bddcc665cd..4367785ea754 100644 --- a/tests/run/enum-nat.scala +++ b/tests/run/enum-nat.scala @@ -1,5 +1,5 @@ -import Nat._ -import compiletime._ +import Nat.* +import compiletime.* enum Nat: case Zero diff --git a/tests/run/enum-values-order.scala b/tests/run/enum-values-order.scala index 400cdbc8aac5..dfe9c0d8f685 100644 --- a/tests/run/enum-values-order.scala +++ b/tests/run/enum-values-order.scala @@ -23,7 +23,7 @@ enum Color extends java.lang.Enum[Color]: val labels = Seq("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z") def testLatin1() = - import LatinAlphabet._ + import LatinAlphabet.* val ordered = Seq(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) assert(ordered sameElements LatinAlphabet.values) @@ -31,7 +31,7 @@ enum Color extends java.lang.Enum[Color]: assert(labels == ordered.map(_.productPrefix)) def testLatin2() = - import LatinAlphabet2._ + import LatinAlphabet2.* val ordered = Seq(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) assert(ordered sameElements LatinAlphabet2.values) @@ -39,7 +39,7 @@ enum Color extends java.lang.Enum[Color]: assert(labels == ordered.map(_.name)) def testLatin3() = - import LatinAlphabet3._ + import LatinAlphabet3.* val ordered = Seq(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) assert(ordered sameElements LatinAlphabet3.values) @@ -53,7 +53,7 @@ enum Color extends java.lang.Enum[Color]: end testLatin def testColor() = - import Color._ + import Color.* val ordered = Seq(Red, Green, Blue, Aqua, Grey, Black, White, Emerald, Brown) val ordinals = Seq(0, 1, 2, 3, 4, 5, 6, 7, 8) val labels = Seq("Red", "Green", "Blue", "Aqua", "Grey", "Black", "White", "Emerald", "Brown") diff --git a/tests/run/enum-values.scala b/tests/run/enum-values.scala index a7b838ba73cd..b6ac3d2f9bce 100644 --- a/tests/run/enum-values.scala +++ b/tests/run/enum-values.scala @@ -32,7 +32,7 @@ enum ClassOnly: // this should still generate the `ordinal` and `fromOrdinal` co case BranchProd(i: Int) @main def Test: Unit = - import Color._, Suits._, Tag._, Expr._, ListLike._, TypeCtorsK._, MixedParams._, ClassOnly._ + import Color._, Suits._, Tag._, Expr._, ListLike._, TypeCtorsK._, MixedParams._, ClassOnly.* type FromOrdinal[T] = { def fromOrdinal(ordinal: Int): T diff --git a/tests/run/enums-precise.scala b/tests/run/enums-precise.scala index 1ae98ca6664f..380c1e142ee5 100644 --- a/tests/run/enums-precise.scala +++ b/tests/run/enums-precise.scala @@ -8,8 +8,8 @@ enum Ast: case Ident(name: String) case Apply(fn: Ast, args: NonEmptyList[Ast]) -import NonEmptyList._ -import Ast._ +import NonEmptyList.* +import Ast.* // This example showcases the widening when inferring enum case types. // With scala 2 case class hierarchies, if One.apply(1) returns One[Int] and Many.apply(2, One(3)) returns Many[Int] diff --git a/tests/run/enums-serialization-compat.scala b/tests/run/enums-serialization-compat.scala index 940e726c05a0..736b82074af3 100644 --- a/tests/run/enums-serialization-compat.scala +++ b/tests/run/enums-serialization-compat.scala @@ -1,4 +1,4 @@ -import java.io._ +import java.io.* import scala.util.Using enum JColor extends java.lang.Enum[JColor]: diff --git a/tests/run/exports.scala b/tests/run/exports.scala index f68312ca54e2..02862f2d0a39 100644 --- a/tests/run/exports.scala +++ b/tests/run/exports.scala @@ -31,7 +31,7 @@ object Test extends App { Copier.config2 def test() = { - import Copier._ + import Copier.* print() scanIt() val x = config2 diff --git a/tests/run/extension-override.scala b/tests/run/extension-override.scala index 00246f611391..bd473547bf8f 100644 --- a/tests/run/extension-override.scala +++ b/tests/run/extension-override.scala @@ -7,6 +7,6 @@ object B extends A: override def len: Int = s.length + 1 @main def Test = - import B._ + import B.* assert("abc".len == 4) diff --git a/tests/run/extmethod-overload.scala b/tests/run/extmethod-overload.scala index 64cddbfa2e7d..c13a2a99aaa8 100644 --- a/tests/run/extmethod-overload.scala +++ b/tests/run/extmethod-overload.scala @@ -41,7 +41,7 @@ object Test extends App { // Test with imported extension methods object test2 { - import test1._ + import test1.* assert((1 |+| 2) == 3) assert((1 |+| "2") == 2) @@ -102,7 +102,7 @@ object Test extends App { def yy (y: Int) = x - y } - import D._ + import D.* assert((1 yy 2) == 3) // imported extension method takes precedence trait Rectangle { diff --git a/tests/run/extmethods2.scala b/tests/run/extmethods2.scala index 10b5640c4901..f876b00a9974 100644 --- a/tests/run/extmethods2.scala +++ b/tests/run/extmethods2.scala @@ -30,7 +30,7 @@ object Test extends App { } object B { - import A._ + import A.* val xs = List(1, 2, 3) assert(xs.second == 2) assert(xs.third == 3) diff --git a/tests/run/fully-abstract-interface.scala b/tests/run/fully-abstract-interface.scala index 86156586c85d..34fa305ad229 100644 --- a/tests/run/fully-abstract-interface.scala +++ b/tests/run/fully-abstract-interface.scala @@ -12,7 +12,7 @@ object Test { } def testInterface(arithmetic: Arithmetic): Unit = { - import arithmetic._ + import arithmetic.* val const1 = Constant(1) println("underlying rep: " + const1.getClass) println(const1.eval) diff --git a/tests/run/fully-abstract-nat-1.scala b/tests/run/fully-abstract-nat-1.scala index 2be9a62bb594..5c829c295484 100644 --- a/tests/run/fully-abstract-nat-1.scala +++ b/tests/run/fully-abstract-nat-1.scala @@ -9,7 +9,7 @@ object Test { } def test(numbers: Numbers) = { - import numbers._ + import numbers.* val zero: Nat = Zero() val one: Nat = Succ(zero) diff --git a/tests/run/fully-abstract-nat-2.scala b/tests/run/fully-abstract-nat-2.scala index 30e34ba9b8ac..82ffbe535e6b 100644 --- a/tests/run/fully-abstract-nat-2.scala +++ b/tests/run/fully-abstract-nat-2.scala @@ -11,7 +11,7 @@ object Test { } def test(numbers: Numbers) = { - import numbers._ + import numbers.* val zero: Nat = Zero() val one: Nat = Succ(zero) diff --git a/tests/run/fully-abstract-nat-3.scala b/tests/run/fully-abstract-nat-3.scala index d4b4a37d2810..78cfedafcea1 100644 --- a/tests/run/fully-abstract-nat-3.scala +++ b/tests/run/fully-abstract-nat-3.scala @@ -9,7 +9,7 @@ object Test { } def test(numbers: Numbers) = { - import numbers._ + import numbers.* val zero: Nat = Zero() val one: Nat = Succ(zero) diff --git a/tests/run/fully-abstract-nat-4.scala b/tests/run/fully-abstract-nat-4.scala index a354c0121357..8af339883f4f 100644 --- a/tests/run/fully-abstract-nat-4.scala +++ b/tests/run/fully-abstract-nat-4.scala @@ -9,7 +9,7 @@ object Test { } def test(numbers: Numbers) = { - import numbers._ + import numbers.* val zero: Nat = Zero() val one: Nat = Succ(zero) diff --git a/tests/run/fully-abstract-nat-5.scala b/tests/run/fully-abstract-nat-5.scala index cb6142ff9016..7c4b67dd2989 100644 --- a/tests/run/fully-abstract-nat-5.scala +++ b/tests/run/fully-abstract-nat-5.scala @@ -9,7 +9,7 @@ object Test { } def test(numbers: Numbers) = { - import numbers._ + import numbers.* val zero: Nat = Zero() val one: Nat = Succ(zero) diff --git a/tests/run/fully-abstract-nat-6.scala b/tests/run/fully-abstract-nat-6.scala index 14bff32961ba..4693026692a7 100644 --- a/tests/run/fully-abstract-nat-6.scala +++ b/tests/run/fully-abstract-nat-6.scala @@ -9,7 +9,7 @@ object Test { } def test(numbers: Numbers) = { - import numbers._ + import numbers.* val zero: Nat = Zero() val one: Nat = Succ(zero) diff --git a/tests/run/fully-abstract-nat-7.scala b/tests/run/fully-abstract-nat-7.scala index 50ffdaa69062..98a9649af5a6 100644 --- a/tests/run/fully-abstract-nat-7.scala +++ b/tests/run/fully-abstract-nat-7.scala @@ -9,7 +9,7 @@ object Test { } def test(numbers: Numbers) = { - import numbers._ + import numbers.* val zero: Nat = Zero val one: Nat = Succ(zero) diff --git a/tests/run/fully-abstract-nat.scala b/tests/run/fully-abstract-nat.scala index 16106902d3da..2073d03b7313 100644 --- a/tests/run/fully-abstract-nat.scala +++ b/tests/run/fully-abstract-nat.scala @@ -18,7 +18,7 @@ object Test { println() { - import UnboundedIntImplementation._ + import UnboundedIntImplementation.* val large = (BigInt(1) << 100).asInstanceOf[Succ] large match { case Zero() => println("test fail") @@ -30,7 +30,7 @@ object Test { } def testInterface(numbers: Numbers): Unit = { - import numbers._ + import numbers.* val zero = Zero() println("underlying rep: " + zero) diff --git a/tests/run/future-flatmap-exec-count.scala b/tests/run/future-flatmap-exec-count.scala index 0c6f69f853b3..a6c47ebfb876 100644 --- a/tests/run/future-flatmap-exec-count.scala +++ b/tests/run/future-flatmap-exec-count.scala @@ -1,4 +1,4 @@ -import scala.concurrent._ +import scala.concurrent.* import java.util.concurrent.atomic.AtomicInteger object Test { diff --git a/tests/run/generic/Color.scala b/tests/run/generic/Color.scala index 7db703a15280..9bec97b8dd00 100644 --- a/tests/run/generic/Color.scala +++ b/tests/run/generic/Color.scala @@ -1,6 +1,6 @@ package generic -import Shapes._ +import Shapes.* /** enum Color { * case Red diff --git a/tests/run/generic/List.scala b/tests/run/generic/List.scala index 9e3bcf13964c..f2849db7fe84 100644 --- a/tests/run/generic/List.scala +++ b/tests/run/generic/List.scala @@ -1,6 +1,6 @@ package generic -import Shapes._ +import Shapes.* /** enum List[T] { * case Cons(x: T, xs: List[T]) diff --git a/tests/run/generic/SearchResult.scala b/tests/run/generic/SearchResult.scala index 3dbfe9ed4fe2..b0f468c93baa 100644 --- a/tests/run/generic/SearchResult.scala +++ b/tests/run/generic/SearchResult.scala @@ -1,6 +1,6 @@ package generic -import Shapes._ +import Shapes.* /** enum SearchResult { * case Success(result: Color) diff --git a/tests/run/generic/Serialization.scala b/tests/run/generic/Serialization.scala index 2aaceb9c6d47..4912c96956b4 100644 --- a/tests/run/generic/Serialization.scala +++ b/tests/run/generic/Serialization.scala @@ -3,7 +3,7 @@ package generic import java.io.{DataInputStream,DataOutputStream} import scala.collection.IterableFactory import scala.collection.mutable.ArrayBuffer -import Shapes._ +import Shapes.* object Serialization { diff --git a/tests/run/generic/Test.scala b/tests/run/generic/Test.scala index 06fdc3b0dafd..ebf37938c998 100644 --- a/tests/run/generic/Test.scala +++ b/tests/run/generic/Test.scala @@ -1,12 +1,12 @@ -import generic._ -import Tree._ -import List._ -import java.io._ -import Shapes._ -import SearchResult._ +import generic.* +import Tree.* +import List.* +import java.io.* +import Shapes.* +import SearchResult.* object Test { - import Serialization._ + import Serialization.* private var lCount, tCount, sCount = 0 diff --git a/tests/run/generic/Tree.scala b/tests/run/generic/Tree.scala index dddee59beb7e..19eca23b32d7 100644 --- a/tests/run/generic/Tree.scala +++ b/tests/run/generic/Tree.scala @@ -1,6 +1,6 @@ package generic -import Shapes._ +import Shapes.* /** enum Tree[T] { * case True extends Tree[Boolean] diff --git a/tests/run/hmap-covariant.scala b/tests/run/hmap-covariant.scala index c4c426e81a1d..1d1bace3193a 100644 --- a/tests/run/hmap-covariant.scala +++ b/tests/run/hmap-covariant.scala @@ -69,7 +69,7 @@ object syntax { object Test { def main(args: Array[String]): Unit = { - import syntax.hmap._ + import syntax.hmap.* val map1 = TCons(HEntry[K = "name"]("foo"), diff --git a/tests/run/hmap.scala b/tests/run/hmap.scala index 099cd127a116..e91e660ae464 100644 --- a/tests/run/hmap.scala +++ b/tests/run/hmap.scala @@ -70,7 +70,7 @@ object syntax { object Test { def main(args: Array[String]): Unit = { - import syntax.hmap._ + import syntax.hmap.* val map1 = TCons(HEntry[K = "name"]("foo"), diff --git a/tests/run/i10082.scala b/tests/run/i10082.scala index 299083da3567..2ce4950a2de8 100644 --- a/tests/run/i10082.scala +++ b/tests/run/i10082.scala @@ -5,7 +5,7 @@ object Kotlin: def it[T](using ctx: Ctx[T]) = ctx.x -import Kotlin._ +import Kotlin.* @main def Test = val res = List(1).map(fun(it + 1)) diff --git a/tests/run/i10511.scala b/tests/run/i10511.scala index f1548ea7482a..2ba7e114fd4c 100644 --- a/tests/run/i10511.scala +++ b/tests/run/i10511.scala @@ -7,7 +7,7 @@ enum Bool { } -import Bool._ +import Bool.* type Not[B <: Bool] = B match { case True.type => False.type diff --git a/tests/run/i10724.scala b/tests/run/i10724.scala index 7e0791933a8d..40566c63d403 100644 --- a/tests/run/i10724.scala +++ b/tests/run/i10724.scala @@ -8,7 +8,7 @@ object Exporter { export Exportee._ } -import Exporter._ +import Exporter.* @main def Test = println(foo("a", "b", "c")) diff --git a/tests/run/i10884/Test_2.scala b/tests/run/i10884/Test_2.scala index 72e7fafa9674..84111522b2ca 100644 --- a/tests/run/i10884/Test_2.scala +++ b/tests/run/i10884/Test_2.scala @@ -1,7 +1,7 @@ object Exporter: export JavaExporter_1._ -import Exporter._ +import Exporter.* @main def Test = println(varargExample("a", "b", "c")) diff --git a/tests/run/i2360.scala b/tests/run/i2360.scala index d950d1c2d3dd..2b33b5295573 100644 --- a/tests/run/i2360.scala +++ b/tests/run/i2360.scala @@ -1,7 +1,7 @@ object Test { def main(args: Array[String]): Unit = { - import Foo._ + import Foo.* println(foo) } } diff --git a/tests/run/i2396c.scala b/tests/run/i2396c.scala index 65cd6e71d211..be10c9fba832 100644 --- a/tests/run/i2396c.scala +++ b/tests/run/i2396c.scala @@ -1,5 +1,5 @@ class Bees { - import Test._ + import Test.* def f: PartialFunction[Bee, Unit] = { case Test.Bee(_) => "" diff --git a/tests/run/i2939.scala b/tests/run/i2939.scala index f032dc06aaf1..9abdc6da33fc 100644 --- a/tests/run/i2939.scala +++ b/tests/run/i2939.scala @@ -1,4 +1,4 @@ -import scala.collection.mutable._ +import scala.collection.mutable.* class Tag(val name: String, val buffer: Buffer[Tag] = ArrayBuffer()) { def space(n: Int = 0): String = { diff --git a/tests/run/i4446.scala b/tests/run/i4446.scala index 080153c3598a..2eb6253105b2 100644 --- a/tests/run/i4446.scala +++ b/tests/run/i4446.scala @@ -4,7 +4,7 @@ class Foo { object Test { def serializeDeserialize[T <: AnyRef](obj: T): T = { - import java.io._ + import java.io.* val buffer = new ByteArrayOutputStream val out = new ObjectOutputStream(buffer) out.writeObject(obj) diff --git a/tests/run/i4754.scala b/tests/run/i4754.scala index 0907880e6499..f0f3fd36dde3 100644 --- a/tests/run/i4754.scala +++ b/tests/run/i4754.scala @@ -5,7 +5,7 @@ object Foo { } class Foo { - import Foo._ + import Foo.* inline def foo = x + Foo.x + y + Foo.y + z + Foo.z } diff --git a/tests/run/i4947c.scala b/tests/run/i4947c.scala index bd096f6b7202..064db6647f8a 100644 --- a/tests/run/i4947c.scala +++ b/tests/run/i4947c.scala @@ -12,7 +12,7 @@ object Foo { } object Test { - import Foo._ + import Foo.* def main(args: Array[String]): Unit = { track { printStack("main1") diff --git a/tests/run/i4961.scala b/tests/run/i4961.scala index c49056e88925..eae3cc50f331 100644 --- a/tests/run/i4961.scala +++ b/tests/run/i4961.scala @@ -12,8 +12,8 @@ enum Cat extends Animal { } object Test { - import Dog._ - import Cat._ + import Dog.* + import Cat.* def main(args: Array[String]): Unit = { val values = List( diff --git a/tests/run/i5455.scala b/tests/run/i5455.scala index 5e242e55a13f..4a159e049cd5 100644 --- a/tests/run/i5455.scala +++ b/tests/run/i5455.scala @@ -18,7 +18,7 @@ object Library { } object Test extends App { - import Library._ + import Library.* val x = Nat(3) val y = Nat(4) diff --git a/tests/run/i5527.scala b/tests/run/i5527.scala index bd3f4b37e4d3..d79e64182f98 100644 --- a/tests/run/i5527.scala +++ b/tests/run/i5527.scala @@ -22,7 +22,7 @@ object Library { } object Test extends App { - import Library._ + import Library.* //import Library.Set.setContravariant if this is imported the program will run correctly val F = implicitly[Contravariant[Set]] diff --git a/tests/run/i5823.scala b/tests/run/i5823.scala index 445eed10a89e..bb854ada3c12 100644 --- a/tests/run/i5823.scala +++ b/tests/run/i5823.scala @@ -13,7 +13,7 @@ object Foo { def foo(a: A|Null): Unit = { println("foo(A) called") } - + def foo(b: B|Null): Unit = { println("foo(B) called") } @@ -45,7 +45,7 @@ object Foo { object Test { def main(args: Array[String]): Unit = { - import Foo._ + import Foo.* foo(new A) foo(new B) foo(new C) diff --git a/tests/run/i7212/CompatVargs.scala b/tests/run/i7212/CompatVargs.scala index 1ad60229b8d8..337f40171c44 100644 --- a/tests/run/i7212/CompatVargs.scala +++ b/tests/run/i7212/CompatVargs.scala @@ -1,4 +1,4 @@ -import scala.annotation._ +import scala.annotation.* class CompatVargs { @varargs diff --git a/tests/run/i7843.scala b/tests/run/i7843.scala index 44ec1cf9b3d9..12bcbe4bf868 100644 --- a/tests/run/i7843.scala +++ b/tests/run/i7843.scala @@ -1,4 +1,4 @@ -import scala.concurrent._, duration._ +import scala.concurrent._, duration.* object Test { implicit val ec: scala.concurrent.ExecutionContext = scala.concurrent.ExecutionContext.global diff --git a/tests/run/i7960.scala b/tests/run/i7960.scala index 93cf38d4d2af..423b6111d8b1 100644 --- a/tests/run/i7960.scala +++ b/tests/run/i7960.scala @@ -1,5 +1,5 @@ import scala.concurrent.ExecutionContext.Implicits.global -import scala.concurrent.duration._ +import scala.concurrent.duration.* import scala.concurrent.{Await, Future} class A() { diff --git a/tests/run/i8033.scala b/tests/run/i8033.scala index b047ac552439..2452415752c9 100644 --- a/tests/run/i8033.scala +++ b/tests/run/i8033.scala @@ -21,7 +21,7 @@ object Test { } def roundTrip[A](a: A): A = { - import java.io._ + import java.io.* val aos = new ByteArrayOutputStream() val oos = new ObjectOutputStream(aos) diff --git a/tests/run/i9011.scala b/tests/run/i9011.scala index c75871a865bb..22ab9bc1e1a6 100644 --- a/tests/run/i9011.scala +++ b/tests/run/i9011.scala @@ -2,7 +2,7 @@ enum Opt[+T] derives Eq: case Sm[T](t: T) extends Opt[T] case Nn -import scala.deriving._ +import scala.deriving.* import scala.compiletime.{erasedValue, summonInline} trait Eq[T] { @@ -50,7 +50,7 @@ object Eq { } object Test extends App { - import Opt._ + import Opt.* val eqoi = summon[Eq[Opt[Int]]] assert(eqoi.eqv(Sm(23), Sm(23))) assert(eqoi.eqv(Nn, Nn)) diff --git a/tests/run/i9473.scala b/tests/run/i9473.scala index 4fa18cab0c29..384870ea42af 100644 --- a/tests/run/i9473.scala +++ b/tests/run/i9473.scala @@ -1,4 +1,4 @@ -import scala.deriving._ +import scala.deriving.* import scala.compiletime.{erasedValue, summonInline} inline def summonAll[T <: Tuple]: List[Eq[_]] = inline erasedValue[T] match { @@ -52,7 +52,7 @@ enum Tree[T] derives Eq { @main def Test = { - import Tree._ + import Tree.* val t1 = Branch(Leaf(1), Leaf(1)) assert(summon[Eq[Tree[Int]]].eqv(t1, t1)) diff --git a/tests/run/i9881.scala b/tests/run/i9881.scala index a5786aa4d322..a172bcf8e2ec 100644 --- a/tests/run/i9881.scala +++ b/tests/run/i9881.scala @@ -1,4 +1,4 @@ -import java.io._ +import java.io.* class Config(s: String) diff --git a/tests/run/implicit-functors.scala b/tests/run/implicit-functors.scala index a37c932923d7..5ff3e926ee49 100644 --- a/tests/run/implicit-functors.scala +++ b/tests/run/implicit-functors.scala @@ -3,7 +3,7 @@ object Utils { type Const[c] = [t] =>> c } -import Utils._ +import Utils.* class Instances[F[_[_]], T[_]] diff --git a/tests/run/implicit-functors2.scala b/tests/run/implicit-functors2.scala index 8acc4c25f546..74c99f30722e 100644 --- a/tests/run/implicit-functors2.scala +++ b/tests/run/implicit-functors2.scala @@ -3,7 +3,7 @@ object Utils { type Const[c] = [t] =>> c } -import Utils._ +import Utils.* abstract class ErasedInstances { type FT } class ErasedProductInstances(override val toString: String) extends ErasedInstances diff --git a/tests/run/implicitShortcut/Test_3.scala b/tests/run/implicitShortcut/Test_3.scala index 8e61c6db3758..7e4359e2cda3 100644 --- a/tests/run/implicitShortcut/Test_3.scala +++ b/tests/run/implicitShortcut/Test_3.scala @@ -1,4 +1,4 @@ -import implicitShortcut._ +import implicitShortcut.* object Test extends App { val d = new Derived diff --git a/tests/run/implied-for.scala b/tests/run/implied-for.scala index fea851847a0f..252bac528712 100644 --- a/tests/run/implied-for.scala +++ b/tests/run/implied-for.scala @@ -13,7 +13,7 @@ object A { } object Test extends App { - import A._ + import A.* import A.{t, given B, given D[_]} val x1: B = b diff --git a/tests/run/implied-priority.scala b/tests/run/implied-priority.scala index f66937007a3d..44cd7d56504c 100644 --- a/tests/run/implied-priority.scala +++ b/tests/run/implied-priority.scala @@ -112,7 +112,7 @@ object fallback4 { def test4 = { import Impl4.given - import fallback4._ + import fallback4.* assert(withFallback[String].str == "string") // t1 is applicable assert(withFallback[Int].str == "fallback") // No applicable instances, pick the default diff --git a/tests/run/inlineAddDeserializeLambda.scala b/tests/run/inlineAddDeserializeLambda.scala index 0b97b2583ef0..40961ff9779b 100644 --- a/tests/run/inlineAddDeserializeLambda.scala +++ b/tests/run/inlineAddDeserializeLambda.scala @@ -1,7 +1,7 @@ class C { inline final def f: Int => Int = (x: Int) => x + 1 } object Test extends App { - import java.io._ + import java.io.* def serialize(obj: AnyRef): Array[Byte] = { val buffer = new ByteArrayOutputStream diff --git a/tests/run/iterator-from.scala b/tests/run/iterator-from.scala index ca2910d13005..4e1649fff7e8 100644 --- a/tests/run/iterator-from.scala +++ b/tests/run/iterator-from.scala @@ -2,8 +2,8 @@ * filter: inliner warnings */ -import scala.util.{Random => R} -import scala.collection._ +import scala.util.{Random as R} +import scala.collection.* import scala.math.Ordered object Test extends App { diff --git a/tests/run/lambda-serialization-gc.scala b/tests/run/lambda-serialization-gc.scala index 4d156c421013..48e9f8315935 100644 --- a/tests/run/lambda-serialization-gc.scala +++ b/tests/run/lambda-serialization-gc.scala @@ -1,4 +1,4 @@ -import java.io._ +import java.io.* import java.net.URLClassLoader diff --git a/tests/run/lazy-impl.scala b/tests/run/lazy-impl.scala index 43333056973c..70d2c02da3c4 100644 --- a/tests/run/lazy-impl.scala +++ b/tests/run/lazy-impl.scala @@ -89,7 +89,7 @@ * * - lazy vals of primitive types are boxed */ -import sun.misc.Unsafe._ +import sun.misc.Unsafe.* class C { def init(name: String) = { diff --git a/tests/run/lst/Lst.scala b/tests/run/lst/Lst.scala index c986425d52d5..eecd471037d4 100644 --- a/tests/run/lst/Lst.scala +++ b/tests/run/lst/Lst.scala @@ -14,7 +14,7 @@ import compiletime.uninitialized * Otherwise: an Array[Any] containing the elements */ class Lst[+T](val elems: Any) extends AnyVal { self => - import Lst._ + import Lst.* inline def locally[T](body: => T): T = body diff --git a/tests/run/nats.scala b/tests/run/nats.scala index bb0b9c85b9a8..a43edb64e219 100644 --- a/tests/run/nats.scala +++ b/tests/run/nats.scala @@ -16,7 +16,7 @@ trait Plus[X <: Nat, Y <: Nat, R <: Nat] { } object Test { - import Nat._ + import Nat.* implicit def zPlus[Y <: Nat]: Plus[Z, Y, Y] = new { def add(x: Z, y: Y): Y = y } diff --git a/tests/run/no-init-enclosing-static-objects.scala b/tests/run/no-init-enclosing-static-objects.scala index 8c5dafd71507..2ea585e33394 100644 --- a/tests/run/no-init-enclosing-static-objects.scala +++ b/tests/run/no-init-enclosing-static-objects.scala @@ -33,7 +33,7 @@ object Test { } def testThroughImport(): Unit = { - import Enclosing1._ + import Enclosing1.* println(InnerObject.foo) println(new InnerClass(5).foo) } diff --git a/tests/run/nonlocal-return.scala b/tests/run/nonlocal-return.scala index f52d86429620..4a55dc266edf 100644 --- a/tests/run/nonlocal-return.scala +++ b/tests/run/nonlocal-return.scala @@ -1,4 +1,4 @@ -import scala.util.control.NonLocalReturns._ +import scala.util.control.NonLocalReturns.* object Test { def has(xs: List[Int], elem: Int) = diff --git a/tests/run/patmatch-classtag.scala b/tests/run/patmatch-classtag.scala index 99e1ee3f05ae..a501333481a7 100644 --- a/tests/run/patmatch-classtag.scala +++ b/tests/run/patmatch-classtag.scala @@ -28,7 +28,7 @@ object Impl extends API { object Test extends App { val api: API = Impl - import api._ + import api.* val x: Any = CaseDef("123") diff --git a/tests/run/planets.scala b/tests/run/planets.scala index 2c4f31b17ca3..d6ee4b5d00ef 100644 --- a/tests/run/planets.scala +++ b/tests/run/planets.scala @@ -14,7 +14,7 @@ enum Planet(mass: Double, radius: Double) { } object Test { def main(args: Array[String]) = { - import Planet._ + import Planet.* assert(valueOf("SATURN") == SATURN) val earthWeight = 100 val mass = earthWeight/EARTH.surfaceGravity diff --git a/tests/run/poly-kinded-derives.scala b/tests/run/poly-kinded-derives.scala index 61f19cc063b2..73ad7dc1957a 100644 --- a/tests/run/poly-kinded-derives.scala +++ b/tests/run/poly-kinded-derives.scala @@ -1,4 +1,4 @@ -import scala.deriving._ +import scala.deriving.* object Test extends App { { diff --git a/tests/run/priorityQueue.scala b/tests/run/priorityQueue.scala index 56f7ac3c8ee6..41b1c241c0f8 100644 --- a/tests/run/priorityQueue.scala +++ b/tests/run/priorityQueue.scala @@ -100,7 +100,7 @@ object Test { // } // def assertPriorityDestructive[A](pq: PriorityQueue[A])(implicit ord: Ordering[A]) { - // import ord._ + // import ord.* // var prev: A = null.asInstanceOf[A] // while (pq.nonEmpty) { // val curr = pq.dequeue diff --git a/tests/run/quoted-sematics-1.scala b/tests/run/quoted-sematics-1.scala index ed2d05224d73..852772ce9428 100644 --- a/tests/run/quoted-sematics-1.scala +++ b/tests/run/quoted-sematics-1.scala @@ -1,7 +1,7 @@ -import Term._ -import Pattern._ -import Type._ +import Term.* +import Pattern.* +import Type.* type Gamma = Set[EnvVar] type Delta = Set[EnvVar] diff --git a/tests/run/range.scala b/tests/run/range.scala index ed4aeacffc09..52f599e81964 100644 --- a/tests/run/range.scala +++ b/tests/run/range.scala @@ -30,7 +30,7 @@ object Test { } case class GR[T](val x: T)(implicit val num: Integral[T]) { - import num._ + import num.* def negated = GR[T](-x) diff --git a/tests/run/rescue.scala b/tests/run/rescue.scala index a2b2e33c2cde..a1e1f3200061 100644 --- a/tests/run/rescue.scala +++ b/tests/run/rescue.scala @@ -1,5 +1,5 @@ import scala.util.control.NonFatal -import scala.util.control.NonLocalReturns._ +import scala.util.control.NonLocalReturns.* object lib { extension [T](op: => T) inline def rescue (fallback: => T) = @@ -18,7 +18,7 @@ object lib { } } -import lib._ +import lib.* @main def Test = { assert((9 / 1 rescue 1) == 9) diff --git a/tests/run/returning.scala b/tests/run/returning.scala index 5879b9e58e5d..fd190de17ee1 100644 --- a/tests/run/returning.scala +++ b/tests/run/returning.scala @@ -27,7 +27,7 @@ object NonLocalReturns { object Test extends App { - import scala.util.control.NonLocalReturns._ + import scala.util.control.NonLocalReturns.* import scala.collection.mutable.ListBuffer def has(xs: List[Int], elem: Int) = diff --git a/tests/run/scala-tests-typeChecks.scala b/tests/run/scala-tests-typeChecks.scala index be71b3880028..3593477e8662 100644 --- a/tests/run/scala-tests-typeChecks.scala +++ b/tests/run/scala-tests-typeChecks.scala @@ -1,4 +1,4 @@ -import scala.compiletime.testing._ +import scala.compiletime.testing.* object Test { diff --git a/tests/run/serialization-new.scala b/tests/run/serialization-new.scala index 92f027591831..85706c27a04d 100644 --- a/tests/run/serialization-new.scala +++ b/tests/run/serialization-new.scala @@ -26,7 +26,7 @@ object Serialize { println() } } -import Serialize._ +import Serialize.* //############################################################################ // Test classes in package "scala" @@ -44,7 +44,7 @@ object Test1_scala { type WeekDay = Value val Monday, Tuesday, Wednesday, Thusday, Friday, Saturday, Sunday = Value } - import WeekDay._, BigDecimal._, RoundingMode._ + import WeekDay._, BigDecimal._, RoundingMode.* // in alphabetic order try { diff --git a/tests/run/serialize.scala b/tests/run/serialize.scala index 8e6ded17277c..0622807bee21 100644 --- a/tests/run/serialize.scala +++ b/tests/run/serialize.scala @@ -1,6 +1,6 @@ object Test { def serializeDeserialize[T <: AnyRef](obj: T): T = { - import java.io._ + import java.io.* val buffer = new ByteArrayOutputStream val out = new ObjectOutputStream(buffer) out.writeObject(obj) diff --git a/tests/run/singleton-ops-flags.scala b/tests/run/singleton-ops-flags.scala index 8e2cda6a38c7..08f26d1faea0 100644 --- a/tests/run/singleton-ops-flags.scala +++ b/tests/run/singleton-ops-flags.scala @@ -80,6 +80,6 @@ package example { } -import example.TastyFlags._ +import example.TastyFlags.* @main def Test = assert((Open | Given | Inline | Erased).debug == "Erased | Inline | Given | Open") diff --git a/tests/run/statics.scala b/tests/run/statics.scala index 85f467cabe8c..a7fb3a232f15 100644 --- a/tests/run/statics.scala +++ b/tests/run/statics.scala @@ -27,7 +27,7 @@ object Foo { } object Test { - import Foo._ + import Foo.* def main(args: Array[String]): Unit = { method + field + mutable + accessor } diff --git a/tests/run/string-context-implicits-with-conversion.scala b/tests/run/string-context-implicits-with-conversion.scala index 832c22af7241..adcbae38830c 100644 --- a/tests/run/string-context-implicits-with-conversion.scala +++ b/tests/run/string-context-implicits-with-conversion.scala @@ -14,7 +14,7 @@ object Lib { given Show[String] = x => s"Str($x)" } object Test { - import Lib._ + import Lib.* def main(args: Array[String]): Unit = { println(showMe"${1: Int} ${"abc": String}") println(showMe"${1} ${"abc"}") diff --git a/tests/run/sysprops.scala b/tests/run/sysprops.scala index bdad677221d3..79630d60886b 100644 --- a/tests/run/sysprops.scala +++ b/tests/run/sysprops.scala @@ -1,4 +1,4 @@ -import sys._ +import sys.* /** Basic sys.Prop test. */ object Test { diff --git a/tests/run/t1074.scala b/tests/run/t1074.scala index 21fc45df8bdd..1756c73dabab 100644 --- a/tests/run/t1074.scala +++ b/tests/run/t1074.scala @@ -1,4 +1,4 @@ -import scala.collection.immutable._ +import scala.collection.immutable.* object Test { def main(args : Array[String]) : Unit = { var words = "a" :: "b" :: "cd" :: "de" :: "fg" :: "ef" :: diff --git a/tests/run/t1829.scala b/tests/run/t1829.scala index b51055a5a29f..52ecdbc9df59 100644 --- a/tests/run/t1829.scala +++ b/tests/run/t1829.scala @@ -1,6 +1,6 @@ object Test{ def main(args : Array[String]): Unit = { - import scala.collection.immutable._ + import scala.collection.immutable.* assert(IntMap.empty == HashMap.empty); assert(HashMap.empty == IntMap.empty); assert(LongMap.empty == HashMap.empty); diff --git a/tests/run/t1987b/cce_test.scala b/tests/run/t1987b/cce_test.scala index e131df795617..ce3395b3a3de 100644 --- a/tests/run/t1987b/cce_test.scala +++ b/tests/run/t1987b/cce_test.scala @@ -4,7 +4,7 @@ package scales.xml object CCE_Test { def main(args: Array[String]): Unit = { // without the import it doesn't trigger the CCE - import scaley.funny._ + import scaley.funny.* val pull = null.asInstanceOf[Iterator[PullType]] val LogEntries = null.asInstanceOf[List[QName]] diff --git a/tests/run/t2526.scala b/tests/run/t2526.scala index f0e24f844833..2bb5775a1f5a 100644 --- a/tests/run/t2526.scala +++ b/tests/run/t2526.scala @@ -3,7 +3,7 @@ * still work correctly. */ object Test { - import collection._ + import collection.* def main(args: Array[String]): Unit = { val m = new mutable.HashMap[String, String] diff --git a/tests/run/t2594_tcpoly.scala b/tests/run/t2594_tcpoly.scala index 789833bc003f..3f1ec4c19127 100644 --- a/tests/run/t2594_tcpoly.scala +++ b/tests/run/t2594_tcpoly.scala @@ -1,5 +1,5 @@ -import scala.language.{ higherKinds } +import scala.language.higherKinds trait Monad[M[_]] { def foo[A](a: M[A]): M[A] diff --git a/tests/run/t2857.scala b/tests/run/t2857.scala index 37c342048333..7e432a5f193d 100644 --- a/tests/run/t2857.scala +++ b/tests/run/t2857.scala @@ -1,5 +1,5 @@ object Test extends App { - import collection.mutable._ + import collection.mutable.* val m = new HashMap[Int, Set[String]] with MultiMap[Int, String] m.addBinding(6, "Foo") m.removeBinding(6, "Foo") diff --git a/tests/run/t3088.scala b/tests/run/t3088.scala index ea820b1c9c78..baf8f42739bb 100644 --- a/tests/run/t3088.scala +++ b/tests/run/t3088.scala @@ -1,4 +1,4 @@ -import collection.mutable._ +import collection.mutable.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run/t3242b.scala b/tests/run/t3242b.scala index 22d22ac546bc..7f140e8158ee 100644 --- a/tests/run/t3242b.scala +++ b/tests/run/t3242b.scala @@ -1,4 +1,4 @@ -import scala.collection.immutable._ +import scala.collection.immutable.* object Test { diff --git a/tests/run/t3326.scala b/tests/run/t3326.scala index 0e419bebd4f4..3d7d83068f92 100644 --- a/tests/run/t3326.scala +++ b/tests/run/t3326.scala @@ -26,7 +26,7 @@ object Test { } def testCollectionSorted(): Unit = { - import collection._ + import collection.* val order = implicitly[Ordering[Int]].reverse var m1: SortedMap[Int, String] = SortedMap.empty[Int, String](order) var m2: SortedMap[Int, String] = SortedMap.empty[Int, String](order) @@ -47,7 +47,7 @@ object Test { } def testImmutableSorted(): Unit = { - import collection.immutable._ + import collection.immutable.* val order = implicitly[Ordering[Int]].reverse var m1: SortedMap[Int, String] = SortedMap.empty[Int, String](order) var m2: SortedMap[Int, String] = SortedMap.empty[Int, String](order) diff --git a/tests/run/t3493.scala b/tests/run/t3493.scala index c13da255121c..03091d7c28bc 100644 --- a/tests/run/t3493.scala +++ b/tests/run/t3493.scala @@ -5,7 +5,7 @@ object Test { def main(args: Array[String]): Unit = { - import scala.collection.immutable._ + import scala.collection.immutable.* val x = TreeSet("a", "b", "c", "d") val x2 = x + "e" assert(x2.toString == "TreeSet(a, b, c, d, e)") diff --git a/tests/run/t3508.scala b/tests/run/t3508.scala index 8278775d13ea..38bb9ddd397c 100644 --- a/tests/run/t3508.scala +++ b/tests/run/t3508.scala @@ -1,4 +1,4 @@ -import collection.immutable._ +import collection.immutable.* // ticket #3508 object Test { diff --git a/tests/run/t3603.scala b/tests/run/t3603.scala index ac5314b06448..a9c8fb5f56fd 100644 --- a/tests/run/t3603.scala +++ b/tests/run/t3603.scala @@ -1,6 +1,6 @@ object Test { def main(args: Array[String]): Unit = { - import collection.immutable._ + import collection.immutable.* val intmap = IntMap(1 -> 1, 2 -> 2) val intres = intmap.map { case (a, b) => (a, b.toString) } diff --git a/tests/run/t3719.scala b/tests/run/t3719.scala index 01dc2055452d..18a031b1fe2b 100644 --- a/tests/run/t3719.scala +++ b/tests/run/t3719.scala @@ -17,13 +17,13 @@ object Test extends App { Days.values.toList.sorted.map(x => x.toString) def nameOfMon(): String = { - import Days._ + import Days.* val d: Day = Mon d.toString } def nameOfTue(): String = { - import Days._ + import Days.* val d: Day = Tue d.toString } diff --git a/tests/run/t3984.scala b/tests/run/t3984.scala index fd4ffbc1adb0..b55280857bdd 100644 --- a/tests/run/t3984.scala +++ b/tests/run/t3984.scala @@ -1,6 +1,6 @@ object SetBug { - import scala.collection.immutable.{ Set => ImmutSet } - import scala.collection.mutable.{ Set => MutSet } + import scala.collection.immutable.Set as ImmutSet + import scala.collection.mutable.Set as MutSet case class IH (i: Int, h: Int) { override def hashCode: Int = h @@ -22,8 +22,8 @@ object SetBug { } object MapBug { - import scala.collection.immutable.{ Map => ImmutMap } - import scala.collection.mutable.{ Map => MutMap } + import scala.collection.immutable.Map as ImmutMap + import scala.collection.mutable.Map as MutMap case class IH (i: Int, h: Int) { override def hashCode: Int = h diff --git a/tests/run/t4027.scala b/tests/run/t4027.scala index 0cbd1cbbb838..0f6aa7ece53f 100644 --- a/tests/run/t4027.scala +++ b/tests/run/t4027.scala @@ -1,6 +1,6 @@ -import collection._ +import collection.* // Sorted maps have `filterKeys` and `mapValues` which return MapView. // Calling a transformation (map/filter) returns a View. diff --git a/tests/run/t4147.scala b/tests/run/t4147.scala index c638ab50a2b3..0be67554892e 100644 --- a/tests/run/t4147.scala +++ b/tests/run/t4147.scala @@ -1,7 +1,7 @@ -import scala.collection._ +import scala.collection.* diff --git a/tests/run/t4190.scala b/tests/run/t4190.scala index aa88b8708d7d..5f48638f3200 100644 --- a/tests/run/t4190.scala +++ b/tests/run/t4190.scala @@ -1,4 +1,4 @@ -import collection.mutable._ +import collection.mutable.* object Test extends App { val x: ArrayBuffer[String] = ArrayBuffer("a", "b", "c") diff --git a/tests/run/t4398.scala b/tests/run/t4398.scala index 5e152f727a9f..2b0a29ec5fe8 100644 --- a/tests/run/t4398.scala +++ b/tests/run/t4398.scala @@ -1,6 +1,6 @@ -import scala.language.{ postfixOps } +import scala.language.postfixOps object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run/t4535.scala b/tests/run/t4535.scala index f1cb7c4df7aa..bc8a5a3394c1 100644 --- a/tests/run/t4535.scala +++ b/tests/run/t4535.scala @@ -1,4 +1,4 @@ -import collection._ +import collection.* // #4535 object Test { diff --git a/tests/run/t4537/c.scala b/tests/run/t4537/c.scala index ee05d4bbfbc2..2af2b2b9471e 100644 --- a/tests/run/t4537/c.scala +++ b/tests/run/t4537/c.scala @@ -1,7 +1,7 @@ package b package c -import a._ +import a.* object Unambiguous { println(Settings.Y) diff --git a/tests/run/t4537/d.scala b/tests/run/t4537/d.scala index dd1d2045ed76..376153863c62 100644 --- a/tests/run/t4537/d.scala +++ b/tests/run/t4537/d.scala @@ -1,5 +1,5 @@ -import a._ -import b._ +import a.* +import b.* object Test extends App { println(Settings.Y) diff --git a/tests/run/t4809.scala b/tests/run/t4809.scala index f26d17c5b3df..e1d387c86a07 100644 --- a/tests/run/t4809.scala +++ b/tests/run/t4809.scala @@ -1,6 +1,6 @@ -import scala.util.control.Breaks._ +import scala.util.control.Breaks.* diff --git a/tests/run/t4813.scala b/tests/run/t4813.scala index e6e65ffa41d5..a6b2b1640806 100644 --- a/tests/run/t4813.scala +++ b/tests/run/t4813.scala @@ -1,5 +1,5 @@ -import collection.mutable._ -import reflect._ +import collection.mutable.* +import reflect.* object Test extends App { def runTest[T, U](col: T)(clone: T => U)(mod: T => Unit)(implicit ct: ClassTag[T]): Unit = { diff --git a/tests/run/t4930.scala b/tests/run/t4930.scala index 46705729a1d2..7df9b0acba6d 100644 --- a/tests/run/t4930.scala +++ b/tests/run/t4930.scala @@ -1,5 +1,5 @@ import collection.immutable.SortedMap -import scala.math.Ordering.Implicits._ +import scala.math.Ordering.Implicits.* object Test { implicit val ord: Ordering[Array[Byte]] = Ordering.by(x => x.toIterable: collection.Seq[Byte]) diff --git a/tests/run/t4954.scala b/tests/run/t4954.scala index 1b3c00a62601..3bf8a84069b4 100644 --- a/tests/run/t4954.scala +++ b/tests/run/t4954.scala @@ -1,4 +1,4 @@ -import collection._ +import collection.* object Test { diff --git a/tests/run/t5053.scala b/tests/run/t5053.scala index 6cd56788ad82..91a1fca1ac2c 100644 --- a/tests/run/t5053.scala +++ b/tests/run/t5053.scala @@ -1,4 +1,4 @@ -import scala.language.{ existentials } +import scala.language.existentials import collection.View object Test extends App { diff --git a/tests/run/t5588.scala b/tests/run/t5588.scala index 62bca8fd4913..090c147e4bb4 100644 --- a/tests/run/t5588.scala +++ b/tests/run/t5588.scala @@ -6,7 +6,7 @@ object Test { val Y = Value(Integer.MIN_VALUE) } - import MyEnum._ + import MyEnum.* def main(args: Array[String]): Unit = { println(Foo > Bar) println(X > Y) diff --git a/tests/run/t5590.scala b/tests/run/t5590.scala index aded59863e0e..a08cf4af7003 100644 --- a/tests/run/t5590.scala +++ b/tests/run/t5590.scala @@ -1,8 +1,8 @@ -import java.io._ -import collection._ +import java.io.* +import collection.* diff --git a/tests/run/t5604.scala b/tests/run/t5604.scala index eccad1639bde..0f048e942bbc 100644 --- a/tests/run/t5604.scala +++ b/tests/run/t5604.scala @@ -7,7 +7,7 @@ package foo { def buh(n: Double) = println("double") } class regular { - import regular._ + import regular.* duh(33L) duh(3.0d) diff --git a/tests/run/t5629.scala b/tests/run/t5629.scala index 867e92f344b4..c894a0ab269a 100644 --- a/tests/run/t5629.scala +++ b/tests/run/t5629.scala @@ -1,7 +1,7 @@ -import scala.{specialized => spec} +import scala.{specialized as spec} diff --git a/tests/run/t5974.scala b/tests/run/t5974.scala index 5b99e9f72155..1e12065d7cef 100644 --- a/tests/run/t5974.scala +++ b/tests/run/t5974.scala @@ -1,5 +1,5 @@ object Test extends App { - import scala.collection.JavaConverters._ + import scala.collection.JavaConverters.* def ser(a: AnyRef) = (new java.io.ObjectOutputStream(new java.io.ByteArrayOutputStream())).writeObject(a) diff --git a/tests/run/t5986.scala b/tests/run/t5986.scala index 4b56bfd69b33..acec0c5c7693 100644 --- a/tests/run/t5986.scala +++ b/tests/run/t5986.scala @@ -1,7 +1,7 @@ -import scala.collection._ +import scala.collection.* diff --git a/tests/run/t603.scala b/tests/run/t603.scala index 84a224a40a91..0c12e994f150 100644 --- a/tests/run/t603.scala +++ b/tests/run/t603.scala @@ -23,7 +23,7 @@ object forceDelay { } object Test { - import forceDelay._ + import forceDelay.* def main(args: Array[String]) = { val s: Susp[Int] = delay { Console.println("evaluating..."); 3 } diff --git a/tests/run/t6114.scala b/tests/run/t6114.scala index 8ad02d5bb2e5..22d4df6149b6 100644 --- a/tests/run/t6114.scala +++ b/tests/run/t6114.scala @@ -4,7 +4,7 @@ object Test extends App { list.add(1) list.add(2) list.add(3) - import scala.collection.JavaConverters._ + import scala.collection.JavaConverters.* val next = list.asScala ++ List(4,5,6) assert(next != list.asScala) @@ -18,7 +18,7 @@ object Test extends App { set.add(1) set.add(2) set.add(3) - import scala.collection.JavaConverters._ + import scala.collection.JavaConverters.* val next = set.asScala ++ Set(4,5,6) assert(next != set.asScala) @@ -32,7 +32,7 @@ object Test extends App { map.put(1,1) map.put(2,2) map.put(3,3) - import scala.collection.JavaConverters._ + import scala.collection.JavaConverters.* val next = map.asScala ++ Map(4->4,5->5,6->6) assert(next != map.asScala) @@ -47,7 +47,7 @@ object Test extends App { list.add(1) list.add(2) list.add(3) - import scala.collection.JavaConverters._ + import scala.collection.JavaConverters.* val next = list.asScala ++ List(4,5,6) assert(next != list.asScala) diff --git a/tests/run/t6406-regextract.scala b/tests/run/t6406-regextract.scala index 83679a516749..18cf28865aba 100644 --- a/tests/run/t6406-regextract.scala +++ b/tests/run/t6406-regextract.scala @@ -1,7 +1,7 @@ object Test extends App { - import util.matching._ - import Regex._ + import util.matching.* + import Regex.* val r = "(\\d+)".r val q = """(\d)""".r diff --git a/tests/run/t6488.scala b/tests/run/t6488.scala index 559164044242..4cdc2d2b34b5 100644 --- a/tests/run/t6488.scala +++ b/tests/run/t6488.scala @@ -1,10 +1,10 @@ -import scala.sys.process._ +import scala.sys.process.* import scala.util.Try import scala.util.Properties.{ javaHome, javaClassPath } import java.io.{ File, IOException } import java.util.concurrent.CountDownLatch -import java.util.concurrent.TimeUnit._ -import java.util.concurrent.atomic._ +import java.util.concurrent.TimeUnit.* +import java.util.concurrent.atomic.* object Test { /* diff --git a/tests/run/t7126.scala b/tests/run/t7126.scala index b785bcff69ee..aa14d32eff54 100644 --- a/tests/run/t7126.scala +++ b/tests/run/t7126.scala @@ -1,4 +1,4 @@ -import language._ +import language.* // Currently typer infers a Nothing as a CC[T] to be Nothing[T], and isn't // able to figure out that Nothing[Any] =:= Nothing. We've had a discussion diff --git a/tests/run/t7269.scala b/tests/run/t7269.scala index 5876e88eae7c..bfe66fa81ec5 100644 --- a/tests/run/t7269.scala +++ b/tests/run/t7269.scala @@ -1,4 +1,4 @@ -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.collection.mutable object Test extends App { diff --git a/tests/run/t8199.scala b/tests/run/t8199.scala index ffd847ef3787..e6168672d520 100644 --- a/tests/run/t8199.scala +++ b/tests/run/t8199.scala @@ -48,7 +48,7 @@ object Test extends App { } val c = new reallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongnamereallylongname - import c._ + import c.* check(obj0.getClass) check(obj01.getClass) diff --git a/tests/run/t8346.scala b/tests/run/t8346.scala index 5f3df841749d..0ac817dbc7ff 100644 --- a/tests/run/t8346.scala +++ b/tests/run/t8346.scala @@ -10,7 +10,7 @@ object Test extends App { (A.runtimeClass.getSimpleName, f) val inits: Seq[(String, Int => Set[Int])] = { - import collection.immutable.{Seq => _, _} + import collection.immutable.{Seq as _, *} Seq(sctor(BitSet(_)), sctor(HashSet(_)), sctor(ListSet(_)), diff --git a/tests/run/t8549b.scala b/tests/run/t8549b.scala index 06b196677514..8173db4ecb11 100644 --- a/tests/run/t8549b.scala +++ b/tests/run/t8549b.scala @@ -1,4 +1,4 @@ -import java.lang.reflect.Modifier._ +import java.lang.reflect.Modifier.* @SerialVersionUID(42) class C extends Serializable diff --git a/tests/run/tagless.scala b/tests/run/tagless.scala index c245308ea6e9..5333c4e30995 100644 --- a/tests/run/tagless.scala +++ b/tests/run/tagless.scala @@ -12,7 +12,7 @@ object Test extends App { } val fe: IExp = { - import IExp._ + import IExp.* Add(Lit(8), Neg(Add(Lit(1), Lit(2)))) } @@ -60,7 +60,7 @@ object Test extends App { object MultSyntax { def mul[T](l: T, r: T)(using e: Mult[T]): T = e.mul(l, r) } - import MultSyntax._ + import MultSyntax.* def tfm1[T: Exp : Mult] = add(lit(7), neg(mul(lit(1), lit(2)))) def tfm2[T: Exp : Mult] = mul(lit(7), tf1) @@ -81,7 +81,7 @@ object Test extends App { case Leaf(s: String) case Node(s: String, ts: Tree*) } - import Tree._ + import Tree.* given Exp[Tree] with Mult[Tree] with def lit(i: Int): Tree = Node("Lit", Leaf(i.toString)) @@ -110,7 +110,7 @@ object Test extends App { } } } - import CanThrow._ + import CanThrow.* type Maybe[T] = CanThrow ?=> T @@ -191,7 +191,7 @@ object Test extends App { enum NCtx { case Pos, Neg } given [T](using e: Exp[T]): Exp[NCtx => T] with - import NCtx._ + import NCtx.* def lit(i: Int) = { case Pos => e.lit(i) case Neg => e.neg(e.lit(i)) @@ -210,7 +210,7 @@ object Test extends App { println(pushNeg(pushNeg(pushNeg(tf1))): String) given [T](using e: Mult[T]): Mult[NCtx => T] with - import NCtx._ + import NCtx.* def mul(l: NCtx => T, r: NCtx => T): NCtx => T = { case Pos => e.mul(l(Pos), r(Pos)) case Neg => e.mul(l(Pos), r(Neg)) @@ -219,7 +219,7 @@ object Test extends App { println(pushNeg(tfm1[NCtx => String])) println(pushNeg(tfm2[NCtx => String])) - import IExp._ + import IExp.* // Going from type class encoding to ADT encoding given initialize: Exp[IExp] with diff --git a/tests/run/targetName.scala b/tests/run/targetName.scala index 7774922c7b12..47828b340418 100644 --- a/tests/run/targetName.scala +++ b/tests/run/targetName.scala @@ -4,7 +4,7 @@ object A: def f(x: => String): Int = x.length @targetName("f2") def f(x: => Int): Int = x -import A._ +import A.* trait T: def f(x: => String): Int diff --git a/tests/run/tcpoly_overriding.scala b/tests/run/tcpoly_overriding.scala index 32174ad8bfbe..2dca477ce4de 100644 --- a/tests/run/tcpoly_overriding.scala +++ b/tests/run/tcpoly_overriding.scala @@ -1,5 +1,5 @@ -import scala.language.{ higherKinds } +import scala.language.higherKinds abstract class A[t[x]] { def b: t[Int] diff --git a/tests/run/test-implicits.scala b/tests/run/test-implicits.scala index fbc8536c041b..580cf27f9b85 100644 --- a/tests/run/test-implicits.scala +++ b/tests/run/test-implicits.scala @@ -18,7 +18,7 @@ class C(x: String) { } object Test extends App { - import A.B._ + import A.B.* val c = new C("OK") val i = new c.Inner val s: String = i @@ -40,7 +40,7 @@ object TestPriority { implicit def Int2D(x: Int): D = new D(x) } - import impl._ + import impl.* val x: C = 2 val y: D = 2 diff --git a/tests/run/toplevel-implicits/Test_2.scala b/tests/run/toplevel-implicits/Test_2.scala index 65eb72288651..0dd5e00e32f1 100644 --- a/tests/run/toplevel-implicits/Test_2.scala +++ b/tests/run/toplevel-implicits/Test_2.scala @@ -1,5 +1,5 @@ object Test extends App { - import implicits._ + import implicits.* val c = new C val c2 = c.pair(c) diff --git a/tests/run/traitParams.scala b/tests/run/traitParams.scala index 82c176461c24..845ca6aa5062 100644 --- a/tests/run/traitParams.scala +++ b/tests/run/traitParams.scala @@ -16,7 +16,7 @@ trait U2(a: Any) extends T { a // used to crash } -import State._ +import State.* class C(x: Int) extends U with T(x, x * x + s) class C2(x: Int) extends T(x, x * x + s) with U diff --git a/tests/run/traits-initialization.scala b/tests/run/traits-initialization.scala index fdddc8f44468..41698729edea 100644 --- a/tests/run/traits-initialization.scala +++ b/tests/run/traits-initialization.scala @@ -2,7 +2,7 @@ object store { var str = "" } -import store._ +import store.* trait A { str += "a" diff --git a/tests/run/transparent-implicits.scala b/tests/run/transparent-implicits.scala index 6d46a61d28e4..ffb33f90c928 100644 --- a/tests/run/transparent-implicits.scala +++ b/tests/run/transparent-implicits.scala @@ -6,7 +6,7 @@ object impl { } object inlines { - import impl._ + import impl.* class C { implicit val x: X = new X() diff --git a/tests/run/transparent/Test_2.scala b/tests/run/transparent/Test_2.scala index 722e302c4b26..5852b7a261dc 100644 --- a/tests/run/transparent/Test_2.scala +++ b/tests/run/transparent/Test_2.scala @@ -1,6 +1,6 @@ object Test { - import p.transparents._ + import p.transparents.* def main(args: Array[String]): Unit = { println(f(10)) diff --git a/tests/run/transparentArrowAssoc.scala b/tests/run/transparentArrowAssoc.scala index 0a3b5c6d7e37..29b228eeef46 100644 --- a/tests/run/transparentArrowAssoc.scala +++ b/tests/run/transparentArrowAssoc.scala @@ -1,4 +1,4 @@ -import scala.collection.immutable._ +import scala.collection.immutable.* import scala.collection.mutable.{ Builder, ListBuffer } diff --git a/tests/run/transparentProtected.scala b/tests/run/transparentProtected.scala index 1a725ec27346..5aa9b2c46138 100644 --- a/tests/run/transparentProtected.scala +++ b/tests/run/transparentProtected.scala @@ -13,7 +13,7 @@ package Q { } object Test extends App { - import Q._ + import Q.* val d = new D val i = new d.Inner diff --git a/tests/run/triemap-hash.scala b/tests/run/triemap-hash.scala index 902b80a014d1..d8532ad97e23 100644 --- a/tests/run/triemap-hash.scala +++ b/tests/run/triemap-hash.scala @@ -13,7 +13,7 @@ object Test { } def hashing(): Unit = { - import collection._ + import collection.* val tm = new concurrent.TrieMap[String, String](Hashing.fromFunction(x => x.length + x(0).toInt), Equiv.universal) tm.put("a", "b") @@ -27,7 +27,7 @@ object Test { } def equality(): Unit = { - import collection._ + import collection.* val tm = new concurrent.TrieMap[String, String](Hashing.fromFunction(x => x(0).toInt), Equiv.fromFunction(_(0) == _(0))) tm.put("a", "b") diff --git a/tests/run/triple-quoted-expr.scala b/tests/run/triple-quoted-expr.scala index 6d91ac5888f0..7c923d7661f5 100644 --- a/tests/run/triple-quoted-expr.scala +++ b/tests/run/triple-quoted-expr.scala @@ -20,7 +20,7 @@ hi""" object Test { def main(args: Array[String]): Unit = { val x = new A - import x._ + import x.* List(f1, f2, f3) foreach println } } diff --git a/tests/run/try-catch-unify.scala b/tests/run/try-catch-unify.scala index 151e549e5fdf..bdbd485e2c78 100644 --- a/tests/run/try-catch-unify.scala +++ b/tests/run/try-catch-unify.scala @@ -1,6 +1,6 @@ -import util._ +import util.* -import control.Exception._ +import control.Exception.* object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run/tuples.scala b/tests/run/tuples.scala index beeb98092ec9..06db598b65da 100644 --- a/tests/run/tuples.scala +++ b/tests/run/tuples.scala @@ -1,4 +1,4 @@ -import Function._ +import Function.* object Test extends App { var xyz: (Int, String, Boolean) = compiletime.uninitialized diff --git a/tests/run/tuples1a.scala b/tests/run/tuples1a.scala index d1764caebf74..0911ef6871db 100644 --- a/tests/run/tuples1a.scala +++ b/tests/run/tuples1a.scala @@ -6,4 +6,5 @@ object Test extends App { val t7c: Unit = (t7.tail: (Int, String)).tail val t7d: Unit = (t7.tail: Int *: String *: EmptyTuple).tail val t7e: Unit = t7.tail.tail + val t7f: Unit = t7.drop(1).drop(1) } diff --git a/tests/run/typable.scala b/tests/run/typable.scala index 7fe253023740..5e7182dcd338 100644 --- a/tests/run/typable.scala +++ b/tests/run/typable.scala @@ -1,4 +1,4 @@ -import scala.reflect._ +import scala.reflect.* object Test: def main(args: Array[String]): Unit = diff --git a/tests/run/type-test-nat.scala b/tests/run/type-test-nat.scala index a7f21ec33fce..cb9b729fb61b 100644 --- a/tests/run/type-test-nat.scala +++ b/tests/run/type-test-nat.scala @@ -7,7 +7,7 @@ object Test { } def app(peano: Peano): Unit = { - import peano._ + import peano.* def divOpt(m: Nat, n: Nat): Option[(Nat, Nat)] = { n match { case Zero => None diff --git a/tests/run/typeCheckErrors.check b/tests/run/typeCheckErrors.check new file mode 100644 index 000000000000..c74d3695926d --- /dev/null +++ b/tests/run/typeCheckErrors.check @@ -0,0 +1 @@ +List(Error(value check is not a member of Unit,compileError("1" * 2).check(""),22,Typer), Error(argument to compileError must be a statically known String but was: augmentString("1").*(2),compileError("1" * 2).check(""),13,Typer)) diff --git a/tests/run/typeCheckErrors.scala b/tests/run/typeCheckErrors.scala new file mode 100644 index 000000000000..9fd357e5b3d2 --- /dev/null +++ b/tests/run/typeCheckErrors.scala @@ -0,0 +1,8 @@ +import scala.compiletime.testing._ + +transparent inline def compileError(inline expr: String): Unit = + println(typeCheckErrors(expr)) + +@main def Test = compileError( + """compileError("1" * 2).check("")""" +) diff --git a/tests/run/typeclass-derivation-doc-example.scala b/tests/run/typeclass-derivation-doc-example.scala index c85319b1ba88..bc00311478bd 100644 --- a/tests/run/typeclass-derivation-doc-example.scala +++ b/tests/run/typeclass-derivation-doc-example.scala @@ -1,4 +1,4 @@ -import scala.deriving._ +import scala.deriving.* import scala.compiletime.{erasedValue, summonInline} inline def summonAll[T <: Tuple]: List[Eq[_]] = inline erasedValue[T] match { @@ -51,7 +51,7 @@ enum Opt[+T] derives Eq { } object Test extends App { - import Opt._ + import Opt.* val eqoi = summon[Eq[Opt[Int]]] assert(eqoi.eqv(Sm(23), Sm(23))) assert(!eqoi.eqv(Sm(23), Sm(13))) diff --git a/tests/run/typeclass-derivation1.scala b/tests/run/typeclass-derivation1.scala index a6f8096c8ecb..f6c83c770af2 100644 --- a/tests/run/typeclass-derivation1.scala +++ b/tests/run/typeclass-derivation1.scala @@ -1,5 +1,5 @@ object Deriving { - import scala.compiletime._ + import scala.compiletime.* sealed trait Shape @@ -79,7 +79,7 @@ object Deriving { } object Test extends App { - import Deriving._ + import Deriving.* val eq = implicitly[Eq[Lst[Int]]] val xs = Lst.Cons(1, Lst.Cons(2, Lst.Cons(3, Lst.Nil))) val ys = Lst.Cons(1, Lst.Cons(2, Lst.Nil)) diff --git a/tests/run/typeclass-derivation2a.scala b/tests/run/typeclass-derivation2a.scala index 68d7cf4f13d0..b8c004b24cc0 100644 --- a/tests/run/typeclass-derivation2a.scala +++ b/tests/run/typeclass-derivation2a.scala @@ -7,7 +7,7 @@ object TypeLevel { /** @param caseLabels The case and element labels of the described ADT as encoded strings. */ class GenericClass(labelsStr: String) { - import GenericClass._ + import GenericClass.* /** A mirror of case with ordinal number `ordinal` and elements as given by `Product` */ def mirror(ordinal: Int, product: Product): Mirror = @@ -121,7 +121,7 @@ enum Lst[+T] { // derives Eq, Pickler, Show object Lst { // common compiler-generated infrastructure - import TypeLevel._ + import TypeLevel.* val genericClass = new GenericClass("Cons\u0000hd\u0000tl\u0001Nil") import genericClass.mirror @@ -156,7 +156,7 @@ case class Pair[T](x: T, y: T) // derives Eq, Pickler, Show object Pair { // common compiler-generated infrastructure - import TypeLevel._ + import TypeLevel.* val genericClass = new GenericClass("Pair\u0000x\u0000y") import genericClass.mirror @@ -184,7 +184,7 @@ case class Left[L](x: L) extends Either[L, Nothing] case class Right[R](x: R) extends Either[Nothing, R] object Either { - import TypeLevel._ + import TypeLevel.* val genericClass = new GenericClass("Left\u0000x\u0001Right\u0000x") import genericClass.mirror @@ -220,7 +220,7 @@ trait Eq[T] { object Eq { import scala.compiletime.{erasedValue, summonInline} - import TypeLevel._ + import TypeLevel.* inline def tryEql[T](x: T, y: T) = summonInline[Eq[T]].eql(x, y) @@ -269,7 +269,7 @@ trait Pickler[T] { object Pickler { import scala.compiletime.{erasedValue, constValue, summonInline} - import TypeLevel._ + import TypeLevel.* def nextInt(buf: mutable.ListBuffer[Int]): Int = try buf.head finally buf.trimStart(1) @@ -352,7 +352,7 @@ trait Show[T] { } object Show { import scala.compiletime.{erasedValue, summonInline} - import TypeLevel._ + import TypeLevel.* inline def tryShow[T](x: T): String = summonInline[Show[T]].show(x) @@ -395,7 +395,7 @@ object Show { // Tests object Test extends App { - import TypeLevel._ + import TypeLevel.* val eq = implicitly[Eq[Lst[Int]]] val xs = Lst.Cons(11, Lst.Cons(22, Lst.Cons(33, Lst.Nil))) val ys = Lst.Cons(11, Lst.Cons(22, Lst.Nil)) diff --git a/tests/run/typeclass-derivation2b.scala b/tests/run/typeclass-derivation2b.scala index 704e8cb2cc9b..cbf094d4426e 100644 --- a/tests/run/typeclass-derivation2b.scala +++ b/tests/run/typeclass-derivation2b.scala @@ -41,7 +41,7 @@ sealed trait Lst[+T] // derives Eq, Pickler, Show object Lst { // common compiler-generated infrastructure - import TypeLevel._ + import TypeLevel.* class GenericLst[T] extends GenericSum[Lst[T]] { override type Shape = (Cons[T], Nil.type) @@ -92,7 +92,7 @@ trait Eq[T] { object Eq { import scala.compiletime.{erasedValue, summonInline} - import TypeLevel._ + import TypeLevel.* inline def tryEql[T](x: T, y: T) = summonInline[Eq[T]].eql(x, y) @@ -141,7 +141,7 @@ object Eq { } object Test extends App { - import TypeLevel._ + import TypeLevel.* val eq = implicitly[Eq[Lst[Int]]] val xs = Lst.Cons(11, Lst.Cons(22, Lst.Cons(33, Lst.Nil))) val ys = Lst.Cons(11, Lst.Cons(22, Lst.Nil)) @@ -165,7 +165,7 @@ case class Pair[T](x: T, y: T) // derives Eq, Pickler, Show object Pair { // common compiler-generated infrastructure - import TypeLevel._ + import TypeLevel.* val genericClass = new GenericClass("Pair\000x\000y") import genericClass.mirror @@ -193,7 +193,7 @@ case class Left[L](x: L) extends Either[L, Nothing] case class Right[R](x: R) extends Either[Nothing, R] object Either { - import TypeLevel._ + import TypeLevel.* val genericClass = new GenericClass("Left\000x\001Right\000x") import genericClass.mirror @@ -229,7 +229,7 @@ trait Eq[T] { object Eq { import scala.compiletime.erasedValue - import TypeLevel._ + import TypeLevel.* inline def tryEql[T](x: T, y: T) = summonFrom { case eq: Eq[T] => eq.eql(x, y) @@ -280,7 +280,7 @@ trait Pickler[T] { object Pickler { import scala.compiletime.{erasedValue, constValue} - import TypeLevel._ + import TypeLevel.* def nextInt(buf: mutable.ListBuffer[Int]): Int = try buf.head finally buf.trimStart(1) @@ -367,7 +367,7 @@ trait Show[T] { } object Show { import scala.compiletime.erasedValue - import TypeLevel._ + import TypeLevel.* inline def tryShow[T](x: T): String = summonFrom { case s: Show[T] => s.show(x) @@ -412,7 +412,7 @@ object Show { // Tests object Test extends App { - import TypeLevel._ + import TypeLevel.* val eq = implicitly[Eq[Lst[Int]]] val xs = Lst.Cons(11, Lst.Cons(22, Lst.Cons(33, Lst.Nil))) val ys = Lst.Cons(11, Lst.Cons(22, Lst.Nil)) diff --git a/tests/run/typeclass-derivation2d.scala b/tests/run/typeclass-derivation2d.scala index 2705da90f6d1..635f531114bc 100644 --- a/tests/run/typeclass-derivation2d.scala +++ b/tests/run/typeclass-derivation2d.scala @@ -69,7 +69,7 @@ object Deriving { def productElement[T](x: Any, idx: Int) = x.asInstanceOf[Product].productElement(idx).asInstanceOf[T] } -import Deriving._ +import Deriving.* sealed trait Lst[+T] // derives Eq, Pickler, Show diff --git a/tests/run/typeclass-derivation3.scala b/tests/run/typeclass-derivation3.scala index 675faab8da5d..f6c11c136a14 100644 --- a/tests/run/typeclass-derivation3.scala +++ b/tests/run/typeclass-derivation3.scala @@ -2,7 +2,7 @@ import scala.collection.mutable import scala.annotation.tailrec object datatypes { - import typeclasses._ + import typeclasses.* // An algebraic datatype enum Lst[+T] derives Eq, Pickler, Show { @@ -32,8 +32,8 @@ object typeclasses { object Eq { import scala.compiletime.{erasedValue, summonFrom} - import compiletime._ - import scala.deriving._ + import compiletime.* + import scala.deriving.* inline def tryEql[TT](x: TT, y: TT): Boolean = summonFrom { case eq: Eq[TT] => eq.eql(x, y) @@ -48,7 +48,7 @@ object typeclasses { true } - inline def eqlCases[Alts](n: Int)(x: Any, y: Any, ord: Int): Boolean = + transparent inline def eqlCases[Alts](n: Int)(x: Any, y: Any, ord: Int): Boolean = inline erasedValue[Alts] match { case _: (alt *: alts1) => if (ord == n) @@ -61,7 +61,7 @@ object typeclasses { false } - inline def derived[T](implicit ev: Mirror.Of[T]): Eq[T] = new Eq[T] { + transparent inline def derived[T](implicit ev: Mirror.Of[T]): Eq[T] = new Eq[T] { def eql(x: T, y: T): Boolean = inline ev match { case m: Mirror.SumOf[T] => @@ -85,8 +85,8 @@ object typeclasses { object Pickler { import scala.compiletime.{erasedValue, constValue, summonFrom} - import compiletime._ - import deriving._ + import compiletime.* + import deriving.* def nextInt(buf: mutable.ListBuffer[Int]): Int = try buf.head finally buf.trimStart(1) @@ -102,7 +102,7 @@ object typeclasses { case _: EmptyTuple => } - inline def pickleCases[Alts <: Tuple](n: Int)(buf: mutable.ListBuffer[Int], x: Any, ord: Int): Unit = + transparent inline def pickleCases[Alts <: Tuple](n: Int)(buf: mutable.ListBuffer[Int], x: Any, ord: Int): Unit = inline erasedValue[Alts] match { case _: (alt *: alts1) => if (ord == n) @@ -125,7 +125,7 @@ object typeclasses { case _: EmptyTuple => } - inline def unpickleCase[T, Elems <: Tuple](buf: mutable.ListBuffer[Int], m: Mirror.ProductOf[T]): T = { + transparent inline def unpickleCase[T, Elems <: Tuple](buf: mutable.ListBuffer[Int], m: Mirror.ProductOf[T]): T = { inline val size = constValue[Tuple.Size[Elems]] inline if (size == 0) m.fromProduct(EmptyTuple) @@ -140,7 +140,7 @@ object typeclasses { } } - inline def unpickleCases[T, Alts <: Tuple](n: Int)(buf: mutable.ListBuffer[Int], ord: Int): T = + transparent inline def unpickleCases[T, Alts <: Tuple](n: Int)(buf: mutable.ListBuffer[Int], ord: Int): T = inline erasedValue[Alts] match { case _: (alt *: alts1) => if (ord == n) @@ -153,7 +153,7 @@ object typeclasses { throw new IndexOutOfBoundsException(s"unexpected ordinal number: $ord") } - inline def derived[T](implicit ev: Mirror.Of[T]): Pickler[T] = new { + transparent inline def derived[T](implicit ev: Mirror.Of[T]): Pickler[T] = new { def pickle(buf: mutable.ListBuffer[Int], x: T): Unit = inline ev match { case m: Mirror.SumOf[T] => @@ -185,8 +185,8 @@ object typeclasses { } object Show { import scala.compiletime.{erasedValue, summonInline} - import compiletime._ - import deriving._ + import compiletime.* + import deriving.* inline def tryShow[T](x: T): String = summonInline[Show[T]].show(x) @@ -203,7 +203,7 @@ object typeclasses { Nil } - inline def showCase[T](x: Any, m: Mirror.ProductOf[T]): String = { + transparent inline def showCase[T](x: Any, m: Mirror.ProductOf[T]): String = { val label = constValue[m.MirroredLabel] inline m match { case m: Mirror.Singleton => label @@ -211,7 +211,7 @@ object typeclasses { } } - inline def showCases[Alts <: Tuple](n: Int)(x: Any, ord: Int): String = + transparent inline def showCases[Alts <: Tuple](n: Int)(x: Any, ord: Int): String = inline erasedValue[Alts] match { case _: (alt *: alts1) => if (ord == n) showCase(x, summonInline[Mirror.ProductOf[`alt`]]) @@ -220,7 +220,7 @@ object typeclasses { throw new MatchError(x) } - inline def derived[T](implicit ev: Mirror.Of[T]): Show[T] = new { + transparent inline def derived[T](implicit ev: Mirror.Of[T]): Show[T] = new { def show(x: T): String = inline ev match { case m: Mirror.SumOf[T] => @@ -236,8 +236,8 @@ object typeclasses { } } } -import datatypes._ -import typeclasses._ +import datatypes.* +import typeclasses.* // Tests object Test extends App { diff --git a/tests/run/typelevel-numeric.scala b/tests/run/typelevel-numeric.scala index 990b4b4a4b86..4b61bae9b772 100644 --- a/tests/run/typelevel-numeric.scala +++ b/tests/run/typelevel-numeric.scala @@ -8,7 +8,7 @@ abstract class MathLib[N : Numeric] { object MathLib { inline def apply[N](implicit n: Numeric[N]) = new MathLib[N] { - import n._ + import n.* def dotProduct(xs: Array[N], ys: Array[N]): N = { require(xs.length == ys.length) var i = 0 diff --git a/tests/run/typelevel-peano.scala b/tests/run/typelevel-peano.scala index 802f614fcfb7..069686f6d95c 100644 --- a/tests/run/typelevel-peano.scala +++ b/tests/run/typelevel-peano.scala @@ -1,5 +1,5 @@ -import compiletime._ +import compiletime.* object Test extends App { diff --git a/tests/run/varargs-extend-java-2/Test.scala b/tests/run/varargs-extend-java-2/Test.scala index d704fc9881b9..94fd48477c39 100644 --- a/tests/run/varargs-extend-java-2/Test.scala +++ b/tests/run/varargs-extend-java-2/Test.scala @@ -1,4 +1,4 @@ -import base._ +import base.* object Test extends App { class Concrete extends AbstractBase { diff --git a/tests/run/viewtest.scala b/tests/run/viewtest.scala index d3d0ae8daf89..887ad8c59e11 100755 --- a/tests/run/viewtest.scala +++ b/tests/run/viewtest.scala @@ -1,5 +1,5 @@ object Test extends App { - import collection._ + import collection.* val xs: View[(String, Int)] = List("x").view.zip(LazyList.from(0)) println(xs) diff --git a/tests/run/virtpatmat_stringinterp.scala b/tests/run/virtpatmat_stringinterp.scala index c6c951e6e5f0..203468702a11 100644 --- a/tests/run/virtpatmat_stringinterp.scala +++ b/tests/run/virtpatmat_stringinterp.scala @@ -1,5 +1,5 @@ -import scala.language.{ implicitConversions } +import scala.language.implicitConversions object Test extends App { case class Node(x: Int) diff --git a/tests/run/whitebox-inline.scala b/tests/run/whitebox-inline.scala new file mode 100644 index 000000000000..09e7911caaa1 --- /dev/null +++ b/tests/run/whitebox-inline.scala @@ -0,0 +1,16 @@ +import scala.quoted._ + +object Test { + def main(args: Array[String]): Unit = { + val a: Int = blackbox + val b: 1 = whitebox + + assert(a == 1) + assert(b == 1) + } + + inline def blackbox: Int = 1 + + transparent inline def whitebox: Int = 1 + +} diff --git a/tests/semanticdb/expect/Annotations.expect.scala b/tests/semanticdb/expect/Annotations.expect.scala index 88fd55279508..fb89c0e94abc 100644 --- a/tests/semanticdb/expect/Annotations.expect.scala +++ b/tests/semanticdb/expect/Annotations.expect.scala @@ -1,7 +1,7 @@ package annot -import com.javacp.annot._ -import scala.annotation.meta._ +import com.javacp.annot.* +import scala.annotation.meta.* import scala.language/*->scala::language.*/.experimental/*->scala::language.experimental.*/.macros/*->scala::language.experimental.macros.*/ @ClassAnnotation/*->com::javacp::annot::ClassAnnotation#*/ diff --git a/tests/semanticdb/expect/Annotations.scala b/tests/semanticdb/expect/Annotations.scala index c897aa819a58..176ced6487e8 100644 --- a/tests/semanticdb/expect/Annotations.scala +++ b/tests/semanticdb/expect/Annotations.scala @@ -1,7 +1,7 @@ package annot -import com.javacp.annot._ -import scala.annotation.meta._ +import com.javacp.annot.* +import scala.annotation.meta.* import scala.language.experimental.macros @ClassAnnotation diff --git a/tests/semanticdb/expect/Enums.expect.scala b/tests/semanticdb/expect/Enums.expect.scala index d74e49ccf98d..cc3630382ba7 100644 --- a/tests/semanticdb/expect/Enums.expect.scala +++ b/tests/semanticdb/expect/Enums.expect.scala @@ -1,5 +1,5 @@ object Enums/*<-_empty_::Enums.*/: - import <:_empty_::Enums.`<:<`.*/._ + import <:_empty_::Enums.`<:<`.*/.* enum Colour/*<-_empty_::Enums.Colour#*/: import Colour/*->_empty_::Enums.Colour.*/.Red/*->_empty_::Enums.Colour.Red.*/ diff --git a/tests/semanticdb/expect/Enums.scala b/tests/semanticdb/expect/Enums.scala index 3d666fb618a9..be7e2d6ce5cb 100644 --- a/tests/semanticdb/expect/Enums.scala +++ b/tests/semanticdb/expect/Enums.scala @@ -1,5 +1,5 @@ object Enums: - import <:<._ + import <:<.* enum Colour: import Colour.Red diff --git a/tests/semanticdb/expect/ImplicitConversion.expect.scala b/tests/semanticdb/expect/ImplicitConversion.expect.scala index d9e6612680bb..e5309ca26467 100644 --- a/tests/semanticdb/expect/ImplicitConversion.expect.scala +++ b/tests/semanticdb/expect/ImplicitConversion.expect.scala @@ -3,7 +3,7 @@ package example import scala.language/*->scala::language.*/.implicitConversions/*->scala::language.implicitConversions.*/ class ImplicitConversion/*<-example::ImplicitConversion#*/ { - import ImplicitConversion/*->example::ImplicitConversion.*/._ + import ImplicitConversion/*->example::ImplicitConversion.*/.* implicit def string2Number/*<-example::ImplicitConversion#string2Number().*/( string/*<-example::ImplicitConversion#string2Number().(string)*/: String/*->scala::Predef.String#*/ ): Int/*->scala::Int#*/ = 42 diff --git a/tests/semanticdb/expect/ImplicitConversion.scala b/tests/semanticdb/expect/ImplicitConversion.scala index fea8daa18bcd..c6219d0ee440 100644 --- a/tests/semanticdb/expect/ImplicitConversion.scala +++ b/tests/semanticdb/expect/ImplicitConversion.scala @@ -3,7 +3,7 @@ package example import scala.language.implicitConversions class ImplicitConversion { - import ImplicitConversion._ + import ImplicitConversion.* implicit def string2Number( string: String ): Int = 42 diff --git a/tests/semanticdb/expect/InstrumentTyper.expect.scala b/tests/semanticdb/expect/InstrumentTyper.expect.scala index cad500b7c234..fdce47af0a20 100644 --- a/tests/semanticdb/expect/InstrumentTyper.expect.scala +++ b/tests/semanticdb/expect/InstrumentTyper.expect.scala @@ -3,7 +3,7 @@ package example import scala.annotation.meta.param/*->scala::annotation::meta::param#*/ import scala.language/*->scala::language.*/.existentials/*->scala::language.existentials.*/ import scala.language/*->scala::language.*/.higherKinds/*->scala::language.higherKinds.*/ -import types.Test/*->types::Test.*/._ +import types.Test/*->types::Test.*/.* class InstrumentTyper/*<-example::InstrumentTyper#*/ { self/*<-local0*/: AnyRef/*->scala::AnyRef#*/ => def all/*<-example::InstrumentTyper#all().*/ = List/*->scala::package.List.*//*->scala::collection::IterableFactory#apply().*/( diff --git a/tests/semanticdb/expect/InstrumentTyper.scala b/tests/semanticdb/expect/InstrumentTyper.scala index 2c2ede6f85da..eb63e6553800 100644 --- a/tests/semanticdb/expect/InstrumentTyper.scala +++ b/tests/semanticdb/expect/InstrumentTyper.scala @@ -3,7 +3,7 @@ package example import scala.annotation.meta.param import scala.language.existentials import scala.language.higherKinds -import types.Test._ +import types.Test.* class InstrumentTyper { self: AnyRef => def all = List( diff --git a/tests/semanticdb/expect/Prefixes.expect.scala b/tests/semanticdb/expect/Prefixes.expect.scala index 0873e23555a7..185e2d3530d8 100644 --- a/tests/semanticdb/expect/Prefixes.expect.scala +++ b/tests/semanticdb/expect/Prefixes.expect.scala @@ -23,11 +23,11 @@ object Test/*<-prefixes::Test.*/ { val c/*<-prefixes::Test.c.*/: C/*->prefixes::C#*/ = ???/*->scala::Predef.`???`().*/ def m2/*<-prefixes::Test.m2().*/: c/*->prefixes::Test.c.*/.T/*->prefixes::C#T#*/ = ???/*->scala::Predef.`???`().*/ def k2/*<-prefixes::Test.k2().*/: c/*->prefixes::Test.c.*/.N/*->prefixes::C#N.*/.U/*->prefixes::C#N.U#*/ = ???/*->scala::Predef.`???`().*/ - import c/*->prefixes::Test.c.*/.N/*->prefixes::C#N.*/._ + import c/*->prefixes::Test.c.*/.N/*->prefixes::C#N.*/.* def k3/*<-prefixes::Test.k3().*/: U = ???/*->scala::Predef.`???`().*/ def n2/*<-prefixes::Test.n2().*/: M/*->prefixes::M.*/.T/*->prefixes::M.T#*/ = ???/*->scala::Predef.`???`().*/ - import M/*->prefixes::M.*/._ + import M/*->prefixes::M.*/.* def n3/*<-prefixes::Test.n3().*/: T/*->prefixes::M.T#*/ = ???/*->scala::Predef.`???`().*/ } diff --git a/tests/semanticdb/expect/Prefixes.scala b/tests/semanticdb/expect/Prefixes.scala index 11891cb325ec..4148068d8f44 100644 --- a/tests/semanticdb/expect/Prefixes.scala +++ b/tests/semanticdb/expect/Prefixes.scala @@ -23,11 +23,11 @@ object Test { val c: C = ??? def m2: c.T = ??? def k2: c.N.U = ??? - import c.N._ + import c.N.* def k3: U = ??? def n2: M.T = ??? - import M._ + import M.* def n3: T = ??? } diff --git a/tests/semanticdb/expect/recursion.expect.scala b/tests/semanticdb/expect/recursion.expect.scala index a576eca7a443..aba74b1b032e 100644 --- a/tests/semanticdb/expect/recursion.expect.scala +++ b/tests/semanticdb/expect/recursion.expect.scala @@ -3,7 +3,7 @@ package recursion object Nats/*<-recursion::Nats.*/ { sealed trait Nat/*<-recursion::Nats.Nat#*/ { - inline def ++/*<-recursion::Nats.Nat#`++`().*/ : Succ/*->recursion::Nats.Succ#*/[this.type] = Succ/*->recursion::Nats.Succ.*//*->recursion::Nats.Succ.apply().*/(this) + transparent inline def ++/*<-recursion::Nats.Nat#`++`().*/ : Succ/*->recursion::Nats.Succ#*/[this.type] = Succ/*->recursion::Nats.Succ.*//*->recursion::Nats.Succ.apply().*/(this) transparent inline def +/*<-recursion::Nats.Nat#`+`().*/(inline that/*<-recursion::Nats.Nat#`+`().(that)*/: Nat/*->recursion::Nats.Nat#*/): Nat/*->recursion::Nats.Nat#*/ = inline this match { diff --git a/tests/semanticdb/expect/recursion.scala b/tests/semanticdb/expect/recursion.scala index 4c0b54dd5083..3c06e5b202f4 100644 --- a/tests/semanticdb/expect/recursion.scala +++ b/tests/semanticdb/expect/recursion.scala @@ -3,7 +3,7 @@ package recursion object Nats { sealed trait Nat { - inline def ++ : Succ[this.type] = Succ(this) + transparent inline def ++ : Succ[this.type] = Succ(this) transparent inline def +(inline that: Nat): Nat = inline this match { diff --git a/tests/semanticdb/metac.expect b/tests/semanticdb/metac.expect index c13392fb7ebc..191e2f3d0379 100644 --- a/tests/semanticdb/metac.expect +++ b/tests/semanticdb/metac.expect @@ -3309,10 +3309,10 @@ Occurrences: [3:7..3:11): Nats <- recursion/Nats. [4:15..4:18): Nat <- recursion/Nats.Nat# [5:4..5:4): <- recursion/Nats.Nat#``(). -[5:15..5:17): ++ <- recursion/Nats.Nat#`++`(). -[5:20..5:24): Succ -> recursion/Nats.Succ# -[5:38..5:42): Succ -> recursion/Nats.Succ. -[5:42..5:42): -> recursion/Nats.Succ.apply(). +[5:27..5:29): ++ <- recursion/Nats.Nat#`++`(). +[5:32..5:36): Succ -> recursion/Nats.Succ# +[5:50..5:54): Succ -> recursion/Nats.Succ. +[5:54..5:54): -> recursion/Nats.Succ.apply(). [7:27..7:28): + <- recursion/Nats.Nat#`+`(). [7:36..7:40): that <- recursion/Nats.Nat#`+`().(that) [7:42..7:45): Nat -> recursion/Nats.Nat# diff --git a/tests/sjs-junit/test/org/scalajs/testsuite/compiler/CustomReflectSelectableTestScala3.scala b/tests/sjs-junit/test/org/scalajs/testsuite/compiler/CustomReflectSelectableTestScala3.scala index 716d5b9c5c4a..744a59bebc9d 100644 --- a/tests/sjs-junit/test/org/scalajs/testsuite/compiler/CustomReflectSelectableTestScala3.scala +++ b/tests/sjs-junit/test/org/scalajs/testsuite/compiler/CustomReflectSelectableTestScala3.scala @@ -1,10 +1,10 @@ package org.scalajs.testsuite.compiler -import org.junit.Assert._ +import org.junit.Assert.* import org.junit.Test class CustomReflectSelectableTestScala3 { - import CustomReflectSelectableTestScala3._ + import CustomReflectSelectableTestScala3.* @Test def selectField(): Unit = { val obj: reflect.Selectable { val x: Int } = new CustomReflectSelectable(42) diff --git a/tests/sjs-junit/test/org/scalajs/testsuite/compiler/EnumTestScala3.scala b/tests/sjs-junit/test/org/scalajs/testsuite/compiler/EnumTestScala3.scala index 01bdb6ccc954..263a3b4774a3 100644 --- a/tests/sjs-junit/test/org/scalajs/testsuite/compiler/EnumTestScala3.scala +++ b/tests/sjs-junit/test/org/scalajs/testsuite/compiler/EnumTestScala3.scala @@ -1,13 +1,13 @@ package org.scalajs.testsuite.compiler -import org.junit.Assert._ +import org.junit.Assert.* import org.junit.Test class EnumTestScala3: - import EnumTestScala3._ + import EnumTestScala3.* @Test def testColor1(): Unit = - import EnumTestScala3.{Color1 => Color} + import EnumTestScala3.{Color1 as Color} def code(c: Color): Character = c match case Color.Red => 'R' @@ -35,7 +35,7 @@ class EnumTestScala3: end testColor1 @Test def testColor2(): Unit = // copied from `color1` - import EnumTestScala3.{Color2 => Color} + import EnumTestScala3.{Color2 as Color} def code(c: Color): Character = c match case Color.Red => 'R' @@ -63,7 +63,7 @@ class EnumTestScala3: end testColor2 @Test def testCurrency1(): Unit = - import EnumTestScala3.{Currency1 => Currency} + import EnumTestScala3.{Currency1 as Currency} def code(c: Currency): String = c match case Currency.Dollar => "USD" @@ -95,7 +95,7 @@ class EnumTestScala3: end testCurrency1 @Test def testCurrency2(): Unit = // copied from `testCurrency1` - import EnumTestScala3.{Currency2 => Currency} + import EnumTestScala3.{Currency2 as Currency} def code(c: Currency): String = c match case Currency.Dollar => "USD" diff --git a/tests/sjs-junit/test/org/scalajs/testsuite/compiler/ReflectiveCallTestScala3.scala b/tests/sjs-junit/test/org/scalajs/testsuite/compiler/ReflectiveCallTestScala3.scala index 904f69cfdfea..9648af61e31a 100644 --- a/tests/sjs-junit/test/org/scalajs/testsuite/compiler/ReflectiveCallTestScala3.scala +++ b/tests/sjs-junit/test/org/scalajs/testsuite/compiler/ReflectiveCallTestScala3.scala @@ -7,7 +7,7 @@ package org.scalajs.testsuite.compiler import scala.reflect.Selectable.reflectiveSelectable -import org.junit.Assert._ +import org.junit.Assert.* import org.junit.Test object ReflectiveCallTestScala3 { @@ -128,7 +128,7 @@ object ReflectiveCallTestScala3 { } class ReflectiveCallTestScala3 { - import ReflectiveCallTestScala3._ + import ReflectiveCallTestScala3.* @Test def testBasic1(): Unit = basic(new Foo1) @Test def testCurrying1(): Unit = currying(new Foo1) diff --git a/tests/sjs-junit/test/org/scalajs/testsuite/compiler/RegressionTestScala3.scala b/tests/sjs-junit/test/org/scalajs/testsuite/compiler/RegressionTestScala3.scala index b5c307f110f7..24c80e18bddb 100644 --- a/tests/sjs-junit/test/org/scalajs/testsuite/compiler/RegressionTestScala3.scala +++ b/tests/sjs-junit/test/org/scalajs/testsuite/compiler/RegressionTestScala3.scala @@ -1,12 +1,12 @@ package org.scalajs.testsuite.compiler -import org.junit.Assert._ +import org.junit.Assert.* import org.junit.Test import scala.scalajs.js class RegressionTestScala3 { - import RegressionTestScala3._ + import RegressionTestScala3.* @Test def testRegressionDoubleDefinitionOfOuterPointerIssue10177(): Unit = { assertEquals(6, new OuterClassIssue10177().foo(5)) diff --git a/tests/sjs-junit/test/org/scalajs/testsuite/jsinterop/TopLevelNativeJSMembersTestScala3.scala b/tests/sjs-junit/test/org/scalajs/testsuite/jsinterop/TopLevelNativeJSMembersTestScala3.scala index 084ba0c18a74..7ea63d31d397 100644 --- a/tests/sjs-junit/test/org/scalajs/testsuite/jsinterop/TopLevelNativeJSMembersTestScala3.scala +++ b/tests/sjs-junit/test/org/scalajs/testsuite/jsinterop/TopLevelNativeJSMembersTestScala3.scala @@ -1,10 +1,10 @@ package org.scalajs.testsuite.jsinterop -import org.junit.Assert._ +import org.junit.Assert.* import org.junit.Test import scala.scalajs.js -import scala.scalajs.js.annotation._ +import scala.scalajs.js.annotation.* @js.native @JSGlobal("interoperabilityTestGlobalValDefConstant") diff --git a/tests/untried/neg/caseinherit.scala b/tests/untried/neg/caseinherit.scala index 188b7d14f9d6..dd6332a42b21 100644 --- a/tests/untried/neg/caseinherit.scala +++ b/tests/untried/neg/caseinherit.scala @@ -3,7 +3,7 @@ package foo { case class B(y: Int) extends A(y) case object Bippy extends A(55) } -import foo._ +import foo.* package bar { class Blameless(x: Int) diff --git a/tests/untried/neg/compile-time-only-a.scala b/tests/untried/neg/compile-time-only-a.scala index 130a3c539f0e..801ee7efa33f 100644 --- a/tests/untried/neg/compile-time-only-a.scala +++ b/tests/untried/neg/compile-time-only-a.scala @@ -41,7 +41,7 @@ object Test extends App { new C4(2) C4(2) - import pkg._ + import pkg.* 2.ext C5(2) diff --git a/tests/untried/neg/cyclics-import.scala b/tests/untried/neg/cyclics-import.scala index 7b510b58e25d..aac58776aa0f 100644 --- a/tests/untried/neg/cyclics-import.scala +++ b/tests/untried/neg/cyclics-import.scala @@ -1,4 +1,4 @@ -import User.UserStatus._ +import User.UserStatus.* class User { var id: Int = 0 diff --git a/tests/untried/neg/forgot-interpolator.scala b/tests/untried/neg/forgot-interpolator.scala index a53054d89014..1bc0eb22d760 100644 --- a/tests/untried/neg/forgot-interpolator.scala +++ b/tests/untried/neg/forgot-interpolator.scala @@ -53,7 +53,7 @@ package test { def jj = "shadowed $j" // no warn } } - import annotation._ + import annotation.* @implicitNotFound("No Z in ${A}") // no warn class Z[A] } diff --git a/tests/untried/neg/imp2.scala b/tests/untried/neg/imp2.scala index 9937262188d7..27c0a46eb2fd 100644 --- a/tests/untried/neg/imp2.scala +++ b/tests/untried/neg/imp2.scala @@ -13,7 +13,7 @@ object B extends C { object Test { val a: C = A; val b: C = B; - import a._ - import b._ + import a.* + import b.* val x = f } diff --git a/tests/untried/neg/implicit-shadow.scala b/tests/untried/neg/implicit-shadow.scala index b03d0edbd886..ea93649e9ab0 100644 --- a/tests/untried/neg/implicit-shadow.scala +++ b/tests/untried/neg/implicit-shadow.scala @@ -1,5 +1,5 @@ object Test { - import B._, C._ + import B._, C.* 1.isEmpty } diff --git a/tests/untried/neg/import-precedence.scala b/tests/untried/neg/import-precedence.scala index 0401635e3264..5ccdf78bb209 100644 --- a/tests/untried/neg/import-precedence.scala +++ b/tests/untried/neg/import-precedence.scala @@ -14,13 +14,13 @@ package uniq1 { package p1 { import uniq1.X package p2 { - import uniq1.uniq2._ + import uniq1.uniq2.* object Y { def f = X } } } package p2 { - import uniq1.uniq2._ + import uniq1.uniq2.* package p2 { import uniq1.X object Y { def f = X } @@ -29,12 +29,12 @@ package p2 { package p3 { import uniq1.X - import uniq1.uniq2._ + import uniq1.uniq2.* object Y { def f = X } } package p4 { - import uniq1.uniq2._ + import uniq1.uniq2.* import uniq1.X object Y { def f = X } } @@ -48,16 +48,16 @@ package p5 { } package p6 { - import uniq1._ + import uniq1.* package p5 { - import uniq1.uniq2._ + import uniq1.uniq2.* object Y { def f = X } } } package p7 { - import uniq1._ - import uniq1.uniq2._ + import uniq1.* + import uniq1.uniq2.* object Y { def f = X } } diff --git a/tests/untried/neg/migration28.scala b/tests/untried/neg/migration28.scala index facc9b36d2f2..7d57382d156d 100644 --- a/tests/untried/neg/migration28.scala +++ b/tests/untried/neg/migration28.scala @@ -1,5 +1,5 @@ object Test { - import scala.collection.mutable._ + import scala.collection.mutable.* List(1,2,3,4,5).scanRight(0)(_+_) diff --git a/tests/untried/neg/name-lookup-stable.scala b/tests/untried/neg/name-lookup-stable.scala index 0d862f06e136..0e122e2144d7 100644 --- a/tests/untried/neg/name-lookup-stable.scala +++ b/tests/untried/neg/name-lookup-stable.scala @@ -10,7 +10,7 @@ class A { def PrimaryKey: Any = ??? { - import ColumnOption._ + import ColumnOption.* (null: Any) match { case PrimaryKey => } diff --git a/tests/untried/neg/nested-annotation.scala b/tests/untried/neg/nested-annotation.scala index 35c0cd3b75ce..16ef1f53b13d 100644 --- a/tests/untried/neg/nested-annotation.scala +++ b/tests/untried/neg/nested-annotation.scala @@ -1,4 +1,4 @@ -import annotation._ +import annotation.* class ComplexAnnotation(val value: Annotation) extends ClassfileAnnotation diff --git a/tests/untried/neg/noMember1.scala b/tests/untried/neg/noMember1.scala index 0aee7bff7f9f..1f781bbe450d 100644 --- a/tests/untried/neg/noMember1.scala +++ b/tests/untried/neg/noMember1.scala @@ -1,3 +1,3 @@ -import scala.collection.mutable.MultiMap._ +import scala.collection.mutable.MultiMap.* class A diff --git a/tests/untried/neg/nopredefs.scala b/tests/untried/neg/nopredefs.scala index 1128b189342a..7b3fec25186c 100644 --- a/tests/untried/neg/nopredefs.scala +++ b/tests/untried/neg/nopredefs.scala @@ -1,4 +1,4 @@ -import Predef.{Set => _, _} +import Predef.{Set as _, *} object Test { val x = Map(1 -> 2) diff --git a/tests/untried/neg/object-not-a-value.scala b/tests/untried/neg/object-not-a-value.scala index 207b271df22c..effa93027bb5 100644 --- a/tests/untried/neg/object-not-a-value.scala +++ b/tests/untried/neg/object-not-a-value.scala @@ -1,5 +1,5 @@ object Test { - import java.util._ + import java.util.* def main(args: Array[String]): Unit = { List(1) map (_ + 1) diff --git a/tests/untried/neg/predef-masking.scala b/tests/untried/neg/predef-masking.scala index 67b69aa1699b..5dc4549eb422 100644 --- a/tests/untried/neg/predef-masking.scala +++ b/tests/untried/neg/predef-masking.scala @@ -1,5 +1,5 @@ // Testing predef masking -import Predef.{ any2stringadd => _, _ } +import Predef.{ any2stringadd as _, * } object StringPlusConfusion { // Would love to do something about this error message, but by the diff --git a/tests/untried/neg/protected-constructors.scala b/tests/untried/neg/protected-constructors.scala index 2838caf09c83..83638a01ebe3 100644 --- a/tests/untried/neg/protected-constructors.scala +++ b/tests/untried/neg/protected-constructors.scala @@ -7,7 +7,7 @@ package dingus { } package hungus { - import dingus._ + import dingus.* object P { class Bar1 extends Foo1("abc") diff --git a/tests/untried/neg/saferJavaConversions.scala b/tests/untried/neg/saferJavaConversions.scala index f0611204e6b5..ee2422074d01 100644 --- a/tests/untried/neg/saferJavaConversions.scala +++ b/tests/untried/neg/saferJavaConversions.scala @@ -3,17 +3,17 @@ case class Foo(s: String) object Test { def f1 = { - import scala.collection.JavaConversions._ + import scala.collection.JavaConversions.* val map: Map[Foo, String] = Map(Foo("a") -> "a", Foo("b") -> "b") val v = map.get("a") // should be a type error, actually returns null } def f2 = { - import scala.collection.convert.wrapAsScala._ + import scala.collection.convert.wrapAsScala.* val map: Map[Foo, String] = Map(Foo("a") -> "a", Foo("b") -> "b") val v = map.get("a") // now this is a type error } def f3 = { - import scala.collection.convert.wrapAsJava._ + import scala.collection.convert.wrapAsJava.* val map: Map[Foo, String] = Map(Foo("a") -> "a", Foo("b") -> "b") val v = map.get("a") } diff --git a/tests/untried/neg/sealed-java-enums.scala b/tests/untried/neg/sealed-java-enums.scala index 2daf93f3088d..33d6ea495907 100644 --- a/tests/untried/neg/sealed-java-enums.scala +++ b/tests/untried/neg/sealed-java-enums.scala @@ -1,5 +1,5 @@ import java.lang.Thread.State -import java.lang.Thread.State._ +import java.lang.Thread.State.* object Test { def f(state: State) = state match { diff --git a/tests/untried/neg/suggest-similar.scala b/tests/untried/neg/suggest-similar.scala index ff327478fe10..d684ba3134fb 100644 --- a/tests/untried/neg/suggest-similar.scala +++ b/tests/untried/neg/suggest-similar.scala @@ -2,7 +2,7 @@ class Dingus object Dingus { var flippity = 1 } -import Dingus._ +import Dingus.* class A { flippitx = 123 diff --git a/tests/untried/neg/t1038.scala b/tests/untried/neg/t1038.scala index 367022965b99..56ff9d1484f3 100644 --- a/tests/untried/neg/t1038.scala +++ b/tests/untried/neg/t1038.scala @@ -2,7 +2,7 @@ class X(x : Int) object Y { val a = new X - import a._ + import a.* implicit val b : Int = 1 implicit val c = 2 } diff --git a/tests/untried/neg/t1845.scala b/tests/untried/neg/t1845.scala index 4d3966484ded..8153cb3bf576 100644 --- a/tests/untried/neg/t1845.scala +++ b/tests/untried/neg/t1845.scala @@ -3,7 +3,7 @@ trait TokenParsers { val lexical: Tokens } class MyTokenParsers extends TokenParsers { - import lexical._ + import lexical.* val lexical = new Tokens diff --git a/tests/untried/neg/t2031.scala b/tests/untried/neg/t2031.scala index fde7a603fa60..90e94ecd70e6 100644 --- a/tests/untried/neg/t2031.scala +++ b/tests/untried/neg/t2031.scala @@ -1,4 +1,4 @@ -import scala.collection.immutable._ +import scala.collection.immutable.* object Test extends App { val res0 = TreeSet(1, 2, 3) diff --git a/tests/untried/neg/t2206.scala b/tests/untried/neg/t2206.scala index 529f5030b5f2..c4abb9d11742 100644 --- a/tests/untried/neg/t2206.scala +++ b/tests/untried/neg/t2206.scala @@ -5,7 +5,7 @@ object o { def f(): Unit = { } } - import Implicits._ + import Implicits.* val a = new A a.f() diff --git a/tests/untried/neg/t2405.scala b/tests/untried/neg/t2405.scala index c005e7a54313..8463f9bf9a2b 100644 --- a/tests/untried/neg/t2405.scala +++ b/tests/untried/neg/t2405.scala @@ -3,7 +3,7 @@ object A { implicit val x: Int = 1 } // Expecting shadowing #1 object Test2 { { - import A.{x => y} + import A.{x as y} def y: Int = 0 implicitly[Int] } diff --git a/tests/untried/neg/t2442/t2442.scala b/tests/untried/neg/t2442/t2442.scala index 305c9d624f82..6ec46cf43d03 100644 --- a/tests/untried/neg/t2442/t2442.scala +++ b/tests/untried/neg/t2442/t2442.scala @@ -1,5 +1,5 @@ class Test { - import MyEnum._ + import MyEnum.* def f(e: MyEnum) = e match { case ONE => println("one") @@ -7,7 +7,7 @@ class Test { // missing case --> exhaustivity warning! } - import MySecondEnum._ + import MySecondEnum.* def g(e: MySecondEnum) = e match { case RED => println("red") // missing case --> exhaustivity warning! diff --git a/tests/untried/neg/t2641.scala b/tests/untried/neg/t2641.scala index bc048e039ecf..c46ff0f6eff8 100644 --- a/tests/untried/neg/t2641.scala +++ b/tests/untried/neg/t2641.scala @@ -1,5 +1,5 @@ -import scala.collection._ -import scala.collection.generic._ +import scala.collection.* +import scala.collection.generic.* import scala.collection.mutable.Builder diff --git a/tests/untried/neg/t3160ambiguous.scala b/tests/untried/neg/t3160ambiguous.scala index 57745e60d8c6..6b4b5415988f 100644 --- a/tests/untried/neg/t3160ambiguous.scala +++ b/tests/untried/neg/t3160ambiguous.scala @@ -2,14 +2,14 @@ object Bippy { private class List[+T] } class Bippy { - import Bippy._ - import scala.collection.immutable._ + import Bippy.* + import scala.collection.immutable.* def f(x: List[Any]): String = ??? // ambiguous, because Bippy.List is accessible } class Other { - import Bippy._ - import scala.collection.immutable._ + import Bippy.* + import scala.collection.immutable.* def f(x: List[Any]): String = ??? // unambiguous, because Bippy.List is inaccessible } diff --git a/tests/untried/neg/t3403.scala b/tests/untried/neg/t3403.scala index 7cf0c3e0f7fc..815348d28729 100644 --- a/tests/untried/neg/t3403.scala +++ b/tests/untried/neg/t3403.scala @@ -1,2 +1,2 @@ -import scala.beans.{BeanProperty => bp} +import scala.beans.{BeanProperty as bp} class Foo { @bp var bar: Int = 1 } diff --git a/tests/untried/neg/t3453.scala b/tests/untried/neg/t3453.scala index af778189408f..dab38bcd72f6 100644 --- a/tests/untried/neg/t3453.scala +++ b/tests/untried/neg/t3453.scala @@ -24,7 +24,7 @@ object O { } class T2a { - import O._ + import O.* def x: B = { val aToB = 3 diff --git a/tests/untried/neg/t3836.scala b/tests/untried/neg/t3836.scala index a68f6e172f94..57b8d86e0e14 100644 --- a/tests/untried/neg/t3836.scala +++ b/tests/untried/neg/t3836.scala @@ -10,8 +10,8 @@ package object baz { } package baz { - import java.io._ - import foo.bar._ + import java.io.* + import foo.bar.* object Test { def f = new IOException // genuinely different @@ -19,8 +19,8 @@ package baz { } package baz2 { - import bar._ - import baz._ + import bar.* + import baz.* object Test2 { def f: Bippy[Int] = ??? diff --git a/tests/untried/neg/t3871b.scala b/tests/untried/neg/t3871b.scala index b490b7789ade..8475145bbb0e 100644 --- a/tests/untried/neg/t3871b.scala +++ b/tests/untried/neg/t3871b.scala @@ -22,7 +22,7 @@ if one of the following applies: object E { val e = new E - import e._ + import e.* def n(a: A, b: B, c: C) = { b.protE // 1c c.protE // 1c @@ -53,7 +53,7 @@ class E { A.this.protT } - import A._ + import A.* // 0a protO // 3 @@ -115,7 +115,7 @@ class E { class Other { val e = new E - import e._ + import e.* def n(a: A, b: B, c: C) = { b.prot // not allowed c.prot // not allowed diff --git a/tests/untried/neg/t4079/t4079_1.scala b/tests/untried/neg/t4079/t4079_1.scala index cbae8647888b..0ec25fbfe0e9 100644 --- a/tests/untried/neg/t4079/t4079_1.scala +++ b/tests/untried/neg/t4079/t4079_1.scala @@ -28,6 +28,6 @@ object Functors { } object Main { - import Functors._ + import Functors.* val cf = Cat.compose[List,Option].Functor } diff --git a/tests/untried/neg/t4831.scala b/tests/untried/neg/t4831.scala index 82346ec57dc0..b3cc6d63f0a3 100644 --- a/tests/untried/neg/t4831.scala +++ b/tests/untried/neg/t4831.scala @@ -3,7 +3,7 @@ object O { val b = 1 } -import O.{a => b} +import O.{a as b} import O.b object test { diff --git a/tests/untried/neg/t5376.scala b/tests/untried/neg/t5376.scala index 99e5cf1a1340..8f36952276fa 100644 --- a/tests/untried/neg/t5376.scala +++ b/tests/untried/neg/t5376.scala @@ -5,8 +5,8 @@ object Test { // Import two implicits with the same name in the same scope. def m1 = { - import O1._ - import O2._ + import O1.* + import O2.* // Implicit usage compiles. "a": Int @@ -15,8 +15,8 @@ object Test { // Import one implicit and one non-implicit method with the // same name in the same scope. def m2 = { - import O1._ - import O3._ + import O1.* + import O3.* // Implicit usage compiles. "a": Int diff --git a/tests/untried/neg/t5580b.scala b/tests/untried/neg/t5580b.scala index 2161da45849c..3ea4689f153a 100644 --- a/tests/untried/neg/t5580b.scala +++ b/tests/untried/neg/t5580b.scala @@ -1,5 +1,5 @@ import scala.collection.mutable.WeakHashMap -import scala.collection.JavaConversions._ +import scala.collection.JavaConversions.* class bar { } diff --git a/tests/untried/neg/t5821.scala b/tests/untried/neg/t5821.scala index 4af0a2bf7f26..b3dd672940a7 100644 --- a/tests/untried/neg/t5821.scala +++ b/tests/untried/neg/t5821.scala @@ -1,4 +1,4 @@ -import SthImportant._ +import SthImportant.* class Bar diff --git a/tests/untried/neg/t6083.scala b/tests/untried/neg/t6083.scala index 1de18e65279e..4a54baf4eff1 100644 --- a/tests/untried/neg/t6083.scala +++ b/tests/untried/neg/t6083.scala @@ -1,7 +1,7 @@ object conv { implicit def i2s(i: Int): String = "" } -import conv._ +import conv.* class annot(value: String) extends annotation.ClassfileAnnotation @annot(101) class C diff --git a/tests/untried/neg/t6375.scala b/tests/untried/neg/t6375.scala index 21634df6882d..1ac49d6373f5 100644 --- a/tests/untried/neg/t6375.scala +++ b/tests/untried/neg/t6375.scala @@ -1,4 +1,4 @@ -import scala.annotation.meta._ +import scala.annotation.meta.* class Bippy extends scala.annotation.StaticAnnotation diff --git a/tests/untried/neg/t639.scala b/tests/untried/neg/t639.scala index eaeed944a4c9..c64750333aa7 100644 --- a/tests/untried/neg/t639.scala +++ b/tests/untried/neg/t639.scala @@ -1,6 +1,6 @@ package foo123 -import a._ +import a.* @B class C diff --git a/tests/untried/neg/t6436.scala b/tests/untried/neg/t6436.scala index 2c4050253885..ccb69fc02fd2 100644 --- a/tests/untried/neg/t6436.scala +++ b/tests/untried/neg/t6436.scala @@ -4,6 +4,6 @@ object quasiquotes { } object Test extends App { - import quasiquotes._ + import quasiquotes.* println(q"a") } diff --git a/tests/untried/neg/t6436b.scala b/tests/untried/neg/t6436b.scala index 8023329e9051..5f8edf6683a5 100644 --- a/tests/untried/neg/t6436b.scala +++ b/tests/untried/neg/t6436b.scala @@ -4,6 +4,6 @@ object quasiquotes { } object Test extends App { - import quasiquotes._ + import quasiquotes.* println(StringContext("a").q()) } diff --git a/tests/untried/neg/t6535.scala b/tests/untried/neg/t6535.scala index 30a750311c16..096a93a0bcea 100644 --- a/tests/untried/neg/t6535.scala +++ b/tests/untried/neg/t6535.scala @@ -1,5 +1,5 @@ object As { - import Bs.B._ + import Bs.B.* object A extends scala.AnyRef // needed for the cycle; @@ -8,7 +8,7 @@ object As { } object Bs { - import As.A._ + import As.A.* object B extends scala.AnyRef // scala.Immutable, ... diff --git a/tests/untried/neg/t6963a.scala b/tests/untried/neg/t6963a.scala index 6808e541bb9d..6c574cd20d49 100644 --- a/tests/untried/neg/t6963a.scala +++ b/tests/untried/neg/t6963a.scala @@ -1,5 +1,5 @@ object Test { - import scala.collection.mutable._ + import scala.collection.mutable.* List(1,2,3,4,5).scanRight(0)(_+_) } diff --git a/tests/untried/neg/t7285.scala b/tests/untried/neg/t7285.scala index 14121d92b1b3..3ca02d145a65 100644 --- a/tests/untried/neg/t7285.scala +++ b/tests/untried/neg/t7285.scala @@ -46,7 +46,7 @@ object Test4 { case object Up extends Base } - import Test4.Base._ + import Test4.Base.* (d1: Base, d2: Base) => (d1, d2) match { case (Up, Up) | (Down, Down) => false diff --git a/tests/untried/neg/t7494-after-terminal/ThePlugin.scala b/tests/untried/neg/t7494-after-terminal/ThePlugin.scala index e8de8132ec42..d35694adc709 100644 --- a/tests/untried/neg/t7494-after-terminal/ThePlugin.scala +++ b/tests/untried/neg/t7494-after-terminal/ThePlugin.scala @@ -7,7 +7,7 @@ import nsc.plugins.Plugin import nsc.plugins.PluginComponent class ThePlugin(val global: Global) extends Plugin { - import global._ + import global.* val name = "afterterminal" val description = "Declares one plugin that wants to be after the terminal phase" diff --git a/tests/untried/neg/t7494-before-parser/ThePlugin.scala b/tests/untried/neg/t7494-before-parser/ThePlugin.scala index bb335c9c9dcd..47693998a9d8 100644 --- a/tests/untried/neg/t7494-before-parser/ThePlugin.scala +++ b/tests/untried/neg/t7494-before-parser/ThePlugin.scala @@ -7,7 +7,7 @@ import nsc.plugins.Plugin import nsc.plugins.PluginComponent class ThePlugin(val global: Global) extends Plugin { - import global._ + import global.* val name = "beforeparser" val description = "Declares one plugin that wants to be before the parser phase" diff --git a/tests/untried/neg/t7494-multi-right-after/ThePlugin.scala b/tests/untried/neg/t7494-multi-right-after/ThePlugin.scala index cb9e86e90675..db83e4553421 100644 --- a/tests/untried/neg/t7494-multi-right-after/ThePlugin.scala +++ b/tests/untried/neg/t7494-multi-right-after/ThePlugin.scala @@ -7,7 +7,7 @@ import nsc.plugins.Plugin import nsc.plugins.PluginComponent class ThePlugin(val global: Global) extends Plugin { - import global._ + import global.* val name = "multi-rafter" val description = "" diff --git a/tests/untried/neg/t7494-right-after-before/ThePlugin.scala b/tests/untried/neg/t7494-right-after-before/ThePlugin.scala index 967c1fb30705..f0d3425eb873 100644 --- a/tests/untried/neg/t7494-right-after-before/ThePlugin.scala +++ b/tests/untried/neg/t7494-right-after-before/ThePlugin.scala @@ -7,7 +7,7 @@ import nsc.plugins.Plugin import nsc.plugins.PluginComponent class ThePlugin(val global: Global) extends Plugin { - import global._ + import global.* val name = "rafter-before-1" val description = "" diff --git a/tests/untried/neg/t7494-right-after-terminal/ThePlugin.scala b/tests/untried/neg/t7494-right-after-terminal/ThePlugin.scala index 7c4d084582de..52ceff6311ae 100644 --- a/tests/untried/neg/t7494-right-after-terminal/ThePlugin.scala +++ b/tests/untried/neg/t7494-right-after-terminal/ThePlugin.scala @@ -7,7 +7,7 @@ import nsc.plugins.Plugin import nsc.plugins.PluginComponent class ThePlugin(val global: Global) extends Plugin { - import global._ + import global.* val name = "rightafterterminal" val description = "Declares one plugin that wants to be right after the terminal phase" diff --git a/tests/untried/neg/t7622-cyclic-dependency/ThePlugin.scala b/tests/untried/neg/t7622-cyclic-dependency/ThePlugin.scala index 8074966bb628..7c71f1ca3b50 100644 --- a/tests/untried/neg/t7622-cyclic-dependency/ThePlugin.scala +++ b/tests/untried/neg/t7622-cyclic-dependency/ThePlugin.scala @@ -7,7 +7,7 @@ import nsc.plugins.Plugin import nsc.plugins.PluginComponent class ThePlugin(val global: Global) extends Plugin { - import global._ + import global.* val name = "cyclicdependency" val description = "Declares two phases that have a cyclic dependency" diff --git a/tests/untried/neg/t7622-missing-dependency/ThePlugin.scala b/tests/untried/neg/t7622-missing-dependency/ThePlugin.scala index 0fcbc6309ad6..6432cb5fdb6f 100644 --- a/tests/untried/neg/t7622-missing-dependency/ThePlugin.scala +++ b/tests/untried/neg/t7622-missing-dependency/ThePlugin.scala @@ -7,7 +7,7 @@ import nsc.plugins.Plugin import nsc.plugins.PluginComponent class ThePlugin(val global: Global) extends Plugin { - import global._ + import global.* val name = "myplugin" val description = "Declares one plugin with a missing requirement" diff --git a/tests/untried/neg/t7622-multi-followers/ThePlugin.scala b/tests/untried/neg/t7622-multi-followers/ThePlugin.scala index 36ee84f94a3f..2b5d528fcf8b 100644 --- a/tests/untried/neg/t7622-multi-followers/ThePlugin.scala +++ b/tests/untried/neg/t7622-multi-followers/ThePlugin.scala @@ -7,7 +7,7 @@ import nsc.plugins.Plugin import nsc.plugins.PluginComponent class ThePlugin(val global: Global) extends Plugin { - import global._ + import global.* val name = "multi" val description = "Declares two phases that both follow parser" diff --git a/tests/untried/neg/t7715.scala b/tests/untried/neg/t7715.scala index 637ab8df6d81..d030a629b3ff 100644 --- a/tests/untried/neg/t7715.scala +++ b/tests/untried/neg/t7715.scala @@ -1,6 +1,6 @@ import PartialFunction.cond -import util._ +import util.* object Test extends App { val days = (1 to 12).toList diff --git a/tests/untried/neg/t8072.scala b/tests/untried/neg/t8072.scala index dddb8c5f207a..7d3bf015a1e9 100644 --- a/tests/untried/neg/t8072.scala +++ b/tests/untried/neg/t8072.scala @@ -1,5 +1,5 @@ class NoIfParSeq { - import collection.parallel._ + import collection.parallel.* val x = List(1,2) val y = x.ifParSeq[Int](throw new Exception).otherwise(0) // Shouldn't compile val z = x.toParArray diff --git a/tests/untried/neg/t8229.scala b/tests/untried/neg/t8229.scala index 91966311e2d0..64c0ae3b91ca 100644 --- a/tests/untried/neg/t8229.scala +++ b/tests/untried/neg/t8229.scala @@ -1,4 +1,4 @@ -import Predef.{any2stringadd => _, _} +import Predef.{any2stringadd as _, *} object Test { val o = new Object() diff --git a/tests/untried/neg/t8300-overloading.scala b/tests/untried/neg/t8300-overloading.scala index 0f4eee7b4211..7ee5d0855475 100644 --- a/tests/untried/neg/t8300-overloading.scala +++ b/tests/untried/neg/t8300-overloading.scala @@ -9,7 +9,7 @@ trait Universe { object Test extends App { val u: Universe = ??? - import u._ + import u.* def foo(name: Name) = ??? def foo(name: TermName) = ??? diff --git a/tests/untried/neg/test-implicits.scala b/tests/untried/neg/test-implicits.scala index 5cb09804c74e..4e0028e3823a 100644 --- a/tests/untried/neg/test-implicits.scala +++ b/tests/untried/neg/test-implicits.scala @@ -14,8 +14,8 @@ object Sub extends Super { } object Test { - import Super._ - import Sub._ + import Super.* + import Sub.* val p = new Pos def f(x: Int): Int = x f(p + 1) @@ -67,7 +67,7 @@ class Test3 { val a = 0 { - import X._ + import X.* a } } diff --git a/tests/untried/neg/viewtest.scala b/tests/untried/neg/viewtest.scala index 5e7d624d2307..2c40da6c8a0e 100644 --- a/tests/untried/neg/viewtest.scala +++ b/tests/untried/neg/viewtest.scala @@ -84,7 +84,7 @@ case class Str(elem: String) extends Ordered[Str] { } object Test { - import O._ + import O.* private def toCharList(s: String): List[Char] = if (s.length() == 0) List() diff --git a/tests/untried/neg/warn-unused-imports.scala b/tests/untried/neg/warn-unused-imports.scala index b7a2f1c414ea..4b1c1183dcba 100644 --- a/tests/untried/neg/warn-unused-imports.scala +++ b/tests/untried/neg/warn-unused-imports.scala @@ -97,7 +97,7 @@ trait Nested { { import p1._ // warn trait Warn { // warn about unused local trait for good measure - import p2._ + import p2.* println(new A) println("abc".bippy) } diff --git a/tests/untried/pos/t595.scala b/tests/untried/pos/t595.scala index 44124c90c912..008b6d2ad6d2 100644 --- a/tests/untried/pos/t595.scala +++ b/tests/untried/pos/t595.scala @@ -1,5 +1,5 @@ package lampion.scala; -import _root_.scala.collection._ +import _root_.scala.collection.* class Foo extends mutable.HashMap diff --git a/tests/untried/pos/t8170b.scala b/tests/untried/pos/t8170b.scala index e3d1d33d9b58..1d3addac1e71 100644 --- a/tests/untried/pos/t8170b.scala +++ b/tests/untried/pos/t8170b.scala @@ -1,4 +1,4 @@ -import language._ +import language.* object ScalaZeee { trait HFold[M[_], U] { @@ -15,7 +15,7 @@ object ScalaZeee { } object TypelevelUsage { - import ScalaZeee._ + import ScalaZeee.* type T = GenericCons[Some, String, KNil.type] val klist1: T = ??? type T2 = klist1.Folded[Option, Int, HFold[Option, Int]] diff --git a/tests/untried/pos/viewtest2.scala b/tests/untried/pos/viewtest2.scala index 6dd0389c8e3e..fb51d24936e4 100644 --- a/tests/untried/pos/viewtest2.scala +++ b/tests/untried/pos/viewtest2.scala @@ -83,7 +83,7 @@ case class Str(elem: String) extends Ordered[Str] { } object Test { - import O._ + import O.* private def toCharList(s: String): List[Char] = if (s.length() == 0) List()