Skip to content

Commit 8a39160

Browse files
committed
Implement -print as -Xprint:(last phase)
1 parent 07fd8a3 commit 8a39160

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dotty/tools/dotc/Run.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class Run(comp: Compiler)(implicit ctx: Context) {
6262
units = phase.runOn(units)
6363
def foreachUnit(op: Context => Unit)(implicit ctx: Context): Unit =
6464
for (unit <- units) op(ctx.fresh.setPhase(phase.next).setCompilationUnit(unit))
65-
if (ctx.settings.Xprint.value.containsPhase(phase))
65+
if (ctx.settings.Xprint.value.containsPhase(phase) ||
66+
(ctx.settings.print.value && phase == ctx.allPhases.last))
6667
foreachUnit(printTree)
6768
ctx.informTime(s"$phase ", start)
6869
}

0 commit comments

Comments
 (0)