Skip to content

Commit

Permalink
deprecate ArrayCharSequence
Browse files Browse the repository at this point in the history
as per discussion on scala#9292
  • Loading branch information
SethTisue committed Nov 18, 2020
1 parent 44be245 commit b10abb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/library/scala/Predef.scala
Expand Up @@ -361,6 +361,7 @@ object Predef extends LowPriorityImplicits with DeprecatedPredef {
def SeqCharSequence(sequenceOfChars: scala.collection.IndexedSeq[Char]): SeqCharSequence = new SeqCharSequence(sequenceOfChars)

/** @group char-sequence-wrappers */
@deprecated("use `java.nio.CharBuffer.wrap` instead", "2.12.13")
final class ArrayCharSequence(@deprecated("will be made private", "2.12.0") @deprecatedName(null, "2.12.0") val __arrayOfChars: Array[Char]) extends CharSequence {
def length: Int = __arrayOfChars.length
def charAt(index: Int): Char = __arrayOfChars(index)
Expand Down Expand Up @@ -553,7 +554,7 @@ private[scala] trait DeprecatedPredef {
@deprecated("use `StringFormat`", "2.11.0") def any2stringfmt(x: Any): StringFormat[Any] = new StringFormat(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)
@deprecated("use `java.nio.CharBuffer.wrap`", "2.11.0") def arrayToCharSequence(xs: Array[Char]): CharSequence = new ArrayCharSequence(xs)

@deprecated("use the method in `scala.io.StdIn`", "2.11.0") def readLine(): String = StdIn.readLine()
@deprecated("use the method in `scala.io.StdIn`", "2.11.0") def readLine(text: String, args: Any*) = StdIn.readLine(text, args: _*)
Expand Down
3 changes: 1 addition & 2 deletions src/library/scala/runtime/SeqCharSequence.scala
Expand Up @@ -21,8 +21,7 @@ final class SeqCharSequence(val xs: scala.collection.IndexedSeq[Char]) extends C
override def toString = xs.mkString("")
}

// Still need this one since the implicit class ArrayCharSequence only converts
// a single argument.
@deprecated("use `java.nio.CharBuffer.wrap` instead", "2.12.13")
final class ArrayCharSequence(val xs: Array[Char], start: Int, end: Int) extends CharSequence {
// yikes
// java.lang.VerifyError: (class: scala/runtime/ArrayCharSequence, method: <init> signature: ([C)V)
Expand Down

0 comments on commit b10abb4

Please sign in to comment.