aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Checking.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-02-26 14:26:15 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-03-18 11:14:11 +0100
commit21f042ecaf136ce544ec899f42e70e2e1a1addf8 (patch)
tree06b2c1a65832abf5ef4e5a6773fd4e44df56eaa2 /src/dotty/tools/dotc/typer/Checking.scala
parent76bf36dd64c05fbbf6fd804983379c8c31f52c9d (diff)
downloaddotty-21f042ecaf136ce544ec899f42e70e2e1a1addf8.tar.gz
dotty-21f042ecaf136ce544ec899f42e70e2e1a1addf8.tar.bz2
dotty-21f042ecaf136ce544ec899f42e70e2e1a1addf8.zip
Avoid capturing context in lazy trees
Lazy trees can live longer than runs, so it is important that they capture as little as possible. In particular they should not capture contexts. This change led with a ripple through effect to many changes where operations now have to parameterzied with contexts, in particular in what concerns tree folding. The changes in turn uncovered some areas where dotc was incompatible with scalac, and flagged correct things as errors. These will be fixed in the next commits. Another small twist: EmptyTrees will not be read in delayed mode, so that one can check for lacking definitions without deserializing the rhs.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Checking.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Checking.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Checking.scala b/src/dotty/tools/dotc/typer/Checking.scala
index 1354b8926..f7502d56d 100644
--- a/src/dotty/tools/dotc/typer/Checking.scala
+++ b/src/dotty/tools/dotc/typer/Checking.scala
@@ -169,7 +169,7 @@ object Checking {
val checkTree = new TreeAccumulator[Unit] {
def checkRef(tree: Tree, sym: Symbol) =
if (sym.maybeOwner == refineCls && !seen(sym)) forwardRef(tree)
- def apply(x: Unit, tree: Tree) = tree match {
+ def apply(x: Unit, tree: Tree)(implicit ctx: Context) = tree match {
case tree: MemberDef =>
foldOver(x, tree)
seen += tree.symbol