From b58b90683652e1b6e2c32412f0a03ba614b61b33 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 6 Sep 2014 11:35:07 +0200 Subject: 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. --- src/dotty/tools/dotc/core/Phases.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/Phases.scala') 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 -- cgit v1.2.3