Skip to content

Commit fdbfbf5

Browse files
committed
wip
1 parent a440779 commit fdbfbf5

32 files changed

+48
-14
lines changed

compiler/src/dotty/tools/dotc/quoted/ToolboxSettings.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ object ToolboxSettings {
2222
): ToolboxSettings = {
2323
var compilerArgs1 = compilerArgs
2424
if (optimise) compilerArgs1 = "-optimise" :: compilerArgs1
25-
compilerArgs1 = s"-color:${if (color) "always" else "never"}" :: compilerArgs1
2625
new ToolboxSettings(outDir, rawTree, compilerArgs1)
2726
}
2827

tests/run-with-compiler/i3876-b.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {
5+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
6+
57
val x: Expr[Int] = '(3)
68

79
val f2: Expr[Int => Int] = '{

tests/run-with-compiler/i3876-c.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {
5+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
6+
57
val x: Expr[Int] = '(3)
68

79
val f3: Expr[Int => Int] = '{

tests/run-with-compiler/i3876-d.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {
5+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
6+
57
val x: Expr[Int] = '(3)
68

79
val f4: Expr[Int => Int] = '{

tests/run-with-compiler/i3876.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {
5+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
6+
57
val x: Expr[Int] = '(3)
68

79
val f: Expr[Int => Int] = '{ (x: Int) => x + x }

tests/run-with-compiler/i3946.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import dotty.tools.dotc.quoted.Toolbox._
22
import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {
5+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
6+
57
val u: Expr[Unit] = '()
68
println(u.show)
79
println(u.run)

tests/run-with-compiler/i3947.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dotty.tools.dotc.quoted.Toolbox._
55
object Test {
66

77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
89

910
def test[T](clazz: java.lang.Class[T]): Unit = {
1011
val lclazz = clazz.toExpr

tests/run-with-compiler/i3947b.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dotty.tools.dotc.quoted.Toolbox._
55
object Test {
66

77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
89

910
def test[T](clazz: java.lang.Class[T]): Unit = {
1011
val lclazz = clazz.toExpr

tests/run-with-compiler/i3947b2.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dotty.tools.dotc.quoted.Toolbox._
55
object Test {
66

77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
89

910
def test[T](clazz: java.lang.Class[T]): Unit = {
1011
val lclazz = clazz.toExpr

tests/run-with-compiler/i3947b3.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dotty.tools.dotc.quoted.Toolbox._
55
object Test {
66

77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
89

910
def test[T](clazz: java.lang.Class[T]): Unit = {
1011
val lclazz = clazz.toExpr

tests/run-with-compiler/i3947c.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dotty.tools.dotc.quoted.Toolbox._
55
object Test {
66

77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
89

910
def test[T](clazz: java.lang.Class[T]): Unit = {
1011
val lclazz = clazz.toExpr

tests/run-with-compiler/i3947d.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dotty.tools.dotc.quoted.Toolbox._
55
object Test {
66

77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
89

910
def test[T](clazz: java.lang.Class[T]): Unit = {
1011
val lclazz = clazz.toExpr

tests/run-with-compiler/i3947d2.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dotty.tools.dotc.quoted.Toolbox._
55
object Test {
66

77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
89

910
def test[T](clazz: java.lang.Class[T]): Unit = {
1011
val lclazz = clazz.toExpr

tests/run-with-compiler/i3947e.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dotty.tools.dotc.quoted.Toolbox._
55
object Test {
66

77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
89

910
def test[T](clazz: java.lang.Class[T]): Unit = {
1011
val lclazz = clazz.toExpr

tests/run-with-compiler/i3947f.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dotty.tools.dotc.quoted.Toolbox._
55
object Test {
66

77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
89

910
def test[T](clazz: java.lang.Class[T]): Unit = {
1011
val lclazz = clazz.toExpr

tests/run-with-compiler/i3947g.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dotty.tools.dotc.quoted.Toolbox._
55
object Test {
66

77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
89

910
def test[T](clazz: java.lang.Class[T]): Unit = {
1011
val lclazz = clazz.toExpr

tests/run-with-compiler/i3947i.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dotty.tools.dotc.quoted.Toolbox._
55
object Test {
66

77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
89

910
def test[T](clazz: java.lang.Class[T]): Unit = {
1011
val lclazz = clazz.toExpr

tests/run-with-compiler/i3947j.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dotty.tools.dotc.quoted.Toolbox._
55
object Test {
66

77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
89

910
def test[T](clazz: java.lang.Class[T]): Unit = {
1011
val lclazz = clazz.toExpr

tests/run-with-compiler/i4350.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class Foo[T: Type] {
88

99
object Test {
1010
def main(args: Array[String]): Unit = {
11+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
1112
println((new Foo[Object]).q.show)
1213
println((new Foo[String]).q.show)
1314
}

tests/run-with-compiler/quote-lib.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import liftable.Exprs._
1111

1212
object Test {
1313
def main(args: Array[String]): Unit = {
14+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
1415

1516
val liftedUnit: Expr[Unit] = '()
1617

tests/run-with-compiler/quote-owners-2.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import dotty.tools.dotc.quoted.Toolbox._
44

55
object Test {
66
def main(args: Array[String]): Unit = {
7+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
8+
79
val q = f(g(Type.IntTag))
810
println(q.run)
911
println(q.show)

tests/run-with-compiler/quote-owners.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import dotty.tools.dotc.quoted.Toolbox._
33

44
object Test {
55
def main(args: Array[String]): Unit = {
6+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
7+
68
val q = f
79
println(q.run)
810
println(q.show)

tests/run-with-compiler/quote-run-2.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import scala.quoted._
55

66
object Test {
77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
9+
810
def powerCode(n: Int, x: Expr[Double]): Expr[Double] =
911
if (n == 0) '(1.0)
1012
else if (n == 1) x

tests/run-with-compiler/quote-run-b.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import scala.quoted._
55

66
object Test {
77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
9+
810
val lambdaExpr = '{
911
(x: Int) => println("lambda(" + x + ")")
1012
}

tests/run-with-compiler/quote-run-c.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import scala.quoted._
55

66
object Test {
77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
9+
810
val classExpr = '{
911
class A {
1012
override def toString: String = "Foo"

tests/run-with-compiler/quote-run-constants.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import scala.quoted._
55

66
object Test {
77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
9+
810
def run[T](expr: Expr[T]): Unit = println(expr.run)
911
def show[T](expr: Expr[T]): Unit = println(expr.show)
1012

tests/run-with-compiler/quote-run-many.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@ import scala.quoted._
33
object Test {
44
def main(args: Array[String]): Unit = {
55
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
6+
67
def expr(i: Int) = '{
78
val a = 3 + ~i.toExpr
89
2 + a
910
}
10-
for (i <- 0 to 200) {
11-
val t0 = System.nanoTime()
12-
val res = expr(i).run
13-
val t = (System.nanoTime() - t0) / 1000000
14-
println(s"$i = $res in ${t}ms")
15-
}
11+
for (i <- 0 to 200)
12+
expr(i).run
1613
}
1714
}

tests/run-with-compiler/quote-run-with-settings.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import scala.quoted._
88

99
object Test {
1010
def main(args: Array[String]): Unit = {
11+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
1112
val expr = '{
1213
val a = 3
1314
println("foo")
@@ -24,6 +25,7 @@ object Test {
2425

2526
{
2627
implicit val settings = ToolboxSettings.make(optimise = true, outDir = Some(outDir.toString))
28+
implicit val toolbox2: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
2729
println(expr.run)
2830
assert(Files.exists(classFile))
2931
}

tests/run-with-compiler/quote-run.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import scala.quoted._
55

66
object Test {
77
def main(args: Array[String]): Unit = {
8+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
9+
810
val expr = '{
911
val a = 3
1012
println("foo")

tests/run-with-compiler/quote-show-blocks.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
2-
import dotty.tools.dotc.quoted.Toolbox._
3-
41
import scala.quoted._
52

63
object Test {
74
def main(args: Array[String]): Unit = {
5+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
86

97
def a(n: Int, x: Expr[Unit]): Expr[Unit] =
108
if (n == 0) x

tests/run-with-compiler/quote-two-captured-ref.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import quoted._
2-
import dotty.tools.dotc.quoted.Toolbox._
32

43
object Test {
54
def main(args: Array[String]): Unit = {
5+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
6+
67
val q = '{
78
val x = 1
89
println(~{

tests/run-with-compiler/quote-type-tags.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
2-
import dotty.tools.dotc.quoted.Toolbox._
3-
41
import scala.quoted._
52

63
object Test {
74
def main(args: Array[String]): Unit = {
5+
implicit val toolbox: scala.runtime.quoted.Toolbox = dotty.tools.dotc.quoted.Toolbox.make
6+
87
def asof[T, U](x: Expr[T], t: Type[U]): Expr[U] =
98
'((~x).asInstanceOf[~t])
109

0 commit comments

Comments
 (0)