summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorHeather Miller <heather.miller@epfl.ch>2013-11-22 10:32:50 -0600
committerPhilipp Haller <hallerp@gmail.com>2013-12-05 09:53:33 +0100
commit70634395a4ea6e05877704e655a5870692581ebc (patch)
tree6231ae8dfb3a0c2c9b4a0f7cfcac22b4858ec747 /src/library
parent7c1d1149291e1b83c96a0f6954144b9e97c030ea (diff)
downloadscala-70634395a4ea6e05877704e655a5870692581ebc.tar.gz
scala-70634395a4ea6e05877704e655a5870692581ebc.tar.bz2
scala-70634395a4ea6e05877704e655a5870692581ebc.zip
SI-6913 Fixing semantics of Future fallbackTo to be according to docs
Origin: viktorklang@1bbe854
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/concurrent/Future.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/library/scala/concurrent/Future.scala b/src/library/scala/concurrent/Future.scala
index 39946e4472..b2c09ec53e 100644
--- a/src/library/scala/concurrent/Future.scala
+++ b/src/library/scala/concurrent/Future.scala
@@ -384,7 +384,10 @@ trait Future[+T] extends Awaitable[T] {
val p = Promise[U]()
onComplete {
case s @ Success(_) => p complete s
- case _ => p completeWith that
+ case f @ Failure(_) => that onComplete {
+ case s2 @ Success(_) => p complete s2
+ case _ => p complete f // Use the first failure as the failure
+ }
}
p.future
}