From 841fb2559b47259f9e5dc92a390fb4c7760ac218 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Thu, 14 Jul 2016 18:39:24 +0100 Subject: Deprecate and rename Left#a/Right#b to Left#value/Right#value --- src/library/scala/util/Either.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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 Tony Morris, 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 Tony Morris, 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 { -- cgit v1.2.3