diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/Option.scala | 5 |
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. */ |