aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-09-10 06:44:05 +0200
committerMartin Odersky <odersky@gmail.com>2014-09-10 06:44:05 +0200
commit5cc99d4f09b986748e9250a58954c2f097664b66 (patch)
treeb1dce867fab95f421e8be1f205c4af9bf3fca6c4
parentb129332c273374018bfdd8a51bbec761118c9d9c (diff)
downloaddotty-5cc99d4f09b986748e9250a58954c2f097664b66.tar.gz
dotty-5cc99d4f09b986748e9250a58954c2f097664b66.tar.bz2
dotty-5cc99d4f09b986748e9250a58954c2f097664b66.zip
Fixes to TreeChecker
1) One phase too many was checked for postconditions. 2) Class members did not have their owners checked because index was not called on them.
-rw-r--r--src/dotty/tools/dotc/transform/TreeChecker.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/transform/TreeChecker.scala b/src/dotty/tools/dotc/transform/TreeChecker.scala
index 39c5ce8b6..50d409942 100644
--- a/src/dotty/tools/dotc/transform/TreeChecker.scala
+++ b/src/dotty/tools/dotc/transform/TreeChecker.scala
@@ -39,7 +39,7 @@ class TreeChecker {
println(s"checking ${ctx.compilationUnit} after phase ${ctx.phase.prev}")
val checkingCtx = ctx.fresh
.setTyperState(ctx.typerState.withReporter(new ThrowingReporter(ctx.typerState.reporter)))
- val checker = new Checker(phasesToRun.takeWhile(_ ne ctx.phase) :+ ctx.phase)
+ val checker = new Checker(phasesToRun.takeWhile(_ ne ctx.phase))
checker.typedExpr(ctx.compilationUnit.tpdTree)(checkingCtx)
}
@@ -107,9 +107,9 @@ class TreeChecker {
* is that we should be able to pull out an expression as an initializer
* of a helper value without having to do a change owner traversal of the expression.
*/
- override def index(trees: List[untpd.Tree])(implicit ctx: Context): Context = {
+ override def typedStats(trees: List[untpd.Tree], exprOwner: Symbol)(implicit ctx: Context): List[Tree] = {
for (tree <- trees if tree.isDef) checkOwner(tree)
- super.index(trees)
+ super.typedStats(trees, exprOwner)
}
override def adapt(tree: Tree, pt: Type, original: untpd.Tree = untpd.EmptyTree)(implicit ctx: Context) = {