summaryrefslogtreecommitdiff
path: root/test/files/presentation/recursive-ask
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2012-09-04 10:50:21 +0200
committerIulian Dragos <jaguarul@gmail.com>2012-09-04 10:50:21 +0200
commit4f932df552fd2a9e1af31bc3b5fbbfeeaa15feed (patch)
tree2459e2680ec8a879a07a7ea967ed6a02ee91b6e1 /test/files/presentation/recursive-ask
parent5415272018114bb2e15036c5d6f9ae9c5af625d2 (diff)
downloadscala-4f932df552fd2a9e1af31bc3b5fbbfeeaa15feed.tar.gz
scala-4f932df552fd2a9e1af31bc3b5fbbfeeaa15feed.tar.bz2
scala-4f932df552fd2a9e1af31bc3b5fbbfeeaa15feed.zip
Allow nested calls to `askForResponse` in the presentation compiler.
Fix #6312. review by @odersky,@lrytz.
Diffstat (limited to 'test/files/presentation/recursive-ask')
-rw-r--r--test/files/presentation/recursive-ask/RecursiveAsk.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/files/presentation/recursive-ask/RecursiveAsk.scala b/test/files/presentation/recursive-ask/RecursiveAsk.scala
new file mode 100644
index 0000000000..b0e29b3fd3
--- /dev/null
+++ b/test/files/presentation/recursive-ask/RecursiveAsk.scala
@@ -0,0 +1,20 @@
+import scala.tools.nsc.interactive.tests._
+
+object Test extends InteractiveTest {
+ override def execute(): Unit = recursiveAskForResponse()
+
+ def recursiveAskForResponse() {
+ val res0 = compiler.askForResponse( () => {
+ println("[ outer] askForResponse")
+ val res = compiler.askForResponse( () => { println("[nested] askForResponse") })
+ println (res.get(5000) match {
+ case Some(_) => "passed"
+ case None => "timeout"
+ })
+ })
+
+ res0.get
+
+ println("done")
+ }
+}