Skip to content

Commit 1c84843

Browse files
committed
Deprecate the companionClass of any2stringadd
Fixes scala/bug#11527 Ref scala#6315 This is so we get the deprecation on the API documentation.
1 parent 06392a5 commit 1c84843

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/library/scala/Predef.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import scala.language.implicitConversions
1616

1717
import scala.collection.{mutable, immutable, ArrayOps, StringOps}, immutable.WrappedString
1818
import scala.annotation.{elidable, implicitNotFound}, elidable.ASSERTION
19-
import scala.annotation.meta.companionMethod
19+
import scala.annotation.meta.{ companionClass, companionMethod }
2020

2121
/** The `Predef` object provides definitions that are accessible in all Scala
2222
* compilation units without explicit qualification.
@@ -372,9 +372,12 @@ object Predef extends LowPriorityImplicits {
372372
@inline def formatted(fmtstr: String): String = fmtstr format self
373373
}
374374

375-
// scala/bug#8229 retaining the pre 2.11 name for source compatibility in shadowing this implicit
376-
/** @group implicit-classes-any */
375+
/** Injects String concatenation operator `+` to any classes.
376+
* @group implicit-classes-any
377+
*/
377378
@(deprecated @companionMethod)("Implicit injection of + is deprecated. Convert to String to call +", "2.13.0")
379+
@(deprecated @companionClass)("Implicit injection of + is deprecated. Convert to String to call +", "2.13.0") // for Scaladoc
380+
// scala/bug#8229 retaining the pre 2.11 name for source compatibility in shadowing this implicit
378381
implicit final class any2stringadd[A](private val self: A) extends AnyVal {
379382
def +(other: String): String = String.valueOf(self) + other
380383
}

0 commit comments

Comments
 (0)