summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-11-10 15:28:25 +1000
committerGitHub <noreply@github.com>2016-11-10 15:28:25 +1000
commitff32c8a4129b58839568c70a8ef76a52436366f5 (patch)
tree47c5de8c9b9df9acb1e1e9701fbac2a2f024ec84 /src/library
parent754fc76ae21896a14982f948a014a1b71ce35708 (diff)
parentc8e6b4e464b47bb2cd64afaf64c5249da4bbdf89 (diff)
downloadscala-ff32c8a4129b58839568c70a8ef76a52436366f5.tar.gz
scala-ff32c8a4129b58839568c70a8ef76a52436366f5.tar.bz2
scala-ff32c8a4129b58839568c70a8ef76a52436366f5.zip
Merge pull request #5507 from viktorklang/wip-SI-10034-√
SI-10034: 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]