diff options
author | Martin Odersky <odersky@gmail.com> | 2014-04-19 19:48:57 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-05-08 21:48:08 +0200 |
commit | d78885ff06bea4840cdf9bee61dd3698fcff820a (patch) | |
tree | c93a65fdd1219d2dbe26a59de4873c79b808d471 /src/dotty/tools/dotc/core/Phases.scala | |
parent | 9203e01ddd141ddbb96e3064be5e894ddb666fd8 (diff) | |
download | dotty-d78885ff06bea4840cdf9bee61dd3698fcff820a.tar.gz dotty-d78885ff06bea4840cdf9bee61dd3698fcff820a.tar.bz2 dotty-d78885ff06bea4840cdf9bee61dd3698fcff820a.zip |
isAfterTyper test
Add test whether we are after typer. Use it to assert that
eta expansion and implicit search do not happen after typer.
Diffstat (limited to 'src/dotty/tools/dotc/core/Phases.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Phases.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Phases.scala b/src/dotty/tools/dotc/core/Phases.scala index f76b83db6..251cd3876 100644 --- a/src/dotty/tools/dotc/core/Phases.scala +++ b/src/dotty/tools/dotc/core/Phases.scala @@ -36,6 +36,8 @@ trait Phases { def atPhaseNotLaterThanTyper[T](op: Context => T): T = atPhaseNotLaterThan(base.typerPhase)(op) + + def isAfterTyper: Boolean = base.isAfterTyper(phase) } object Phases { @@ -177,9 +179,11 @@ object Phases { def refchecksPhase = refChecksCache.phase def erasurePhase = erasureCache.phase def flattenPhase = flattenCache.phase + + def isAfterTyper(phase: Phase): Boolean = phase.id > typerPhase.id } - final val typerName = "typer" + final val typerName = "frontend" final val refChecksName = "refchecks" final val erasureName = "erasure" final val flattenName = "flatten" |