diff options
author | Martin Odersky <odersky@gmail.com> | 2015-02-26 14:26:15 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-03-18 11:14:11 +0100 |
commit | 21f042ecaf136ce544ec899f42e70e2e1a1addf8 (patch) | |
tree | 06b2c1a65832abf5ef4e5a6773fd4e44df56eaa2 /src/dotty/tools/backend/jvm/DottyBackendInterface.scala | |
parent | 76bf36dd64c05fbbf6fd804983379c8c31f52c9d (diff) | |
download | dotty-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/backend/jvm/DottyBackendInterface.scala')
-rw-r--r-- | src/dotty/tools/backend/jvm/DottyBackendInterface.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index 170738de6..5fcb7f57b 100644 --- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -295,7 +295,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{ val t = new TreeTraverser { var outerRhs: Tree = tree - def traverse(tree: tpd.Tree): Unit = tree match { + def traverse(tree: tpd.Tree)(implicit ctx: Context): Unit = tree match { case t: DefDef => if (t.symbol is Flags.Label) res.put(outerRhs, t :: res.getOrElse(outerRhs, Nil)) |