diff options
Diffstat (limited to 'src/library/scala/Option.scala')
-rw-r--r-- | src/library/scala/Option.scala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/library/scala/Option.scala b/src/library/scala/Option.scala index 7282feebb6..c7894a45b8 100644 --- a/src/library/scala/Option.scala +++ b/src/library/scala/Option.scala @@ -107,7 +107,7 @@ sealed abstract class Option[+A] extends Product with Serializable { def isDefined: Boolean = !isEmpty /** Returns the option's value. - * @note The option must be nonEmpty. + * @note The option must be nonempty. * @throws java.util.NoSuchElementException if the option is empty. */ def get: A @@ -330,9 +330,11 @@ sealed abstract class Option[+A] extends Product with Serializable { * @version 1.0, 16/07/2003 */ @SerialVersionUID(1234815782226070388L) // value computed by serialver for 2.11.2, annotation added in 2.11.4 -final case class Some[+A](x: A) extends Option[A] { +final case class Some[+A](@deprecatedName('x, "2.12.0") value: A) extends Option[A] { def isEmpty = false - def get = x + def get = value + + @deprecated("Use .value instead.", "2.12.0") def x: A = value } |