Skip to content

Commit 10d3078

Browse files
committed
Remove scala.quoted.show.apply and use Expr.show
`scala.quoted.show.apply` was only intorduced to reduce the diff in the tests. Instead we use the equivalent `run(expr.show.toExpr)` notation explicitly. This has the added advantage of showing explicitly where new compiler runs are located.
1 parent 2a91054 commit 10d3078

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+91
-102
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
scala> implicit def toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
22
def toolbox: quoted.Toolbox
3+
scala> import scala.quoted._
34
scala> val v = '{ (if true then Some(1) else None).map(v => v+1) }
45
val v: quoted.Expr[Option[Int]] = Expr(<pickled tasty>)
5-
scala> scala.quoted.show(v)
6+
scala> scala.quoted.run(v.show.toExpr)
67
val res0: String = (if (true) scala.Some.apply[scala.Int](1) else scala.None).map[scala.Int](((v: scala.Int) => v.+(1)))
78
scala> scala.quoted.run(v)
89
val res1: Option[Int] = Some(2)

library/src/scala/quoted/show/package.scala

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/disabled/reflect/run/position-val-def.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ object Test {
1010
def test(expr: String): Unit = {
1111
val t = toolbox.parse(expr)
1212
println(expr)
13-
println(show(t, printPositions = true))
13+
println(run(t, printPositions = true.show.toExpr))
1414
println()
1515
}
1616
val tests = """

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ object Test {
55
val z: $t = $x
66
}
77
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
8-
println(show(f('{2})(Type.IntTag)))
8+
println(run(f('{2})(Type.IntTag).show.toExpr))
99
}
1010
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ object Test {
55
val z = $x
66
}
77
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
8-
println(show(f('{2})(Type.IntTag)))
8+
println(run(f('{2})(Type.IntTag).show.toExpr))
99
}
1010
}

tests/run-with-compiler/i3823.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ object Test {
55
val z: $t = $x
66
}
77
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
8-
println(show(f('{2})('[Int])))
8+
println(run(f('{2})('[Int]).show.toExpr))
99
}
1010
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ object Test {
1818
import Arrays._
1919
implicit val ct: Expr[ClassTag[Int]] = '{ClassTag.Int}
2020
val arr: Expr[Array[List[Int]]] = Array[List[Int]](List(1, 2, 3)).toExpr
21-
println(show(arr))
21+
println(run(arr.show.toExpr))
2222
}
2323
}

tests/run-with-compiler/i3847.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ object Test {
1818
import Arrays._
1919
implicit val ct: Expr[ClassTag[Int]] = '{ClassTag.Int}
2020
val arr: Expr[Array[Int]] = Array[Int](1, 2, 3).toExpr
21-
println(show(arr))
21+
println(run(arr.show.toExpr))
2222
}
2323
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ object Test {
1111
}
1212

1313
println(run(f2(x)))
14-
println(show(f2(x)))
14+
println(run(f2(x).show.toExpr))
1515
}
1616
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ object Test {
1111
}
1212

1313
println(run(f3(x)))
14-
println(show(f3(x))) // TODO improve printer
14+
println(run(f3(x).show.toExpr)) // TODO improve printer
1515
}
1616
}

0 commit comments

Comments
 (0)