summaryrefslogtreecommitdiff
path: root/src/library/scala/Predef.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-02-18 17:37:31 +0100
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-02-18 15:41:26 -0800
commitbba01661ea629ff636a538226ad267a67d9dbfa7 (patch)
treec5e3b82bcc6bc28bbdc012825bb219334ed2b6f0 /src/library/scala/Predef.scala
parent3dbcb1b9d4daa5cba98747bbc66f898ba0f864fd (diff)
downloadscala-bba01661ea629ff636a538226ad267a67d9dbfa7.tar.gz
scala-bba01661ea629ff636a538226ad267a67d9dbfa7.tar.bz2
scala-bba01661ea629ff636a538226ad267a67d9dbfa7.zip
SI-8229 Source compatible name for implicit any2stringadd
To support the established pattern for disabling it for an compilation unit. Update scaladoc's knowledge of our "typeclasses". Leave a `private[scala]` version of `StringAdd` (public in bytecode) to ensure binary compatibility with 2.11.0-M8 for partest.
Diffstat (limited to 'src/library/scala/Predef.scala')
-rw-r--r--src/library/scala/Predef.scala13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala
index 50577e710e..2bde6795e0 100644
--- a/src/library/scala/Predef.scala
+++ b/src/library/scala/Predef.scala
@@ -264,8 +264,16 @@ object Predef extends LowPriorityImplicits with DeprecatedPredef {
@inline def formatted(fmtstr: String): String = fmtstr format self
}
- implicit final class StringAdd[A](private val self: A) extends AnyVal {
- def +(other: String) = String.valueOf(self) + other
+ // TODO: remove, only needed for binary compatibility of 2.11.0-RC1 with 2.11.0-M8
+ // note that `private[scala]` becomes `public` in bytecode
+ private[scala] final class StringAdd[A](private val self: A) extends AnyVal {
+ def +(other: String): String = String.valueOf(self) + other
+ }
+ private[scala] def StringAdd(x: Any): Any = new StringAdd(x)
+
+ // SI-8229 retaining the pre 2.11 name for source compatibility in shadowing this implicit
+ implicit final class any2stringadd[A](private val self: A) extends AnyVal {
+ def +(other: String): String = String.valueOf(self) + other
}
implicit final class RichException(private val self: Throwable) extends AnyVal {
@@ -410,7 +418,6 @@ private[scala] trait DeprecatedPredef {
@deprecated("Use `ArrowAssoc`", "2.11.0") def any2ArrowAssoc[A](x: A): ArrowAssoc[A] = new ArrowAssoc(x)
@deprecated("Use `Ensuring`", "2.11.0") def any2Ensuring[A](x: A): Ensuring[A] = new Ensuring(x)
@deprecated("Use `StringFormat`", "2.11.0") def any2stringfmt(x: Any): StringFormat[Any] = new StringFormat(x)
- @deprecated("Use String interpolation", "2.11.0") def any2stringadd(x: Any): StringAdd[Any] = new StringAdd(x)
@deprecated("Use `Throwable` directly", "2.11.0") def exceptionWrapper(exc: Throwable) = new RichException(exc)
@deprecated("Use `SeqCharSequence`", "2.11.0") def seqToCharSequence(xs: scala.collection.IndexedSeq[Char]): CharSequence = new SeqCharSequence(xs)
@deprecated("Use `ArrayCharSequence`", "2.11.0") def arrayToCharSequence(xs: Array[Char]): CharSequence = new ArrayCharSequence(xs)