From 50cff4d634c01cb1418e0d27d113f05b5dcf5cbf Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 10 Mar 2011 14:42:50 +0000 Subject: 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. --- src/compiler/scala/tools/nsc/interactive/Global.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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. -- cgit v1.2.3