summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-12-06 14:28:15 -0800
committerPaul Phillips <paulp@improving.org>2011-12-06 14:28:15 -0800
commit2969c53af1ed5bad39def14795ffeb8a0d910397 (patch)
treec9cd2e24fbbdc109b6494145ec9b58c3081f3485 /src
parentacdd12d521a5e03e3e6980210ee47c670952c795 (diff)
parent001710d73eedbe3f23b7d704c772a8616ddf2f10 (diff)
downloadscala-2969c53af1ed5bad39def14795ffeb8a0d910397.tar.gz
scala-2969c53af1ed5bad39def14795ffeb8a0d910397.tar.bz2
scala-2969c53af1ed5bad39def14795ffeb8a0d910397.zip
Merge branch 'master' of /scala/trunk into develop
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/Option.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/library/scala/Option.scala b/src/library/scala/Option.scala
index c1b64808b0..bd498de847 100644
--- a/src/library/scala/Option.scala
+++ b/src/library/scala/Option.scala
@@ -162,6 +162,11 @@ sealed abstract class Option[+A] extends Product with Serializable {
@inline final def filterNot(p: A => Boolean): Option[A] =
if (isEmpty || !p(this.get)) this else None
+ /** Returns false if the option is $none, true otherwise.
+ * @note Implemented here to avoid the implicit conversion to Iterable.
+ */
+ final def nonEmpty = isDefined
+
/** Necessary to keep $option from being implicitly converted to
* [[scala.collection.Iterable]] in `for` comprehensions.
*/