Skip to content

Commit d82b651

Browse files
committed
Remove special cases to print in homogenouous format
1 parent 9f1edaa commit d82b651

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
package dotty.tools.dotc.quoted
22

33
import dotty.tools.dotc.ast.tpd
4-
import dotty.tools.dotc.core.Contexts.Context
5-
import dotty.tools.dotc.core.Constants._
6-
import dotty.tools.dotc.core.quoted.PickledQuotes
7-
import dotty.tools.dotc.printing.RefinedPrinter
84

95
import scala.quoted.Expr
10-
import scala.runtime.BoxedUnit
116
import scala.quoted.Exprs.{LiftedExpr, TastyTreeExpr}
127
import scala.runtime.quoted._
138

@@ -32,20 +27,7 @@ object Toolbox {
3227
new QuoteDriver().run(expr, runSettings)
3328
}
3429

35-
def show(expr: Expr[T]): String = expr match {
36-
case expr: LiftedExpr[T] =>
37-
expr.value match {
38-
case value: Class[_] => s"classOf[${value.getCanonicalName}]"
39-
case value if value == BoxedUnit.UNIT => "()"
40-
case value =>
41-
implicit val ctx = new QuoteDriver().initCtx
42-
if (showSettings.compilerArgs.contains("-color:never"))
43-
ctx.settings.color.update("never")
44-
val printer = new RefinedPrinter(ctx)
45-
printer.toText(Literal(Constant(value))).mkString(Int.MaxValue, false)
46-
}
47-
case _ => new QuoteDriver().show(expr, showSettings)
48-
}
30+
def show(expr: Expr[T]): String = new QuoteDriver().show(expr, showSettings)
4931

5032
}
5133

0 commit comments

Comments
 (0)