From 70634395a4ea6e05877704e655a5870692581ebc Mon Sep 17 00:00:00 2001 From: Heather Miller Date: Fri, 22 Nov 2013 10:32:50 -0600 Subject: SI-6913 Fixing semantics of Future fallbackTo to be according to docs Origin: viktorklang@1bbe854 --- src/library/scala/concurrent/Future.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/library') 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 } -- cgit v1.2.3