summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/Either.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library/scala/Either.scala b/src/library/scala/Either.scala
index bc75f0f088..e454cdf5ec 100644
--- a/src/library/scala/Either.scala
+++ b/src/library/scala/Either.scala
@@ -575,15 +575,15 @@ object Either {
}
}
- /** If the condition is satisfied, return the given `A` in `Left`,
- * otherwise, return the given `B` in `Right`.
+ /** If the condition is satisfied, return the given `B` in `Right`,
+ * otherwise, return the given `A` in `Left`.
*
* {{{
* val userInput: String = ...
* Either.cond(
* userInput.forall(_.isDigit) && userInput.size == 10,
- * "The input (%s) does not look like a phone number".format(userInput),
- * PhoneNumber(userInput)
+ * PhoneNumber(userInput),
+ * "The input (%s) does not look like a phone number".format(userInput)
* }}}
*/
def cond[A, B](test: Boolean, right: => B, left: => A): Either[A, B] =