summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/Global.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 787c9c7f57..a701e41153 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -1667,13 +1667,14 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
/** Compile abstract file until `globalPhase`, but at least to phase "namer".
*/
def compileLate(unit: CompilationUnit) {
- val maxId = math.max(globalPhase.id, typerPhase.id)
addUnit(unit)
- firstPhase.iterator takeWhile (_.id < maxId) foreach (ph =>
- atPhase(ph)(ph.asInstanceOf[GlobalPhase] applyPhase unit)
- )
- refreshProgress
+ if (firstPhase ne null) { // we might get here during initialization, is a source is newer than the binary
+ val maxId = math.max(globalPhase.id, typerPhase.id)
+ firstPhase.iterator takeWhile (_.id < maxId) foreach (ph =>
+ atPhase(ph)(ph.asInstanceOf[GlobalPhase] applyPhase unit))
+ refreshProgress
+ }
}
/** Reset package class to state at typer (not sure what this