diff --git a/compiler/src/dotty/tools/dotc/quoted/QuoteDriver.scala b/compiler/src/dotty/tools/dotc/quoted/QuoteDriver.scala index e10ee7c9f705..b39637f86abf 100644 --- a/compiler/src/dotty/tools/dotc/quoted/QuoteDriver.scala +++ b/compiler/src/dotty/tools/dotc/quoted/QuoteDriver.scala @@ -11,7 +11,7 @@ import scala.quoted.Expr import java.net.URLClassLoader -import Runners.{Settings, Run, Show} +import Toolbox.{Settings, Run, Show} class QuoteDriver extends Driver { import tpd._ diff --git a/compiler/src/dotty/tools/dotc/quoted/Runners.scala b/compiler/src/dotty/tools/dotc/quoted/Toolbox.scala similarity index 93% rename from compiler/src/dotty/tools/dotc/quoted/Runners.scala rename to compiler/src/dotty/tools/dotc/quoted/Toolbox.scala index 661d636e68e8..b5decbd5b6f4 100644 --- a/compiler/src/dotty/tools/dotc/quoted/Runners.scala +++ b/compiler/src/dotty/tools/dotc/quoted/Toolbox.scala @@ -11,17 +11,17 @@ import scala.quoted.Exprs.ValueExpr import scala.runtime.quoted._ /** Default runners for quoted expressions */ -object Runners { +object Toolbox { import tpd._ type Run type Show - implicit def runner[T]: Runner[T] = new Runner[T] { + implicit def toolbox[T]: Toolbox[T] = new Toolbox[T] { - def run(expr: Expr[T]): T = Runners.run(expr, Settings.run()) + def run(expr: Expr[T]): T = Toolbox.run(expr, Settings.run()) - def show(expr: Expr[T]): String = Runners.show(expr, Settings.show()) + def show(expr: Expr[T]): String = Toolbox.show(expr, Settings.show()) def toConstantOpt(expr: Expr[T]): Option[T] = { def toConstantOpt(tree: Tree): Option[T] = tree match { diff --git a/library/src/scala/quoted/Constant.scala b/library/src/scala/quoted/Constant.scala index b8db9575f70a..3e8ea180eaae 100644 --- a/library/src/scala/quoted/Constant.scala +++ b/library/src/scala/quoted/Constant.scala @@ -1,7 +1,7 @@ package scala.quoted -import scala.runtime.quoted.Runner +import scala.runtime.quoted.Toolbox object Constant { - def unapply[T](expr: Expr[T])(implicit runner: Runner[T]): Option[T] = runner.toConstantOpt(expr) + def unapply[T](expr: Expr[T])(implicit runner: Toolbox[T]): Option[T] = runner.toConstantOpt(expr) } diff --git a/library/src/scala/quoted/Expr.scala b/library/src/scala/quoted/Expr.scala index 0f724c9257ca..c1e4cbf9ff7c 100644 --- a/library/src/scala/quoted/Expr.scala +++ b/library/src/scala/quoted/Expr.scala @@ -1,12 +1,12 @@ package scala.quoted -import scala.runtime.quoted.Runner +import scala.runtime.quoted.Toolbox import scala.runtime.quoted.Unpickler.Pickled sealed abstract class Expr[T] { final def unary_~ : T = throw new Error("~ should have been compiled away") - final def run(implicit runner: Runner[T]): T = runner.run(this) - final def show(implicit runner: Runner[T]): String = runner.show(this) + final def run(implicit toolbox: Toolbox[T]): T = toolbox.run(this) + final def show(implicit toolbox: Toolbox[T]): String = toolbox.show(this) } object Expr { diff --git a/library/src/scala/runtime/quoted/Runner.scala b/library/src/scala/runtime/quoted/Toolbox.scala similarity index 57% rename from library/src/scala/runtime/quoted/Runner.scala rename to library/src/scala/runtime/quoted/Toolbox.scala index 02dd8f5b9ecb..9fd6c5a18fe4 100644 --- a/library/src/scala/runtime/quoted/Runner.scala +++ b/library/src/scala/runtime/quoted/Toolbox.scala @@ -3,8 +3,8 @@ package scala.runtime.quoted import scala.annotation.implicitNotFound import scala.quoted.Expr -@implicitNotFound("Could not find implicit Runner. Default runner can be imported with `import dotty.tools.dotc.quoted.Runners._`") -trait Runner[T] { +@implicitNotFound("Could not find implicit Toolbox. Default runner can be imported with `import dotty.tools.dotc.quoted.Toolbox._`") +trait Toolbox[T] { def run(expr: Expr[T]): T def show(expr: Expr[T]): String def toConstantOpt(expr: Expr[T]): Option[T] diff --git a/tests/pending/run-with-compiler/quote-run-constants-extract.scala b/tests/pending/run-with-compiler/quote-run-constants-extract.scala index 691cc462d434..4d4825b94f4d 100644 --- a/tests/pending/run-with-compiler/quote-run-constants-extract.scala +++ b/tests/pending/run-with-compiler/quote-run-constants-extract.scala @@ -1,6 +1,6 @@ import scala.quoted._ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ object Test { diff --git a/tests/pending/run-with-compiler/quote-run-large.scala b/tests/pending/run-with-compiler/quote-run-large.scala index 6066fbd4e8fe..71f3678498fd 100644 --- a/tests/pending/run-with-compiler/quote-run-large.scala +++ b/tests/pending/run-with-compiler/quote-run-large.scala @@ -1,4 +1,4 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted.TastyExpr diff --git a/tests/pos/quote-0.scala b/tests/pos/quote-0.scala index e080af70620f..9c44151eef36 100644 --- a/tests/pos/quote-0.scala +++ b/tests/pos/quote-0.scala @@ -1,5 +1,5 @@ import scala.quoted._ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ class Test { diff --git a/tests/pos/quote-assert/quoted_2.scala b/tests/pos/quote-assert/quoted_2.scala index 7d73cdc65a4a..a6e44fcf9ffa 100644 --- a/tests/pos/quote-assert/quoted_2.scala +++ b/tests/pos/quote-assert/quoted_2.scala @@ -1,4 +1,4 @@ -import dotty.tools.dotc.quoted.Runners.runner +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ import Macros._ diff --git a/tests/run-with-compiler/i3823-b.scala b/tests/run-with-compiler/i3823-b.scala index 19e8d99d10c3..088861972518 100644 --- a/tests/run-with-compiler/i3823-b.scala +++ b/tests/run-with-compiler/i3823-b.scala @@ -1,4 +1,4 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-with-compiler/i3823-c.scala b/tests/run-with-compiler/i3823-c.scala index a6162b49439b..d493e1a5d831 100644 --- a/tests/run-with-compiler/i3823-c.scala +++ b/tests/run-with-compiler/i3823-c.scala @@ -1,4 +1,4 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-with-compiler/i3823.scala b/tests/run-with-compiler/i3823.scala index 44d6ea118e58..418b2aae6fb1 100644 --- a/tests/run-with-compiler/i3823.scala +++ b/tests/run-with-compiler/i3823.scala @@ -1,4 +1,4 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-with-compiler/i3876-b.scala b/tests/run-with-compiler/i3876-b.scala index 2f067e1d7466..3385ec217997 100644 --- a/tests/run-with-compiler/i3876-b.scala +++ b/tests/run-with-compiler/i3876-b.scala @@ -1,4 +1,4 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-with-compiler/i3876-c.scala b/tests/run-with-compiler/i3876-c.scala index f7d4e09e22da..4bdbaa1f67a7 100644 --- a/tests/run-with-compiler/i3876-c.scala +++ b/tests/run-with-compiler/i3876-c.scala @@ -1,4 +1,4 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-with-compiler/i3876-d.scala b/tests/run-with-compiler/i3876-d.scala index 4558fe81ad1f..bd346b86a5ec 100644 --- a/tests/run-with-compiler/i3876-d.scala +++ b/tests/run-with-compiler/i3876-d.scala @@ -1,4 +1,4 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-with-compiler/i3876.scala b/tests/run-with-compiler/i3876.scala index 05cafa81d305..dbce45bd42d0 100644 --- a/tests/run-with-compiler/i3876.scala +++ b/tests/run-with-compiler/i3876.scala @@ -1,4 +1,4 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-with-compiler/i3946.scala b/tests/run-with-compiler/i3946.scala index 3bf49ce357c5..2802b016c4f8 100644 --- a/tests/run-with-compiler/i3946.scala +++ b/tests/run-with-compiler/i3946.scala @@ -1,4 +1,4 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ object Test { def main(args: Array[String]): Unit = { diff --git a/tests/run-with-compiler/quote-lib.scala b/tests/run-with-compiler/quote-lib.scala index 5eea442a6a07..630b2df6d7d2 100644 --- a/tests/run-with-compiler/quote-lib.scala +++ b/tests/run-with-compiler/quote-lib.scala @@ -1,6 +1,6 @@ import scala.quoted._ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import liftable.Units._ import liftable.Lets._ diff --git a/tests/run-with-compiler/quote-run-2.scala b/tests/run-with-compiler/quote-run-2.scala index 8361539c1442..cf27218340cd 100644 --- a/tests/run-with-compiler/quote-run-2.scala +++ b/tests/run-with-compiler/quote-run-2.scala @@ -1,5 +1,5 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ diff --git a/tests/run-with-compiler/quote-run-b.scala b/tests/run-with-compiler/quote-run-b.scala index 295d8b498230..8c4e2dac2b41 100644 --- a/tests/run-with-compiler/quote-run-b.scala +++ b/tests/run-with-compiler/quote-run-b.scala @@ -1,5 +1,5 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ diff --git a/tests/run-with-compiler/quote-run-c.scala b/tests/run-with-compiler/quote-run-c.scala index 375eae47df7d..56df25a84cba 100644 --- a/tests/run-with-compiler/quote-run-c.scala +++ b/tests/run-with-compiler/quote-run-c.scala @@ -1,5 +1,5 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ diff --git a/tests/run-with-compiler/quote-run-constants.scala b/tests/run-with-compiler/quote-run-constants.scala index af9449767a4f..c612e08ca066 100644 --- a/tests/run-with-compiler/quote-run-constants.scala +++ b/tests/run-with-compiler/quote-run-constants.scala @@ -1,5 +1,5 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ diff --git a/tests/run-with-compiler/quote-run-staged-interpreter.scala b/tests/run-with-compiler/quote-run-staged-interpreter.scala index 91429b7c86eb..76311f2f0bd6 100644 --- a/tests/run-with-compiler/quote-run-staged-interpreter.scala +++ b/tests/run-with-compiler/quote-run-staged-interpreter.scala @@ -1,5 +1,5 @@ import scala.quoted._ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ enum Exp { case Num(n: Int) diff --git a/tests/run-with-compiler/quote-run-with-settings.scala b/tests/run-with-compiler/quote-run-with-settings.scala index 5eea7fbc2033..c40fb0c4cab4 100644 --- a/tests/run-with-compiler/quote-run-with-settings.scala +++ b/tests/run-with-compiler/quote-run-with-settings.scala @@ -1,7 +1,7 @@ import java.nio.file.{Files, Paths} -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._ diff --git a/tests/run-with-compiler/quote-run.scala b/tests/run-with-compiler/quote-run.scala index 12c5373e0a50..5e23ab134d40 100644 --- a/tests/run-with-compiler/quote-run.scala +++ b/tests/run-with-compiler/quote-run.scala @@ -1,5 +1,5 @@ -import dotty.tools.dotc.quoted.Runners._ +import dotty.tools.dotc.quoted.Toolbox._ import scala.quoted._