Skip to content

Commit

Permalink
Deprecate the companionClass of any2stringadd
Browse files Browse the repository at this point in the history
Fixes scala/bug#11527
Ref scala#6315

This is so we get the deprecation on the API documentation.
  • Loading branch information
eed3si9n committed May 16, 2019
1 parent 06392a5 commit 1c84843
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/library/scala/Predef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import scala.language.implicitConversions

import scala.collection.{mutable, immutable, ArrayOps, StringOps}, immutable.WrappedString
import scala.annotation.{elidable, implicitNotFound}, elidable.ASSERTION
import scala.annotation.meta.companionMethod
import scala.annotation.meta.{ companionClass, companionMethod }

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

// scala/bug#8229 retaining the pre 2.11 name for source compatibility in shadowing this implicit
/** @group implicit-classes-any */
/** Injects String concatenation operator `+` to any classes.
* @group implicit-classes-any
*/
@(deprecated @companionMethod)("Implicit injection of + is deprecated. Convert to String to call +", "2.13.0")
@(deprecated @companionClass)("Implicit injection of + is deprecated. Convert to String to call +", "2.13.0") // for Scaladoc
// scala/bug#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
}
Expand Down

0 comments on commit 1c84843

Please sign in to comment.