summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornafg <naftoligug@gmail.com>2015-04-24 04:54:01 -0400
committernafg <naftoligug@gmail.com>2015-04-24 04:54:01 -0400
commit7385a84bb9b3c71d5a7a78de94f23f836ecc3a61 (patch)
tree0fa51ce6d212d8ff8982d6594e0fd6b49ee6b11f /src
parentd030172d7ef807d85391d32c5456b1b97b15a402 (diff)
downloadscala-7385a84bb9b3c71d5a7a78de94f23f836ecc3a61.tar.gz
scala-7385a84bb9b3c71d5a7a78de94f23f836ecc3a61.tar.bz2
scala-7385a84bb9b3c71d5a7a78de94f23f836ecc3a61.zip
Fix scaladoc of Try#failed
The documentation stated that it returns a Success[Throwable] regardless, either containing the failure or an UnsupportedOperationException. However only Failure#failed returns a success; Success#failed returns a Failure. Also the phrasing of "Completes this `Try`" and "that `Try` failed with" sounds like it was copy-pasted from Future? Trys don't complete, nor fail, they are immutable.
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/util/Try.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library/scala/util/Try.scala b/src/library/scala/util/Try.scala
index b0cf122f2a..f65c77f5a0 100644
--- a/src/library/scala/util/Try.scala
+++ b/src/library/scala/util/Try.scala
@@ -164,8 +164,8 @@ sealed abstract class Try[+T] {
def flatten[U](implicit ev: T <:< Try[U]): Try[U]
/**
- * Completes this `Try` with an exception wrapped in a `Success`. The exception is either the exception that the
- * `Try` failed with (if a `Failure`) or an `UnsupportedOperationException`.
+ * Inverts this `Try`. If this is a `Failure`, returns its exception wrapped in a `Success`.
+ * If this is a `Success`, returns a `Failure` containing an `UnsupportedOperationException`.
*/
def failed: Try[Throwable]