Skip to content

Commit be6396e

Browse files
committed
Uncake tasty.Reflection
1 parent 8f04ba5 commit be6396e

28 files changed

+3279
-3386
lines changed

compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ class DecompilationPrinter extends Phase {
4343
} else {
4444
val unitFile = unit.source.toString.replace("\\", "/").replace(".class", ".tasty")
4545
out.println(s"/** Decompiled from $unitFile */")
46-
val refl = ReflectionImpl(ctx)
47-
out.println(new refl.SourceCodePrinter().showTree(unit.tpdTree)(ctx))
46+
out.println(ReflectionImpl(ctx).TreeAPI(unit.tpdTree).showCode)
4847
}
4948
}
5049
}

compiler/src/dotty/tools/dotc/decompiler/IDEDecompilerDriver.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ class IDEDecompilerDriver(val settings: List[String]) extends dotc.Driver {
3535
run.printSummary()
3636
val unit = ctx.run.units.head
3737

38-
val refl = ReflectionImpl(ctx)
39-
val decompiled = new refl.SourceCodePrinter().showTree(unit.tpdTree)
38+
val decompiled = ReflectionImpl(ctx).TreeAPI(unit.tpdTree).showCode
4039
val tree = new TastyHTMLPrinter(unit.pickled.head._2).printContents()
4140

4241
reporter.removeBufferedMessages.foreach(message => System.err.println(message))

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ class QuoteDriver extends Driver {
4747
val tree1 =
4848
if (ctx.settings.YshowRawQuoteTrees.value) tree
4949
else (new TreeCleaner).transform(tree)
50-
val refl = ReflectionImpl(ctx)
51-
new refl.SourceCodePrinter().showTree(tree1)
50+
ReflectionImpl(ctx).TreeAPI(tree1).showCode
5251
}
5352
withTree(expr, show, settings)
5453
}

0 commit comments

Comments
 (0)