diff options
author | Martin Odersky <odersky@gmail.com> | 2014-09-06 11:35:07 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-09-06 11:36:35 +0200 |
commit | b58b90683652e1b6e2c32412f0a03ba614b61b33 (patch) | |
tree | b86490f67c73d5d91bcc54f691469812f6b88a73 /src/dotty/tools/dotc/core/Phases.scala | |
parent | e1040935cbcc1d767933c38a141372538ef63ac2 (diff) | |
download | dotty-b58b90683652e1b6e2c32412f0a03ba614b61b33.tar.gz dotty-b58b90683652e1b6e2c32412f0a03ba614b61b33.tar.bz2 dotty-b58b90683652e1b6e2c32412f0a03ba614b61b33.zip |
Generalize phase postcondition checking.
Have a general way how a phase can establish a postcondition which will be
checked each time a later phase is tree-checked.
Moves erasure constraints from TreeChecker to Erasure's post condition.
Diffstat (limited to 'src/dotty/tools/dotc/core/Phases.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Phases.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Phases.scala b/src/dotty/tools/dotc/core/Phases.scala index 6baec3cf6..27b7cd77d 100644 --- a/src/dotty/tools/dotc/core/Phases.scala +++ b/src/dotty/tools/dotc/core/Phases.scala @@ -12,6 +12,7 @@ import dotty.tools.dotc.transform.TreeTransforms.{TreeTransformer, MiniPhase, Tr import dotty.tools.dotc.transform.TreeTransforms import Periods._ import typer.{FrontEnd, RefChecks} +import ast.tpd import dotty.tools.dotc.transform.{Erasure, Flatten} trait Phases { @@ -191,7 +192,12 @@ object Phases { def description: String = phaseName - def checkable: Boolean = true + /** Output should be checkable by TreeChecker */ + def isCheckable: Boolean = true + + /** Check what the phase achieves, to be called at any point after it is finished. + */ + def checkPostCondition(tree: tpd.Tree)(implicit ctx: Context): Unit = () def exists: Boolean = true |