aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/Run.scala6
-rw-r--r--src/dotty/tools/dotc/core/Contexts.scala4
-rw-r--r--src/dotty/tools/dotc/transform/TreeChecker.scala4
3 files changed, 12 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/Run.scala b/src/dotty/tools/dotc/Run.scala
index 2fbfc3f9b..a9948c54a 100644
--- a/src/dotty/tools/dotc/Run.scala
+++ b/src/dotty/tools/dotc/Run.scala
@@ -3,6 +3,7 @@ package dotc
import core._
import Contexts._, Periods._, Symbols._, Phases._, Decorators._
+import dotty.tools.dotc.transform.TreeTransforms.TreeTransformer
import io.PlainFile
import util.{SourceFile, NoSource, Stats, SimpleMap}
import reporting.Reporter
@@ -60,7 +61,10 @@ class Run(comp: Compiler)(implicit ctx: Context) {
private def printTree(ctx: Context) = {
val unit = ctx.compilationUnit
- println(s"result of $unit after ${ctx.phase.prev}:")
+ val prevPhase = ctx.phase.prev // can be a mini-phase
+ val squahsedPhase = ctx.squashed(prevPhase)
+
+ println(s"result of $unit after ${squahsedPhase}:")
println(unit.tpdTree.show(ctx))
}
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala
index 3b14872b7..de6b0cabf 100644
--- a/src/dotty/tools/dotc/core/Contexts.scala
+++ b/src/dotty/tools/dotc/core/Contexts.scala
@@ -472,6 +472,10 @@ object Contexts {
/** The standard definitions */
val definitions = new Definitions
+
+ def squashed(p: Phase): Phase = {
+ squashedPhases.find(_.period.containsPhaseId(p.id)).getOrElse(NoPhase)
+ }
}
/** The essential mutable state of a context base, collected into a common class */
diff --git a/src/dotty/tools/dotc/transform/TreeChecker.scala b/src/dotty/tools/dotc/transform/TreeChecker.scala
index 4a7d280e5..7315b4da1 100644
--- a/src/dotty/tools/dotc/transform/TreeChecker.scala
+++ b/src/dotty/tools/dotc/transform/TreeChecker.scala
@@ -50,7 +50,9 @@ class TreeChecker {
}
def check(phasesToRun: Seq[Phase], ctx: Context) = {
- println(s"checking ${ctx.compilationUnit} after phase ${ctx.phase.prev}")
+ val prevPhase = ctx.phase.prev // can be a mini-phase
+ val squahsedPhase = ctx.squashed(prevPhase)
+ println(s"checking ${ctx.compilationUnit} after phase ${squahsedPhase}")
val checkingCtx = ctx.fresh
.setTyperState(ctx.typerState.withReporter(new ThrowingReporter(ctx.typerState.reporter)))
val checker = new Checker(previousPhases(phasesToRun.toList)(ctx))