summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2016-07-22 10:03:36 +0200
committerGitHub <noreply@github.com>2016-07-22 10:03:36 +0200
commit1a3a6127bf03891a2dc8fb2dfd4b270d1bc39ff9 (patch)
tree1e50acb56ec8da111e16eb78360ab0036d49d367
parentab83b26ed70862fae1c00f801beb7f1b78389ad3 (diff)
parent841fb2559b47259f9e5dc92a390fb4c7760ac218 (diff)
downloadscala-1a3a6127bf03891a2dc8fb2dfd4b270d1bc39ff9.tar.gz
scala-1a3a6127bf03891a2dc8fb2dfd4b270d1bc39ff9.tar.bz2
scala-1a3a6127bf03891a2dc8fb2dfd4b270d1bc39ff9.zip
Merge pull request #5281 from dwijnand/either-value
Deprecate and rename Left#a/Right#b to Left#value/Right#value
-rw-r--r--src/library/scala/util/Either.scala8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/library/scala/util/Either.scala b/src/library/scala/util/Either.scala
index 5c61d83a1a..2f1e5d5c33 100644
--- a/src/library/scala/util/Either.scala
+++ b/src/library/scala/util/Either.scala
@@ -345,9 +345,11 @@ sealed abstract class Either[+A, +B] extends Product with Serializable {
* @author <a href="mailto:research@workingmouse.com">Tony Morris</a>, Workingmouse
* @version 1.0, 11/10/2008
*/
-final case class Left[+A, +B](a: A) extends Either[A, B] {
+final case class Left[+A, +B](@deprecatedName('a, "2.12.0") value: A) extends Either[A, B] {
def isLeft = true
def isRight = false
+
+ @deprecated("Use .value instead.", "2.12.0") def a: A = value
}
/**
@@ -356,9 +358,11 @@ final case class Left[+A, +B](a: A) extends Either[A, B] {
* @author <a href="mailto:research@workingmouse.com">Tony Morris</a>, Workingmouse
* @version 1.0, 11/10/2008
*/
-final case class Right[+A, +B](b: B) extends Either[A, B] {
+final case class Right[+A, +B](@deprecatedName('b, "2.12.0") value: B) extends Either[A, B] {
def isLeft = false
def isRight = true
+
+ @deprecated("Use .value instead.", "2.12.0") def b: B = value
}
object Either {