diff options
author | Eugene Vigdorchik <eugenevigdorchik@epfl.ch> | 2010-11-05 09:24:52 +0000 |
---|---|---|
committer | Eugene Vigdorchik <eugenevigdorchik@epfl.ch> | 2010-11-05 09:24:52 +0000 |
commit | 4a19146481f468b9c946ff48aaec8aaaf59c4c2a (patch) | |
tree | 1ea44a5c9ee1aeb477eb9d40fcf83e0d1f5e1576 | |
parent | af202942f1ec01eb0a35e94407bcdb485679ddf0 (diff) | |
download | scala-4a19146481f468b9c946ff48aaec8aaaf59c4c2a.tar.gz scala-4a19146481f468b9c946ff48aaec8aaaf59c4c2a.tar.bz2 scala-4a19146481f468b9c946ff48aaec8aaaf59c4c2a.zip |
Sync toplevels after namer but before typecheck...
Sync toplevels after namer but before typechecker to be in time to flag
toplevel removal. Review by odersky
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/Global.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala index 7cd225b719..5bb22010ec 100644 --- a/src/compiler/scala/tools/nsc/interactive/Global.scala +++ b/src/compiler/scala/tools/nsc/interactive/Global.scala @@ -288,6 +288,7 @@ self => currentTyperRun.compileLate(unit) if (!reporter.hasErrors) validatePositions(unit.body) //println("parsed: [["+unit.body+"]]") + if (!unit.isJava) syncTopLevelSyms(unit) unit.status = JustParsed } @@ -304,13 +305,14 @@ self => activeLocks = 0 currentTyperRun.typeCheck(unit) unit.status = currentRunId - if (!unit.isJava) syncTopLevelSyms(unit) } } def syncTopLevelSyms(unit: RichCompilationUnit) { val deleted = currentTopLevelSyms filter { sym => - sym.sourceFile == unit.source.file && runId(sym.validTo) < currentRunId + /** We sync after namer phase and it resets all the top-level symbols that survive the new parsing + * round to NoPeriod. */ + sym.sourceFile == unit.source.file && sym.validTo != NoPeriod && runId(sym.validTo) < currentRunId } for (d <- deleted) { d.owner.info.decls unlink d |