diff options
author | Martin Odersky <odersky@gmail.com> | 2011-03-10 14:42:50 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2011-03-10 14:42:50 +0000 |
commit | 50cff4d634c01cb1418e0d27d113f05b5dcf5cbf (patch) | |
tree | 8a929c3ea816a25bef11b6f0957606da9b343488 | |
parent | f8f8d378a4827b9f297b525274b390e646efaa0d (diff) | |
download | scala-50cff4d634c01cb1418e0d27d113f05b5dcf5cbf.tar.gz scala-50cff4d634c01cb1418e0d27d113f05b5dcf5cbf.tar.bz2 scala-50cff4d634c01cb1418e0d27d113f05b5dcf5cbf.zip |
Added assert that deferring cases of askLoadedT...
Added assert that deferring cases of askLoadedTyped and askParsedEntered
are not called from within an ask, as this would cause a deadlock.
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/Global.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala index 44b871f1a3..11ad5d9ce3 100644 --- a/src/compiler/scala/tools/nsc/interactive/Global.scala +++ b/src/compiler/scala/tools/nsc/interactive/Global.scala @@ -86,7 +86,12 @@ class Global(settings: Settings, reporter: Reporter) */ protected val toBeRemoved = new ArrayBuffer[AbstractFile] with SynchronizedBuffer[AbstractFile] - type ResponseMap = MultiHashMap[SourceFile, Response[Tree]] + class ResponseMap extends MultiHashMap[SourceFile, Response[Tree]] { + override def += (binding: (SourceFile, Set[Response[Tree]])) = { + assert(interruptsEnabled, "delayed operation within an ask") + super.+=(binding) + } + } /** A map that associates with each abstract file the set of responses that are waiting * (via waitLoadedTyped) for the unit associated with the abstract file to be loaded and completely typechecked. |