summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-11-08 20:35:48 +0000
committerPaul Phillips <paulp@improving.org>2011-11-08 20:35:48 +0000
commitbcc5eebedb8869e73e0d39aaf5c6b3164048aad1 (patch)
treea4ab4271c4bdcfc4540164e53e8ce40cae933c3e
parent4eda3043c316762b06b05d1566df8adbad288f41 (diff)
downloadscala-bcc5eebedb8869e73e0d39aaf5c6b3164048aad1.tar.gz
scala-bcc5eebedb8869e73e0d39aaf5c6b3164048aad1.tar.bz2
scala-bcc5eebedb8869e73e0d39aaf5c6b3164048aad1.zip
Fix binary breakage.
Some philistine who thinks "binary compatibility" is a computer dating site changed the names of public vals in Predef classes. I restored and then deprecated them. REVIEW BY MOORS.
-rw-r--r--src/library/scala/Predef.scala24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala
index fb3f379b0c..b175fb9e1d 100644
--- a/src/library/scala/Predef.scala
+++ b/src/library/scala/Predef.scala
@@ -214,10 +214,12 @@ object Predef extends LowPriorityImplicits {
throw new IllegalArgumentException("requirement failed: "+ message)
}
- final class Ensuring[A](val __resultOfEnsuring: A) { // `__resultOfEnsuring` must be a public val to allow inlining
- // the val used to be called `x`, but now goes by `__resultOfEnsuring`, as that reduces the chances of a user's writing
- // `foo.__resultOfEnsuring` and being confused why they get an ambiguous implicit conversion error
- // (`foo.x` used to produce this error since both any2Ensuring and any2ArrowAssoc pimped an `x` onto everything)
+ final class Ensuring[A](val __resultOfEnsuring: A) {
+ // `__resultOfEnsuring` must be a public val to allow inlining.
+ // See comments in ArrowAssoc for more.
+ @deprecated("Use __resultOfEnsuring instead", "2.10.0")
+ def x = __resultOfEnsuring
+
def ensuring(cond: Boolean): A = { assert(cond); __resultOfEnsuring }
def ensuring(cond: Boolean, msg: => Any): A = { assert(cond, msg); __resultOfEnsuring }
def ensuring(cond: A => Boolean): A = { assert(cond(__resultOfEnsuring)); __resultOfEnsuring }
@@ -244,10 +246,16 @@ object Predef extends LowPriorityImplicits {
def unapply[A, B, C](x: Tuple3[A, B, C]): Option[Tuple3[A, B, C]] = Some(x)
}
- final class ArrowAssoc[A](val __leftOfArrow: A) { // `__leftOfArrow` must be a public val to allow inlining
- // the val used to be called `x`, but now goes by `__leftOfArrow`, as that reduces the chances of a user's writing
- // `foo.__leftOfArrow` and being confused why they get an ambiguous implicit conversion error
- // (`foo.x` used to produce this error since both any2Ensuring and any2ArrowAssoc pimped an `x` onto everything)
+ final class ArrowAssoc[A](val __leftOfArrow: A) {
+ // `__leftOfArrow` must be a public val to allow inlining. The val
+ // used to be called `x`, but now goes by `__leftOfArrow`, as that
+ // reduces the chances of a user's writing `foo.__leftOfArrow` and
+ // being confused why they get an ambiguous implicit conversion
+ // error. (`foo.x` used to produce this error since both
+ // any2Ensuring and any2ArrowAssoc pimped an `x` onto everything)
+ @deprecated("Use __leftOfArrow instead", "2.10.0")
+ def x = __leftOfArrow
+
@inline def -> [B](y: B): Tuple2[A, B] = Tuple2(__leftOfArrow, y)
def →[B](y: B): Tuple2[A, B] = ->(y)
}