Skip to content
This repository was archived by the owner on Feb 23, 2018. It is now read-only.

Commit e85bfbb

Browse files
author
odersky
committed
Added assert that deferring cases of askLoadedTyped and askParsedEntered are not called from within an ask, as this would cause a deadlock.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24429 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
1 parent f22c154 commit e85bfbb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/compiler/scala/tools/nsc/interactive/Global.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ class Global(settings: Settings, reporter: Reporter)
8686
*/
8787
protected val toBeRemoved = new ArrayBuffer[AbstractFile] with SynchronizedBuffer[AbstractFile]
8888

89-
type ResponseMap = MultiHashMap[SourceFile, Response[Tree]]
89+
class ResponseMap extends MultiHashMap[SourceFile, Response[Tree]] {
90+
override def += (binding: (SourceFile, Set[Response[Tree]])) = {
91+
assert(interruptsEnabled, "delayed operation within an ask")
92+
super.+=(binding)
93+
}
94+
}
9095

9196
/** A map that associates with each abstract file the set of responses that are waiting
9297
* (via waitLoadedTyped) for the unit associated with the abstract file to be loaded and completely typechecked.

0 commit comments

Comments
 (0)