diff options
Diffstat (limited to 'src/dotty/tools/dotc/core')
-rw-r--r-- | src/dotty/tools/dotc/core/Decorators.scala | 7 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Phases.scala | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/Decorators.scala b/src/dotty/tools/dotc/core/Decorators.scala index cd9680e64..21f914d99 100644 --- a/src/dotty/tools/dotc/core/Decorators.scala +++ b/src/dotty/tools/dotc/core/Decorators.scala @@ -6,6 +6,7 @@ import Symbols._ import Contexts._, Names._, Phases._, printing.Texts._, printing.Printer import util.Positions.Position, util.SourcePosition import collection.mutable.ListBuffer +import dotty.tools.dotc.transform.TreeTransforms._ import scala.language.implicitConversions /** This object provides useful implicit decorators for types defined elsewhere */ @@ -127,8 +128,10 @@ object Decorators { * one of the names in the list of strings. */ implicit class PhaseListDecorator(val names: List[String]) extends AnyVal { - def containsPhase(phase: Phase) = - names exists (phase.name.startsWith) + def containsPhase(phase: Phase): Boolean = phase match { + case phase: TreeTransformer => phase.transformations.exists(containsPhase) + case _ => names exists (phase.name.startsWith) + } } implicit def sourcePos(pos: Position)(implicit ctx: Context): SourcePosition = diff --git a/src/dotty/tools/dotc/core/Phases.scala b/src/dotty/tools/dotc/core/Phases.scala index 87242c9b5..8b5606da2 100644 --- a/src/dotty/tools/dotc/core/Phases.scala +++ b/src/dotty/tools/dotc/core/Phases.scala @@ -107,11 +107,11 @@ object Phases { postTyperEmmited = true new PostTyperTransformer { override def name: String = transformations.map(_.name).mkString("TreeTransform:{", ", ", "}") - override protected def transformations: Array[TreeTransform] = transforms.toArray + override def transformations: Array[TreeTransform] = transforms.toArray } } else new TreeTransformer { override def name: String = transformations.map(_.name).mkString("TreeTransform:{", ", ", "}") - override protected def transformations: Array[TreeTransform] = transforms.toArray + override def transformations: Array[TreeTransform] = transforms.toArray } squashedPhases += block block.init(this, phasess(i).head.id, phasess(i).last.id) |