summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorViktor Klang <viktor.klang@gmail.com>2016-11-08 08:46:13 +0100
committerViktor Klang <viktor.klang@gmail.com>2016-11-08 08:46:13 +0100
commitc8e6b4e464b47bb2cd64afaf64c5249da4bbdf89 (patch)
treee81f05982a8126161290a01bbf9be09c8e40754e /src/library
parent10c609e750a7089055b126e6231e5ddb2f2e8623 (diff)
downloadscala-c8e6b4e464b47bb2cd64afaf64c5249da4bbdf89.tar.gz
scala-c8e6b4e464b47bb2cd64afaf64c5249da4bbdf89.tar.bz2
scala-c8e6b4e464b47bb2cd64afaf64c5249da4bbdf89.zip
Regression: Make Future.failed(e).failed turn into a success instead of failure
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/concurrent/impl/Promise.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/concurrent/impl/Promise.scala b/src/library/scala/concurrent/impl/Promise.scala
index 626540425f..7fcc8c9f2d 100644
--- a/src/library/scala/concurrent/impl/Promise.scala
+++ b/src/library/scala/concurrent/impl/Promise.scala
@@ -384,7 +384,7 @@ private[concurrent] object Promise {
private[this] final def thisAs[S]: Future[S] = future.asInstanceOf[Future[S]]
override def onSuccess[U](pf: PartialFunction[T, U])(implicit executor: ExecutionContext): Unit = ()
- override def failed: Future[Throwable] = thisAs[Throwable]
+ override def failed: Future[Throwable] = KeptPromise(Success(result.exception)).future
override def foreach[U](f: T => U)(implicit executor: ExecutionContext): Unit = ()
override def map[S](f: T => S)(implicit executor: ExecutionContext): Future[S] = thisAs[S]
override def flatMap[S](f: T => Future[S])(implicit executor: ExecutionContext): Future[S] = thisAs[S]