summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/TraversableLike.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-05-14 15:02:07 +0200
committerJason Zaugg <jzaugg@gmail.com>2014-05-14 15:04:17 +0200
commitd7aec58bf3dfbe57c29ad29e7035a6a351620423 (patch)
treed76f15d305b9c3a5c57cf1d762639bce6ac55fed /src/library/scala/collection/TraversableLike.scala
parentc763d8413b8e1ef5129378952b2327e8a7c2de7d (diff)
downloadscala-d7aec58bf3dfbe57c29ad29e7035a6a351620423.tar.gz
scala-d7aec58bf3dfbe57c29ad29e7035a6a351620423.tar.bz2
scala-d7aec58bf3dfbe57c29ad29e7035a6a351620423.zip
SI-8587 Explicitly document forall/exists for empty collections
This behaviour isn't always intuitive for newcomers. Also changes inadvertant doc comment to an impl. comment.
Diffstat (limited to 'src/library/scala/collection/TraversableLike.scala')
-rw-r--r--src/library/scala/collection/TraversableLike.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library/scala/collection/TraversableLike.scala b/src/library/scala/collection/TraversableLike.scala
index b60ea86ab0..d3a7db6968 100644
--- a/src/library/scala/collection/TraversableLike.scala
+++ b/src/library/scala/collection/TraversableLike.scala
@@ -345,8 +345,8 @@ trait TraversableLike[+A, +Repr] extends Any
* $mayNotTerminateInf
*
* @param p the predicate used to test elements.
- * @return `true` if the given predicate `p` holds for all elements
- * of this $coll, otherwise `false`.
+ * @return `true` if this $coll is empty, otherwise `true` if the given predicate `p`
+ * holds for all elements of this $coll, otherwise `false`.
*/
def forall(p: A => Boolean): Boolean = {
var result = true
@@ -362,8 +362,8 @@ trait TraversableLike[+A, +Repr] extends Any
* $mayNotTerminateInf
*
* @param p the predicate used to test elements.
- * @return `true` if the given predicate `p` holds for some of the
- * elements of this $coll, otherwise `false`.
+ * @return `false` if this $coll is empty, otherwise `true` if the given predicate `p`
+ * holds for some of the elements of this $coll, otherwise `false`
*/
def exists(p: A => Boolean): Boolean = {
var result = false