diff --git a/docs/docs/reference/metaprogramming/staging.md b/docs/docs/reference/metaprogramming/staging.md index bb71c7a2550a..54961f912379 100644 --- a/docs/docs/reference/metaprogramming/staging.md +++ b/docs/docs/reference/metaprogramming/staging.md @@ -60,15 +60,15 @@ The framework as discussed so far allows code to be staged, i.e. be prepared to be executed at a later stage. To run that code, there is another method in class `Expr` called `run`. Note that `$` and `run` both map from `Expr[T]` to `T` but only `$` is subject to the PCP, whereas `run` is just a normal method. -`run` provides a `Quotes` that can be used to show the expression in its scope. -On the other hand `withQuotes` provides a `Quotes` without evaluating the expression. +`scala.quoted.staging.run` provides a `Quotes` that can be used to show the expression in its scope. +On the other hand `scala.quoted.staging.withQuotes` provides a `Quotes` without evaluating the expression. ```scala package scala.quoted.staging -def run[T](expr: Quotes ?=> Expr[T])(using toolbox: Toolbox): T = ... +def run[T](expr: Quotes ?=> Expr[T])(using Compiler): T = ... -def withQuotes[T](thunk: Quotes ?=> T)(using toolbox: Toolbox): T = ... +def withQuotes[T](thunk: Quotes ?=> T)(using Compiler): T = ... ``` ## Create a new Scala 3 project with staging enabled @@ -99,17 +99,17 @@ scala -with-compiler -classpath out Test Now take exactly the same example as in [Macros](./macros.md). Assume that we do not want to pass an array statically but generate code at run-time and pass the value, also at run-time. Note, how we make a future-stage function of type -`Expr[Array[Int] => Int]` in line 6 below. Using `run { ... }` we can evaluate an -expression at runtime. Within the scope of `run` we can also invoke `show` on an expression +`Expr[Array[Int] => Int]` in line 6 below. Using `staging.run { ... }` we can evaluate an +expression at runtime. Within the scope of `staging.run` we can also invoke `show` on an expression to get a source-like representation of the expression. ```scala -import scala.quoted.staging._ +import scala.quoted._ -// make available the necessary toolbox for runtime code generation -given Toolbox = Toolbox.make(getClass.getClassLoader) +// make available the necessary compiler for runtime code generation +given staging.Compiler = staging.Compiler.make(getClass.getClassLoader) -val f: Array[Int] => Int = run { +val f: Array[Int] => Int = staging.run { val stagedSum: Expr[Array[Int] => Int] = '{ (arr: Array[Int]) => ${sum('arr)}} println(stagedSum.show) // Prints "(arr: Array[Int]) => { var sum = 0; ... }" diff --git a/sbt-dotty/sbt-test/sbt-dotty/i7897/src/main/scala/hello/i7897.scala b/sbt-dotty/sbt-test/sbt-dotty/i7897/src/main/scala/hello/i7897.scala index eb4b5ac08be4..535f80b97644 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/i7897/src/main/scala/hello/i7897.scala +++ b/sbt-dotty/sbt-test/sbt-dotty/i7897/src/main/scala/hello/i7897.scala @@ -1,6 +1,6 @@ import scala.quoted._, staging._ -given Toolbox = Toolbox.make(getClass.getClassLoader) +given Compiler = Compiler.make(getClass.getClassLoader) val f: Array[Int] => Int = run { val stagedSum: Expr[Array[Int] => Int] = '{ (arr: Array[Int]) => 6 } diff --git a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/main/scala/hello/Hello.scala b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/main/scala/hello/Hello.scala index 058c42510c28..04aba1299ebc 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/main/scala/hello/Hello.scala +++ b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/main/scala/hello/Hello.scala @@ -2,11 +2,11 @@ package hello // Import `Expr` and some extension methods import scala.quoted._ -import scala.quoted.staging.{run, Toolbox} +import scala.quoted.staging.{run, Compiler} object Main { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = { diff --git a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/test/scala/hello/Tests.scala b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/test/scala/hello/Tests.scala index dd5c1defffa0..d971200990b8 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/test/scala/hello/Tests.scala +++ b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/test/scala/hello/Tests.scala @@ -4,10 +4,11 @@ import org.junit.Test // Import Expr and some extension methods import scala.quoted._ +import scala.quoted.staging._ class Tests { - implicit val toolbox: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) @Test def test(): Unit = { import hello.Main._ diff --git a/staging/src/scala/quoted/staging/Toolbox.scala b/staging/src/scala/quoted/staging/Compiler.scala similarity index 75% rename from staging/src/scala/quoted/staging/Toolbox.scala rename to staging/src/scala/quoted/staging/Compiler.scala index b3071c149557..c9abe3fa75c3 100644 --- a/staging/src/scala/quoted/staging/Toolbox.scala +++ b/staging/src/scala/quoted/staging/Compiler.scala @@ -5,26 +5,26 @@ import scala.annotation.implicitNotFound import scala.quoted.runtime.impl.ScopeException -@implicitNotFound("Could not find implicit scala.quoted.staging.Toolbox.\n\nDefault toolbox can be instantiated with:\n `given scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(getClass.getClassLoader)`\n\n") -trait Toolbox: +@implicitNotFound("Could not find implicit scala.quoted.staging.Compiler.\n\nDefault compiler can be instantiated with:\n `import scala.quoted.staging.Compiler; given Compiler = Compiler.make(getClass.getClassLoader)`\n\n") +trait Compiler: def run[T](expr: Quotes => Expr[T]): T -object Toolbox: +object Compiler: - /** Create a new instance of the toolbox using the the classloader of the application. + /** Create a new instance of the compiler using the the classloader of the application. * * Usuage: * ``` * import scala.quoted.staging._ - * given Toolbox = Toolbox.make(getClass.getClassLoader) + * given Compiler = Compiler.make(getClass.getClassLoader) * ``` * * @param appClassloader classloader of the application that generated the quotes - * @param settings toolbox settings - * @return A new instance of the toolbox + * @param settings compiler settings + * @return A new instance of the compiler */ - def make(appClassloader: ClassLoader)(implicit settings: Settings): Toolbox = - new Toolbox: + def make(appClassloader: ClassLoader)(implicit settings: Settings): Compiler = + new Compiler: private[this] val driver: QuoteDriver = new QuoteDriver(appClassloader) @@ -43,14 +43,14 @@ object Toolbox: end new - /** Setting of the Toolbox instance. */ + /** Setting of the Compiler instance. */ case class Settings private (outDir: Option[String], compilerArgs: List[String]) object Settings: implicit def default: Settings = make() - /** Make toolbox settings + /** Make compiler settings * @param outDir Output directory for the compiled quote. If set to None the output will be in memory * @param compilerArgs Compiler arguments. Use only if you know what you are doing. */ @@ -62,4 +62,4 @@ object Toolbox: end Settings -end Toolbox +end Compiler diff --git a/staging/src/scala/quoted/staging/QuoteDriver.scala b/staging/src/scala/quoted/staging/QuoteDriver.scala index 9bfb4dbdd287..5d12d6ab5c26 100644 --- a/staging/src/scala/quoted/staging/QuoteDriver.scala +++ b/staging/src/scala/quoted/staging/QuoteDriver.scala @@ -9,7 +9,7 @@ import dotty.tools.repl.AbstractFileClassLoader import dotty.tools.dotc.reporting._ import dotty.tools.dotc.util.ClasspathFromClassloader import scala.quoted._ -import scala.quoted.staging.Toolbox +import scala.quoted.staging.Compiler import java.io.File import scala.annotation.tailrec @@ -22,7 +22,7 @@ private class QuoteDriver(appClassloader: ClassLoader) extends Driver: private[this] val contextBase: ContextBase = new ContextBase - def run[T](exprBuilder: Quotes => Expr[T], settings: Toolbox.Settings): T = + def run[T](exprBuilder: Quotes => Expr[T], settings: Compiler.Settings): T = val outDir: AbstractFile = settings.outDir match case Some(out) => @@ -34,7 +34,7 @@ private class QuoteDriver(appClassloader: ClassLoader) extends Driver: end outDir val (_, ctx0: Context) = setup(settings.compilerArgs.toArray :+ "dummy.scala", initCtx.fresh) - val ctx = setToolboxSettings(ctx0.fresh.setSetting(ctx0.settings.outputDir, outDir), settings) + val ctx = setCompilerSettings(ctx0.fresh.setSetting(ctx0.settings.outputDir, outDir), settings) new QuoteCompiler().newRun(ctx).compileExpr(exprBuilder) match case Right(value) => @@ -59,7 +59,7 @@ private class QuoteDriver(appClassloader: ClassLoader) extends Driver: ictx.settings.classpath.update(ClasspathFromClassloader(appClassloader))(using ictx) ictx - private def setToolboxSettings(ctx: FreshContext, settings: Toolbox.Settings): ctx.type = + private def setCompilerSettings(ctx: FreshContext, settings: Compiler.Settings): ctx.type = // An error in the generated code is a bug in the compiler // Setting the throwing reporter however will report any exception ctx.setReporter(new ThrowingReporter(ctx.reporter)) diff --git a/staging/src/scala/quoted/staging/staging.scala b/staging/src/scala/quoted/staging/staging.scala index 6af9184170f3..78bcb1c93094 100644 --- a/staging/src/scala/quoted/staging/staging.scala +++ b/staging/src/scala/quoted/staging/staging.scala @@ -16,7 +16,7 @@ package object staging: * This method should not be called in a context where there is already has a `Quotes` * such as within a `run` or a `withQuotes`. */ - def run[T](expr: Quotes ?=> Expr[T])(using toolbox: Toolbox): T = toolbox.run(expr(using _)) + def run[T](expr: Quotes ?=> Expr[T])(using compiler: Compiler): T = compiler.run(expr(using _)) /** Provide a new quote context within the scope of the argument that is only valid within the scope the argument. * Return the result of the argument. @@ -32,15 +32,15 @@ package object staging: * This method should not be called in a context where there is already has a `Quotes` * such as within a `run` or a `withQuotes`. */ - def withQuotes[T](thunk: Quotes ?=> T)(using toolbox: Toolbox): T = + def withQuotes[T](thunk: Quotes ?=> T)(using compiler: Compiler): T = val noResult = new Object var result: T = noResult.asInstanceOf[T] def dummyRun(using Quotes): Expr[Unit] = { result = thunk '{} } - toolbox.run(dummyRun(using _)) - assert(result != noResult) // toolbox.run should have thrown an exception + compiler.run(dummyRun(using _)) + assert(result != noResult) // compiler.run should have thrown an exception result end withQuotes diff --git a/staging/test-resources/repl-staging/i6007 b/staging/test-resources/repl-staging/i6007 index e4a1bf0fb232..be9d5c0f92d6 100644 --- a/staging/test-resources/repl-staging/i6007 +++ b/staging/test-resources/repl-staging/i6007 @@ -1,7 +1,7 @@ scala> import scala.quoted._ -scala> import scala.quoted.staging._ -scala> implicit def toolbox: Toolbox = Toolbox.make(getClass.getClassLoader) -def toolbox: quoted.staging.Toolbox +scala> import quoted.staging.{Compiler => StagingCompiler, _} +scala> implicit def compiler: StagingCompiler = StagingCompiler.make(getClass.getClassLoader) +def compiler: quoted.staging.Compiler scala> def v(using Quotes) = '{ (if true then Some(1) else None).map(v => v+1) } def v(using x$1: quoted.Quotes): quoted.Expr[Option[Int]] scala> scala.quoted.staging.withQuotes(v.show) diff --git a/staging/test-resources/repl-staging/i6263 b/staging/test-resources/repl-staging/i6263 index e7c03b29015e..d765bf416785 100644 --- a/staging/test-resources/repl-staging/i6263 +++ b/staging/test-resources/repl-staging/i6263 @@ -1,7 +1,7 @@ scala> import quoted._ -scala> import quoted.staging._ -scala> implicit def toolbox: Toolbox = Toolbox.make(getClass.getClassLoader) -def toolbox: quoted.staging.Toolbox +scala> import quoted.staging.{Compiler => StagingCompiler, _} +scala> implicit def compiler: StagingCompiler = StagingCompiler.make(getClass.getClassLoader) +def compiler: quoted.staging.Compiler scala> def fn[T : Type](v : T) = println("ok") def fn[T](v: T)(implicit evidence$1: quoted.Type[T]): Unit scala> withQuotes { fn("foo") } diff --git a/tests/disabled/neg-with-compiler/quote-run-in-macro-2/quoted_1.scala b/tests/disabled/neg-with-compiler/quote-run-in-macro-2/quoted_1.scala index 67e93c47db4e..d8a0f4bbdcd5 100644 --- a/tests/disabled/neg-with-compiler/quote-run-in-macro-2/quoted_1.scala +++ b/tests/disabled/neg-with-compiler/quote-run-in-macro-2/quoted_1.scala @@ -4,7 +4,7 @@ object Macros { inline def foo(i: => Int): Int = ${ fooImpl('i) } def fooImpl(i: Expr[Int])(using Quotes): Expr[Int] = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) val y: Int = run(i) y } diff --git a/tests/disabled/run-staging/quote-macro-in-splice/quoted_2.scala b/tests/disabled/run-staging/quote-macro-in-splice/quoted_2.scala index 329e32a9c910..22b90733fe8e 100644 --- a/tests/disabled/run-staging/quote-macro-in-splice/quoted_2.scala +++ b/tests/disabled/run-staging/quote-macro-in-splice/quoted_2.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ import Macros._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val x = '{ val y = 1 diff --git a/tests/neg-staging/i5941/macro_1.scala b/tests/neg-staging/i5941/macro_1.scala index 150c3c7d5b12..451e413ac2d9 100644 --- a/tests/neg-staging/i5941/macro_1.scala +++ b/tests/neg-staging/i5941/macro_1.scala @@ -12,7 +12,7 @@ object Lens { } def impl[S: Type, T: Type](getter: Expr[S => T])(using Quotes): Expr[Lens[S, T]] = { - implicit val toolbox: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(this.getClass.getClassLoader) + implicit val toolbox: scala.quoted.staging.Compiler = scala.quoted.staging.Compiler.make(this.getClass.getClassLoader) import quotes.reflect._ import util._ // obj.copy(field = value) diff --git a/tests/neg-staging/i9692.scala b/tests/neg-staging/i9692.scala index fdb4e51bd6bb..10991b379975 100644 --- a/tests/neg-staging/i9692.scala +++ b/tests/neg-staging/i9692.scala @@ -3,8 +3,8 @@ import scala.quoted.staging._ object Test extends App { - // make available the necessary toolbox for runtime code generation - given Toolbox = Toolbox.make(getClass.getClassLoader) + // make available the necessary compiler for runtime code generation + given Compiler = Compiler.make(getClass.getClassLoader) run { val expr: Expr[Int] = '{ var x = 1; x = 2; 42 } diff --git a/tests/neg-staging/i9693.scala b/tests/neg-staging/i9693.scala index 9705bc012c41..70bc18ac8b4a 100644 --- a/tests/neg-staging/i9693.scala +++ b/tests/neg-staging/i9693.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test extends App { // make available the necessary toolbox for runtime code generation - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) run { val expr: Expr[Int] = '{ var x = 1; x = 2; 42 } 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 56038ab2b3aa..8549b2d1ad47 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 @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Macros { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) inline def foo(i: => Int): Int = ${ fooImpl('i) } def fooImpl(i: Expr[Int])(using Quotes): Expr[Int] = { val y: Int = run(i) diff --git a/tests/pos-staging/quote-0.scala b/tests/pos-staging/quote-0.scala index e999bf127a02..a772a6395999 100644 --- a/tests/pos-staging/quote-0.scala +++ b/tests/pos-staging/quote-0.scala @@ -27,7 +27,7 @@ object Macros { class Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) run { val program = '{ diff --git a/tests/pos-staging/quote-assert/quoted_2.scala b/tests/pos-staging/quote-assert/quoted_2.scala index 031518cbd960..c9c8caf4112e 100644 --- a/tests/pos-staging/quote-assert/quoted_2.scala +++ b/tests/pos-staging/quote-assert/quoted_2.scala @@ -17,6 +17,6 @@ object Test { ${ assertImpl('{x != 0}) } } - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) run(program) } diff --git a/tests/run-staging/abstract-int-quote.scala b/tests/run-staging/abstract-int-quote.scala index dbff291d8051..c3070086104b 100644 --- a/tests/run-staging/abstract-int-quote.scala +++ b/tests/run-staging/abstract-int-quote.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test: - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = def reduce[T: Type](using Quotes)(succ: Expr[T] => Expr[T], zero: Expr[T]): Expr[T] = '{ diff --git a/tests/run-staging/expr-matches.scala b/tests/run-staging/expr-matches.scala index cbfc6275108a..58eec89f2ace 100644 --- a/tests/run-staging/expr-matches.scala +++ b/tests/run-staging/expr-matches.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { assert('{1} matches '{1}) assert('{println("foo")} matches '{println("foo")}) diff --git a/tests/run-staging/i3823-b.scala b/tests/run-staging/i3823-b.scala index ce8888dae36d..5e45612bb15f 100644 --- a/tests/run-staging/i3823-b.scala +++ b/tests/run-staging/i3823-b.scala @@ -1,7 +1,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { def f[T](x: Expr[T])(implicit t: Type[T]) = '{ val z: t.Underlying = $x diff --git a/tests/run-staging/i3823-c.scala b/tests/run-staging/i3823-c.scala index 1bdfacadcfc4..bc60ed26ce8e 100644 --- a/tests/run-staging/i3823-c.scala +++ b/tests/run-staging/i3823-c.scala @@ -1,7 +1,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { def f[T](x: Expr[T])(implicit t: Type[T]) = '{ val z = $x diff --git a/tests/run-staging/i3823.scala b/tests/run-staging/i3823.scala index 0ef706539da1..67c96f3f6637 100644 --- a/tests/run-staging/i3823.scala +++ b/tests/run-staging/i3823.scala @@ -1,7 +1,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { def f[T](x: Expr[T])(using t: Type[T]) = '{ val z: t.Underlying = $x diff --git a/tests/run-staging/i3847-b.scala b/tests/run-staging/i3847-b.scala index c25b31e36866..089927bb7c5b 100644 --- a/tests/run-staging/i3847-b.scala +++ b/tests/run-staging/i3847-b.scala @@ -14,7 +14,7 @@ object Arrays { } object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { import Arrays._ implicit val ct: Expr[ClassTag[Int]] = '{ClassTag.Int} diff --git a/tests/run-staging/i3847.scala b/tests/run-staging/i3847.scala index 8d15d1d8d895..5c7c17decb9e 100644 --- a/tests/run-staging/i3847.scala +++ b/tests/run-staging/i3847.scala @@ -14,7 +14,7 @@ object Arrays { } object Test { - implicit val toolbox: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(this.getClass.getClassLoader) + implicit val toolbox: scala.quoted.staging.Compiler = scala.quoted.staging.Compiler.make(this.getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { import Arrays._ implicit val ct: Expr[ClassTag[Int]] = '{ClassTag.Int} diff --git a/tests/run-staging/i3876-b.scala b/tests/run-staging/i3876-b.scala index 50356d509ccb..c37026de4a31 100644 --- a/tests/run-staging/i3876-b.scala +++ b/tests/run-staging/i3876-b.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def x(using Quotes): Expr[Int] = '{3} diff --git a/tests/run-staging/i3876-c.scala b/tests/run-staging/i3876-c.scala index 62df7fd9b5a1..9995817303cc 100644 --- a/tests/run-staging/i3876-c.scala +++ b/tests/run-staging/i3876-c.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - implicit def toolbox: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(getClass.getClassLoader) + implicit def toolbox: scala.quoted.staging.Compiler = scala.quoted.staging.Compiler.make(getClass.getClassLoader) def x(using Quotes): Expr[Int] = '{3} diff --git a/tests/run-staging/i3876-d.scala b/tests/run-staging/i3876-d.scala index a7da39bf670f..87c9394f4e11 100644 --- a/tests/run-staging/i3876-d.scala +++ b/tests/run-staging/i3876-d.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def x(using Quotes): Expr[Int] = '{3} diff --git a/tests/run-staging/i3876-e.scala b/tests/run-staging/i3876-e.scala index 369044ea61eb..f9195a89c633 100644 --- a/tests/run-staging/i3876-e.scala +++ b/tests/run-staging/i3876-e.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def x(using Quotes): Expr[Int] = '{ println(); 3 } diff --git a/tests/run-staging/i3876.scala b/tests/run-staging/i3876.scala index 92a91d20fb24..0b3c4fdf7229 100644 --- a/tests/run-staging/i3876.scala +++ b/tests/run-staging/i3876.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def x(using Quotes): Expr[Int] = '{3} diff --git a/tests/run-staging/i3946.scala b/tests/run-staging/i3946.scala index 79c80bad6666..768a22eb8a27 100644 --- a/tests/run-staging/i3946.scala +++ b/tests/run-staging/i3946.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def u(using Quotes): Expr[Unit] = '{} println(withQuotes(u.show)) println(run(u)) diff --git a/tests/run-staging/i3947.scala b/tests/run-staging/i3947.scala index 4e65cdcfe2ae..18dbde6803f8 100644 --- a/tests/run-staging/i3947.scala +++ b/tests/run-staging/i3947.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) diff --git a/tests/run-staging/i3947b.scala b/tests/run-staging/i3947b.scala index 68dcd0ea85da..4692f98cd825 100644 --- a/tests/run-staging/i3947b.scala +++ b/tests/run-staging/i3947b.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { diff --git a/tests/run-staging/i3947b2.scala b/tests/run-staging/i3947b2.scala index 375bdabe2a2c..aae1e363e325 100644 --- a/tests/run-staging/i3947b2.scala +++ b/tests/run-staging/i3947b2.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: Quotes ?=> java.lang.Class[T]) = { diff --git a/tests/run-staging/i3947b3.scala b/tests/run-staging/i3947b3.scala index 92a2e89e0628..ff69aeb5fd91 100644 --- a/tests/run-staging/i3947b3.scala +++ b/tests/run-staging/i3947b3.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { diff --git a/tests/run-staging/i3947c.scala b/tests/run-staging/i3947c.scala index f63890177c43..5d676d784afc 100644 --- a/tests/run-staging/i3947c.scala +++ b/tests/run-staging/i3947c.scala @@ -3,7 +3,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { diff --git a/tests/run-staging/i3947d.scala b/tests/run-staging/i3947d.scala index 3b44a5126b3f..e9bb565a3394 100644 --- a/tests/run-staging/i3947d.scala +++ b/tests/run-staging/i3947d.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { diff --git a/tests/run-staging/i3947d2.scala b/tests/run-staging/i3947d2.scala index cc9e2a3839de..9ad505021ddb 100644 --- a/tests/run-staging/i3947d2.scala +++ b/tests/run-staging/i3947d2.scala @@ -3,7 +3,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { diff --git a/tests/run-staging/i3947e.scala b/tests/run-staging/i3947e.scala index def71f6b51e9..9e9c79858f56 100644 --- a/tests/run-staging/i3947e.scala +++ b/tests/run-staging/i3947e.scala @@ -3,7 +3,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { diff --git a/tests/run-staging/i3947f.scala b/tests/run-staging/i3947f.scala index 048d6d296404..8f5853f5dabe 100644 --- a/tests/run-staging/i3947f.scala +++ b/tests/run-staging/i3947f.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { diff --git a/tests/run-staging/i3947g.scala b/tests/run-staging/i3947g.scala index 89d1d32c5c9a..2f0fb441976d 100644 --- a/tests/run-staging/i3947g.scala +++ b/tests/run-staging/i3947g.scala @@ -3,7 +3,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) diff --git a/tests/run-staging/i3947i.scala b/tests/run-staging/i3947i.scala index 698b91b8b21b..c44ca7813220 100644 --- a/tests/run-staging/i3947i.scala +++ b/tests/run-staging/i3947i.scala @@ -3,7 +3,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { diff --git a/tests/run-staging/i3947j.scala b/tests/run-staging/i3947j.scala index ea6dae78d9a3..ba2c1010acaa 100644 --- a/tests/run-staging/i3947j.scala +++ b/tests/run-staging/i3947j.scala @@ -3,7 +3,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { diff --git a/tests/run-staging/i4044a.scala b/tests/run-staging/i4044a.scala index 200f7ce9d243..fffb3f582d6c 100644 --- a/tests/run-staging/i4044a.scala +++ b/tests/run-staging/i4044a.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ class Foo { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def foo: Unit = withQuotes { val e: Expr[Int] = '{3} val q = '{ ${ '{ $e } } } diff --git a/tests/run-staging/i4044b.scala b/tests/run-staging/i4044b.scala index c7917a36fe53..562d74c5c6ba 100644 --- a/tests/run-staging/i4044b.scala +++ b/tests/run-staging/i4044b.scala @@ -20,7 +20,7 @@ object VarRef { } object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val q = VarRef('{4})(varRef => '{ ${varRef.update('{3})}; ${varRef.expr} }) println(q.show) diff --git a/tests/run-staging/i4044c.scala b/tests/run-staging/i4044c.scala index 3ce5effae154..1346e3b97b01 100644 --- a/tests/run-staging/i4044c.scala +++ b/tests/run-staging/i4044c.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ class Foo { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def foo: Unit = withQuotes { val q = '{ ${ '{ ${ '{ 5 } } } } } println(q.show) diff --git a/tests/run-staging/i4044d.scala b/tests/run-staging/i4044d.scala index dcae3d15e107..f3a7c6e6bebb 100644 --- a/tests/run-staging/i4044d.scala +++ b/tests/run-staging/i4044d.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ class Foo { def foo: Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) run { val a: Expr[Int] = '{3} val q: Expr[Int] = '{ diff --git a/tests/run-staging/i4044e.scala b/tests/run-staging/i4044e.scala index 0f83cd1f8b07..96b13eec7470 100644 --- a/tests/run-staging/i4044e.scala +++ b/tests/run-staging/i4044e.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ class Foo { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def foo: Unit = withQuotes { val e: Expr[Int] = '{3} val f: Expr[Int] = '{5} diff --git a/tests/run-staging/i4044f.scala b/tests/run-staging/i4044f.scala index 72691c19cd4a..1107428a3074 100644 --- a/tests/run-staging/i4044f.scala +++ b/tests/run-staging/i4044f.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ class Foo { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def foo: Unit = withQuotes { val e: Expr[Int] = '{3} val f: Expr[Int] = '{5} diff --git a/tests/run-staging/i4350.scala b/tests/run-staging/i4350.scala index 314e0c4f49ad..3065042b3e49 100644 --- a/tests/run-staging/i4350.scala +++ b/tests/run-staging/i4350.scala @@ -7,7 +7,7 @@ class Foo[T: Type] { } object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { println((new Foo[Object]).q.show) println((new Foo[String]).q.show) diff --git a/tests/run-staging/i4591.scala b/tests/run-staging/i4591.scala index 7ad91b8afeb5..9b31015ae82d 100644 --- a/tests/run-staging/i4591.scala +++ b/tests/run-staging/i4591.scala @@ -9,7 +9,7 @@ object Test { } def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) run(foo('{Option(9)})) } diff --git a/tests/run-staging/i4730.scala b/tests/run-staging/i4730.scala index 2b889270681b..66583a31969c 100644 --- a/tests/run-staging/i4730.scala +++ b/tests/run-staging/i4730.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def ret(using Quotes): Expr[Int => Int] = '{ (x: Int) => ${ val z = run('{x + 1}) // throws scala.quoted.runtime.impl.ScopeException => @@ -16,7 +16,7 @@ object Test { package scala { package mytest { - def myTest()(using Toolbox) = { + def myTest()(using Compiler) = { try { run(Test.ret).apply(10) throw new Exception diff --git a/tests/run-staging/i5144.scala b/tests/run-staging/i5144.scala index a8cb4ce5a771..b1dc4ac6feef 100644 --- a/tests/run-staging/i5144.scala +++ b/tests/run-staging/i5144.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def eval1(ff: Expr[Int => Int])(using Quotes): Expr[Int] = '{$ff(42)} def peval1()(using Quotes): Expr[Unit] = '{ diff --git a/tests/run-staging/i5144b.scala b/tests/run-staging/i5144b.scala index 6ab808ec6894..056b19c33b46 100644 --- a/tests/run-staging/i5144b.scala +++ b/tests/run-staging/i5144b.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def eval1(ff: Expr[Int => Int])(using Quotes): Expr[Int] = Expr.betaReduce('{ $ff(42) }) diff --git a/tests/run-staging/i5152.scala b/tests/run-staging/i5152.scala index f745ea5865c1..e89eed3b4e04 100644 --- a/tests/run-staging/i5152.scala +++ b/tests/run-staging/i5152.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def eval1(ff: Expr[Int => Int])(using Quotes): Expr[Int => Int] = '{identity} def peval1()(using Quotes): Expr[Unit] = '{ diff --git a/tests/run-staging/i5161.scala b/tests/run-staging/i5161.scala index e7ec50e72aed..1851a0200466 100644 --- a/tests/run-staging/i5161.scala +++ b/tests/run-staging/i5161.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) enum Exp { case Int2(x: Int) diff --git a/tests/run-staging/i5161b.scala b/tests/run-staging/i5161b.scala index e11f5e4255c2..8777b90ed27f 100644 --- a/tests/run-staging/i5161b.scala +++ b/tests/run-staging/i5161b.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = { def res(using Quotes) = '{ diff --git a/tests/run-staging/i5247.scala b/tests/run-staging/i5247.scala index c406a404d022..86c27af39c8d 100644 --- a/tests/run-staging/i5247.scala +++ b/tests/run-staging/i5247.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { println(foo[Object].show) println(bar[Object].show) diff --git a/tests/run-staging/i5376.scala b/tests/run-staging/i5376.scala index bca4ac5a2daa..be6ea755857a 100644 --- a/tests/run-staging/i5376.scala +++ b/tests/run-staging/i5376.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { var e = '{1} diff --git a/tests/run-staging/i5434.scala b/tests/run-staging/i5434.scala index 700474080055..199392390f93 100644 --- a/tests/run-staging/i5434.scala +++ b/tests/run-staging/i5434.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = { diff --git a/tests/run-staging/i5965.scala b/tests/run-staging/i5965.scala index 866aedfb1c7b..b77246fe7853 100644 --- a/tests/run-staging/i5965.scala +++ b/tests/run-staging/i5965.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = { withQuotes(Type.of[List]) diff --git a/tests/run-staging/i5965b.scala b/tests/run-staging/i5965b.scala index 1cc64ca1a797..ddf9f4226c2d 100644 --- a/tests/run-staging/i5965b.scala +++ b/tests/run-staging/i5965b.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) withQuotes(Type.of[List]) def list(using Quotes) = bound('{List(1, 2, 3)}) diff --git a/tests/run-staging/i5997.scala b/tests/run-staging/i5997.scala index d07c94490f94..faf5675aac15 100644 --- a/tests/run-staging/i5997.scala +++ b/tests/run-staging/i5997.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val v = '{ (if true then Some(1) else None).map(v => v+1) } println(v.show) diff --git a/tests/run-staging/i6263.scala b/tests/run-staging/i6263.scala index e8bac932fb0a..5b69b12b7660 100644 --- a/tests/run-staging/i6263.scala +++ b/tests/run-staging/i6263.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { fn("foo") diff --git a/tests/run-staging/i6281.scala b/tests/run-staging/i6281.scala index 1828249e8e94..92a14c21536a 100644 --- a/tests/run-staging/i6281.scala +++ b/tests/run-staging/i6281.scala @@ -37,7 +37,7 @@ object Test extends App { def m(using Quotes): STM[Int, RS] = k => k('{42}) - implicit val toolbox: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(getClass.getClassLoader) + implicit val toolbox: scala.quoted.staging.Compiler = scala.quoted.staging.Compiler.make(getClass.getClassLoader) withQuotes { println(Effects[RS].reify[Int] { m }.show) diff --git a/tests/run-staging/i6754.scala b/tests/run-staging/i6754.scala index c3ce89138dc2..686c402d516b 100644 --- a/tests/run-staging/i6754.scala +++ b/tests/run-staging/i6754.scala @@ -9,7 +9,7 @@ object Test { package scala { object MyTest { - implicit val tbx: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(getClass.getClassLoader) + implicit val tbx: scala.quoted.staging.Compiler = scala.quoted.staging.Compiler.make(getClass.getClassLoader) def myTest() = { def y(using Quotes): Expr[Unit] = '{ diff --git a/tests/run-staging/i6992/Macro_1.scala b/tests/run-staging/i6992/Macro_1.scala index a7d766424695..b03cf874f19b 100644 --- a/tests/run-staging/i6992/Macro_1.scala +++ b/tests/run-staging/i6992/Macro_1.scala @@ -16,7 +16,7 @@ package scala { object MyTest { import macros._ - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def mcrImpl(body: Expr[Any])(using ctx: Quotes): Expr[Any] = { import ctx.reflect._ diff --git a/tests/run-staging/i7142.scala b/tests/run-staging/i7142.scala index 295dd3376ce8..a8323e8a2668 100644 --- a/tests/run-staging/i7142.scala +++ b/tests/run-staging/i7142.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ import scala.util.control.NonLocalReturns._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = try run {returning('{ { (x: Int) => ${ throwReturn('x) }} apply 0 })} catch { diff --git a/tests/run-staging/i7381.scala b/tests/run-staging/i7381.scala index 239158ca94b8..d84fb72c858d 100644 --- a/tests/run-staging/i7381.scala +++ b/tests/run-staging/i7381.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) withQuotes { val expr = Expr(List(1, 2, 3)) println(expr.show) diff --git a/tests/run-staging/i7897.scala b/tests/run-staging/i7897.scala index e96f8adf737e..2b0952971761 100644 --- a/tests/run-staging/i7897.scala +++ b/tests/run-staging/i7897.scala @@ -1,7 +1,7 @@ import scala.quoted._, staging._ object Test: - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) val f: Array[Int] => Int = run { val stagedSum: Expr[Array[Int] => Int] = '{ (arr: Array[Int]) => 6 } diff --git a/tests/run-staging/i8178.scala b/tests/run-staging/i8178.scala index b5537053a6e4..c0aeb545bad2 100644 --- a/tests/run-staging/i8178.scala +++ b/tests/run-staging/i8178.scala @@ -8,7 +8,7 @@ def foo(n: Int, t: Expr[Int])(using Quotes): Expr[Int] = object Test: def main(args: Array[String]) = { // make available the necessary toolbox for runtime code generation - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) val f: Int = run { foo(2, Expr(5)) } diff --git a/tests/run-staging/i8585.scala b/tests/run-staging/i8585.scala index 814fe10824a7..e525e056a336 100644 --- a/tests/run-staging/i8585.scala +++ b/tests/run-staging/i8585.scala @@ -1,8 +1,8 @@ import scala.quoted._ -import scala.quoted.staging.{run, withQuotes, Toolbox} +import scala.quoted.staging.{run, withQuotes, Compiler} object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = { val toTheEighth = stagedPower(8) diff --git a/tests/run-staging/inline-at-level-2.scala b/tests/run-staging/inline-at-level-2.scala index 5ec622a66768..9d0689296032 100644 --- a/tests/run-staging/inline-at-level-2.scala +++ b/tests/run-staging/inline-at-level-2.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { '{ diff --git a/tests/run-staging/inline-quote.scala b/tests/run-staging/inline-quote.scala index 9b8c794b363f..0af500dafebe 100644 --- a/tests/run-staging/inline-quote.scala +++ b/tests/run-staging/inline-quote.scala @@ -8,7 +8,7 @@ object Test { $x } - implicit val toolbox: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val y = '{45} diff --git a/tests/run-staging/liftables.scala b/tests/run-staging/liftables.scala index df5c62d4ec25..758333946ced 100644 --- a/tests/run-staging/liftables.scala +++ b/tests/run-staging/liftables.scala @@ -1,7 +1,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { println(Expr(true).show) println(Expr(false).show) diff --git a/tests/run-staging/multi-staging.scala b/tests/run-staging/multi-staging.scala index fb60e07d0de5..e94e6b84f434 100644 --- a/tests/run-staging/multi-staging.scala +++ b/tests/run-staging/multi-staging.scala @@ -5,11 +5,11 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = val s1: Quotes ?=> Expr[Int] = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) run[Quotes ?=> Expr[Int]] { stage1('{2}) } } { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) println(run(s1)) } def stage1(x: Expr[Int])(using Quotes): Expr[Quotes ?=> Expr[Int]] = diff --git a/tests/run-staging/quote-ackermann-1.scala b/tests/run-staging/quote-ackermann-1.scala index c167e0f77d29..f0f1d5891087 100644 --- a/tests/run-staging/quote-ackermann-1.scala +++ b/tests/run-staging/quote-ackermann-1.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) val ack3 = run { ackermann(3) } println(ack3(1)) println(ack3(2)) diff --git a/tests/run-staging/quote-fun-app-1.scala b/tests/run-staging/quote-fun-app-1.scala index c2c1848901ec..2f92275a6ccc 100644 --- a/tests/run-staging/quote-fun-app-1.scala +++ b/tests/run-staging/quote-fun-app-1.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) val f = run { f1 } diff --git a/tests/run-staging/quote-function-applied-to.scala b/tests/run-staging/quote-function-applied-to.scala index 839698fac195..ddbc472e3b2d 100644 --- a/tests/run-staging/quote-function-applied-to.scala +++ b/tests/run-staging/quote-function-applied-to.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def show(expr: Quotes ?=> Expr[_]): String = withQuotes(expr.show) println(show(Expr.betaReduce('{ (() => x(0))() }))) println(show(Expr.betaReduce('{ ((x1: Int) => x1)(x(1)) }))) diff --git a/tests/run-staging/quote-lambda.scala b/tests/run-staging/quote-lambda.scala index 6dc04547e74c..216be6f9f027 100644 --- a/tests/run-staging/quote-lambda.scala +++ b/tests/run-staging/quote-lambda.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { '{ (x: Int) => ${'x} } } diff --git a/tests/run-staging/quote-lib.scala b/tests/run-staging/quote-lib.scala index 042fa58c17c7..527adaa21958 100644 --- a/tests/run-staging/quote-lib.scala +++ b/tests/run-staging/quote-lib.scala @@ -9,7 +9,7 @@ import liftable.Lists._ import liftable.Exprs._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val liftedUnit: Expr[Unit] = '{} diff --git a/tests/run-staging/quote-lift-Array.scala b/tests/run-staging/quote-lift-Array.scala index 6e61e67ce6d0..6fd9f7c82416 100644 --- a/tests/run-staging/quote-lift-Array.scala +++ b/tests/run-staging/quote-lift-Array.scala @@ -1,7 +1,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - implicit val toolbox: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(getClass.getClassLoader) + implicit val toolbox: scala.quoted.staging.Compiler = scala.quoted.staging.Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { '{ def p[T](arr: Array[T]): Unit = { diff --git a/tests/run-staging/quote-lift-BigDecimal.scala b/tests/run-staging/quote-lift-BigDecimal.scala index 7f94418535ec..8f3cff7f8494 100644 --- a/tests/run-staging/quote-lift-BigDecimal.scala +++ b/tests/run-staging/quote-lift-BigDecimal.scala @@ -1,7 +1,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = println(run { val a = Expr(BigDecimal(2.3)) val b = Expr(BigDecimal("1005849025843905834908593485984390583429058574925.95489543")) diff --git a/tests/run-staging/quote-lift-BigInt.scala b/tests/run-staging/quote-lift-BigInt.scala index cb35d779cd97..607828798c9a 100644 --- a/tests/run-staging/quote-lift-BigInt.scala +++ b/tests/run-staging/quote-lift-BigInt.scala @@ -1,7 +1,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = println(run { val a = Expr(BigInt(2)) val b = Expr(BigInt("1005849025843905834908593485984390583429058574925")) diff --git a/tests/run-staging/quote-lift-IArray.scala b/tests/run-staging/quote-lift-IArray.scala index 28a8d96fc876..2733a7e12fc8 100644 --- a/tests/run-staging/quote-lift-IArray.scala +++ b/tests/run-staging/quote-lift-IArray.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - implicit val toolbox: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { '{ def p[T](arr: IArray[T]): Unit = { diff --git a/tests/run-staging/quote-nested-1.scala b/tests/run-staging/quote-nested-1.scala index 00985deebf0f..222247b55290 100644 --- a/tests/run-staging/quote-nested-1.scala +++ b/tests/run-staging/quote-nested-1.scala @@ -2,7 +2,7 @@ import quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val q = '{ (q: Quotes) ?=> '{3} } println(q.show) diff --git a/tests/run-staging/quote-nested-2.scala b/tests/run-staging/quote-nested-2.scala index f8277f849613..6616dada2577 100644 --- a/tests/run-staging/quote-nested-2.scala +++ b/tests/run-staging/quote-nested-2.scala @@ -2,7 +2,7 @@ import quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val q = '{(q: Quotes) ?=> diff --git a/tests/run-staging/quote-nested-3.scala b/tests/run-staging/quote-nested-3.scala index e4aa0c757704..d07489199a21 100644 --- a/tests/run-staging/quote-nested-3.scala +++ b/tests/run-staging/quote-nested-3.scala @@ -2,7 +2,7 @@ import quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val q = '{ diff --git a/tests/run-staging/quote-nested-4.scala b/tests/run-staging/quote-nested-4.scala index 2c80fdf3acad..ae1457592c0f 100644 --- a/tests/run-staging/quote-nested-4.scala +++ b/tests/run-staging/quote-nested-4.scala @@ -2,7 +2,7 @@ import quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val q = '{ (q: Quotes) ?=> diff --git a/tests/run-staging/quote-nested-5.scala b/tests/run-staging/quote-nested-5.scala index 2c6152154535..4a807b403e4b 100644 --- a/tests/run-staging/quote-nested-5.scala +++ b/tests/run-staging/quote-nested-5.scala @@ -2,7 +2,7 @@ import quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val q = '{(q: Quotes) ?=> diff --git a/tests/run-staging/quote-nested-6.scala b/tests/run-staging/quote-nested-6.scala index a482495f9923..d7599a2dbf7d 100644 --- a/tests/run-staging/quote-nested-6.scala +++ b/tests/run-staging/quote-nested-6.scala @@ -2,7 +2,7 @@ import quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val q = '{ diff --git a/tests/run-staging/quote-owners-2.scala b/tests/run-staging/quote-owners-2.scala index 7eccb14a3ddb..4d51093c9efd 100644 --- a/tests/run-staging/quote-owners-2.scala +++ b/tests/run-staging/quote-owners-2.scala @@ -3,7 +3,7 @@ import quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { val q = f(g(Type.of[Int])) println(q.show) diff --git a/tests/run-staging/quote-owners.scala b/tests/run-staging/quote-owners.scala index ae235c32574f..b012c5084d0d 100644 --- a/tests/run-staging/quote-owners.scala +++ b/tests/run-staging/quote-owners.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def q(using Quotes) = f println(run(q)) println(withQuotes(q.show)) diff --git a/tests/run-staging/quote-run-2.scala b/tests/run-staging/quote-run-2.scala index 763bfb38c865..480972336de9 100644 --- a/tests/run-staging/quote-run-2.scala +++ b/tests/run-staging/quote-run-2.scala @@ -3,7 +3,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { def powerCode(n: Int, x: Expr[Double]): Expr[Double] = if (n == 0) '{1.0} diff --git a/tests/run-staging/quote-run-b.scala b/tests/run-staging/quote-run-b.scala index efed8e9d0b65..b4e0a4dd8913 100644 --- a/tests/run-staging/quote-run-b.scala +++ b/tests/run-staging/quote-run-b.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def lambdaExpr(using Quotes) = '{ (x: Int) => println("lambda(" + x + ")") } diff --git a/tests/run-staging/quote-run-c.scala b/tests/run-staging/quote-run-c.scala index b031c9d6e2d4..4ac8b9121a43 100644 --- a/tests/run-staging/quote-run-c.scala +++ b/tests/run-staging/quote-run-c.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def classExpr(using Quotes) = '{ class A { override def toString: String = "Foo" diff --git a/tests/run-staging/quote-run-constants.scala b/tests/run-staging/quote-run-constants.scala index 4e30760cd683..f73d24721054 100644 --- a/tests/run-staging/quote-run-constants.scala +++ b/tests/run-staging/quote-run-constants.scala @@ -5,7 +5,7 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def runAndPrint[T](expr: Quotes ?=> Expr[T]): Unit = println(run(expr)) runAndPrint(Expr(true)) diff --git a/tests/run-staging/quote-run-large.scala b/tests/run-staging/quote-run-large.scala index a03d2b889440..a6943da60a5f 100644 --- a/tests/run-staging/quote-run-large.scala +++ b/tests/run-staging/quote-run-large.scala @@ -60,7 +60,7 @@ object Test { new Foo(5) } - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) withQuotes { a.show // Force unpiclking of the expression diff --git a/tests/run-staging/quote-run-many.scala b/tests/run-staging/quote-run-many.scala index 68305fbb42a7..0896e0e3ba8f 100644 --- a/tests/run-staging/quote-run-many.scala +++ b/tests/run-staging/quote-run-many.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def expr(i: Int)(using Quotes) = '{ val a = 3 + ${Expr(i)} 2 + a diff --git a/tests/run-staging/quote-run-staged-interpreter.scala b/tests/run-staging/quote-run-staged-interpreter.scala index ea45cb8ae3c8..d31b617a905d 100644 --- a/tests/run-staging/quote-run-staged-interpreter.scala +++ b/tests/run-staging/quote-run-staged-interpreter.scala @@ -27,7 +27,7 @@ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) val exp = Plus(Plus(Num(2), Var("x")), Num(4)) val letExp = Let("x", Num(3), exp) diff --git a/tests/run-staging/quote-run-with-settings.scala b/tests/run-staging/quote-run-with-settings.scala index a0d54db942e4..380613d1c34f 100644 --- a/tests/run-staging/quote-run-with-settings.scala +++ b/tests/run-staging/quote-run-with-settings.scala @@ -6,7 +6,7 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def expr(using Quotes) = '{ val a = 3 println("foo") @@ -22,8 +22,8 @@ object Test { Files.deleteIfExists(classFile) { - implicit val settings = Toolbox.Settings.make(outDir = Some(outDir.toString)) - implicit val toolbox2: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(getClass.getClassLoader) + implicit val settings = Compiler.Settings.make(outDir = Some(outDir.toString)) + implicit val toolbox2: scala.quoted.staging.Compiler = scala.quoted.staging.Compiler.make(getClass.getClassLoader) println(run(expr)) assert(Files.exists(classFile)) } diff --git a/tests/run-staging/quote-run.scala b/tests/run-staging/quote-run.scala index f0b543cfee47..7368757ff7aa 100644 --- a/tests/run-staging/quote-run.scala +++ b/tests/run-staging/quote-run.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def expr(using Quotes) = '{ val a = 3 println("foo") diff --git a/tests/run-staging/quote-show-blocks.scala b/tests/run-staging/quote-show-blocks.scala index 740db59a1030..c2f44ac832e8 100644 --- a/tests/run-staging/quote-show-blocks.scala +++ b/tests/run-staging/quote-show-blocks.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def a(n: Int, x: Expr[Unit]): Expr[Unit] = if (n == 0) x diff --git a/tests/run-staging/quote-simple-hole.scala b/tests/run-staging/quote-simple-hole.scala index 6c165c8de30d..f25af11d24a0 100644 --- a/tests/run-staging/quote-simple-hole.scala +++ b/tests/run-staging/quote-simple-hole.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val x = '{0} diff --git a/tests/run-staging/quote-toExprOfTuple.scala b/tests/run-staging/quote-toExprOfTuple.scala index 004b576a3d20..5c19952f1516 100644 --- a/tests/run-staging/quote-toExprOfTuple.scala +++ b/tests/run-staging/quote-toExprOfTuple.scala @@ -3,7 +3,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = { for (n <- 0 to 25) { prev = 0 diff --git a/tests/run-staging/quote-two-captured-ref.scala b/tests/run-staging/quote-two-captured-ref.scala index c5fbd4f1b3a2..5f82b8fd71e4 100644 --- a/tests/run-staging/quote-two-captured-ref.scala +++ b/tests/run-staging/quote-two-captured-ref.scala @@ -2,7 +2,7 @@ import quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { val q = '{ val x = 1 diff --git a/tests/run-staging/quote-type-matcher.scala b/tests/run-staging/quote-type-matcher.scala index 97e2efedd34e..fb4434873486 100644 --- a/tests/run-staging/quote-type-matcher.scala +++ b/tests/run-staging/quote-type-matcher.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ import scala.reflect.ClassTag object Test { - given Toolbox = Toolbox.make(this.getClass.getClassLoader) + given Compiler = Compiler.make(this.getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { val '[List[Int]] = Type.of[List[Int]] diff --git a/tests/run-staging/quote-type-tags.scala b/tests/run-staging/quote-type-tags.scala index 72615916e15c..918f703c5133 100644 --- a/tests/run-staging/quote-type-tags.scala +++ b/tests/run-staging/quote-type-tags.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def asof[T: Type, U](x: Expr[T], t: Type[U]): Expr[U] = '{$x.asInstanceOf[t.Underlying]} diff --git a/tests/run-staging/quote-unrolled-foreach.scala b/tests/run-staging/quote-unrolled-foreach.scala index 0c66ba34fa3c..f532244b2e86 100644 --- a/tests/run-staging/quote-unrolled-foreach.scala +++ b/tests/run-staging/quote-unrolled-foreach.scala @@ -3,7 +3,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def code1(using Quotes) = '{ (arr: Array[Int], f: Int => Unit) => ${ foreach1('arr, 'f) } } println(code1.show) diff --git a/tests/run-staging/quote-valueof-list.scala b/tests/run-staging/quote-valueof-list.scala index 8ae1534188b9..87403684b2d5 100644 --- a/tests/run-staging/quote-valueof-list.scala +++ b/tests/run-staging/quote-valueof-list.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { diff --git a/tests/run-staging/quote-valueof.scala b/tests/run-staging/quote-valueof.scala index d4276228b3fc..29bf7c1631ee 100644 --- a/tests/run-staging/quote-valueof.scala +++ b/tests/run-staging/quote-valueof.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { println(('{true}).value) diff --git a/tests/run-staging/quote-var.scala b/tests/run-staging/quote-var.scala index d72408ca05e3..ebde4a7edf1c 100644 --- a/tests/run-staging/quote-var.scala +++ b/tests/run-staging/quote-var.scala @@ -31,7 +31,7 @@ object Test { } def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) val res = run { test1() } diff --git a/tests/run-staging/shonan-hmm-simple.scala b/tests/run-staging/shonan-hmm-simple.scala index 31cb274b34f2..e17c998ed65e 100644 --- a/tests/run-staging/shonan-hmm-simple.scala +++ b/tests/run-staging/shonan-hmm-simple.scala @@ -98,7 +98,7 @@ class Blas1[Idx, T](r: Ring[T], ops: VecOps[Idx, T]): object Test: - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = val arr1 = Array(0, 1, 2, 4, 8) val arr2 = Array(1, 0, 1, 0, 1) diff --git a/tests/run-staging/shonan-hmm/Test.scala b/tests/run-staging/shonan-hmm/Test.scala index 83780ab0be8e..cb909487ddb8 100644 --- a/tests/run-staging/shonan-hmm/Test.scala +++ b/tests/run-staging/shonan-hmm/Test.scala @@ -5,7 +5,7 @@ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { diff --git a/tests/run-staging/staged-streams_1.scala b/tests/run-staging/staged-streams_1.scala index a7af15f9ef6e..218918776a4c 100644 --- a/tests/run-staging/staged-streams_1.scala +++ b/tests/run-staging/staged-streams_1.scala @@ -657,7 +657,7 @@ object Test { .fold('{0}, ((a: Expr[Int], b : Expr[Int]) => '{ $a + $b })) def main(args: Array[String]): Unit = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) println(run(test1())) println println(run(test2())) diff --git a/tests/run-staging/staged-tuples/Test.scala b/tests/run-staging/staged-tuples/Test.scala index effd0f4c9d72..eff7e9f848ed 100644 --- a/tests/run-staging/staged-tuples/Test.scala +++ b/tests/run-staging/staged-tuples/Test.scala @@ -4,7 +4,7 @@ import scala.internal.StagedTuple._ object Test { def main(args: Array[String]): Unit = { - implicit val toolbox: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(getClass.getClassLoader) + implicit val toolbox: scala.quoted.staging.Compiler = scala.quoted.staging.Compiler.make(getClass.getClassLoader) assert(run(fromArrayStaged[EmptyTuple]('{ Array.empty[Object] }, Some(0))) == Tuple()) assert(run(fromArrayStaged[Tuple1[String]]('{ Array[Object]("a") }, Some(1))) == Tuple1("a")) 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 8ac1aacb46f1..d14a0490d6f4 100644 --- a/tests/run-staging/tasty-extractors-constants-2/quoted_1.scala +++ b/tests/run-staging/tasty-extractors-constants-2/quoted_1.scala @@ -6,7 +6,7 @@ object Macros { inline def testMacro: Unit = ${impl} def impl(using Quotes): Expr[Unit] = { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) // 2 is a lifted constant val show1 = withQuotes(power('{2}, '{3.0}).show) val run1 = run(power('{2}, '{3.0})) diff --git a/tests/run-staging/unliftables.scala b/tests/run-staging/unliftables.scala index 68e6137ae610..b0f6bd4e51ec 100644 --- a/tests/run-staging/unliftables.scala +++ b/tests/run-staging/unliftables.scala @@ -1,7 +1,7 @@ import scala.quoted._ import scala.quoted.staging._ object Test { - given Toolbox = Toolbox.make(getClass.getClassLoader) + given Compiler = Compiler.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuotes { println('{ true }.value) println('{ false }.value)