diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/interactive/Global.scala')
-rwxr-xr-x | src/compiler/scala/tools/nsc/interactive/Global.scala | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala index 51ba19951e..72415b5d7b 100755 --- a/src/compiler/scala/tools/nsc/interactive/Global.scala +++ b/src/compiler/scala/tools/nsc/interactive/Global.scala @@ -4,6 +4,7 @@ import java.io.{ PrintWriter, StringWriter } import scala.collection.mutable.{LinkedHashMap, SynchronizedMap} import scala.concurrent.SyncVar +import scala.util.control.ControlException import scala.tools.nsc.io.AbstractFile import scala.tools.nsc.util.{SourceFile, Position, RangePosition, OffsetPosition, NoPosition, WorkScheduler} import scala.tools.nsc.reporters._ @@ -77,11 +78,19 @@ self => throw new TyperResult(located) } val typerRun = currentTyperRun - pollForWork() - if (typerRun != currentTyperRun) { - integrateNew() - throw new FreshRunReq - } + + while(true) + try { + pollForWork() + if (typerRun == currentTyperRun) + return + + integrateNew() + throw new FreshRunReq + } catch { + case ex : ValidateError => // Ignore, this will have been reported elsewhere + case t : Throwable => throw t + } } } @@ -421,9 +430,8 @@ self => } } - class TyperResult(val tree: Tree) extends Exception + class TyperResult(val tree: Tree) extends Exception with ControlException assert(globalPhase.id == 0) - } |