Skip to content

Commit

Permalink
Remove references to deprecated classes
Browse files Browse the repository at this point in the history
`scala.{Traversable,TraversableOnce,BufferedIterator}` are deprecated
since 2.13.0. It seems these deprecated references where not found when
the check was performed after `FirstTransform` as the types might have
been dealiased in the `TypeTree`.
  • Loading branch information
nicolasstucki committed Apr 18, 2023
1 parent 46df5a2 commit c4766d6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/config/PathResolver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class PathResolver(using c: Context) {
import classPathFactory._

// Assemble the elements!
def basis: List[Traversable[ClassPath]] =
def basis: List[Iterable[ClassPath]] =
val release = Option(ctx.settings.javaOutputVersion.value).filter(_.nonEmpty)

List(
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ object SymDenotations {
}

/** Add all given annotations to this symbol */
final def addAnnotations(annots: TraversableOnce[Annotation])(using Context): Unit =
final def addAnnotations(annots: IterableOnce[Annotation])(using Context): Unit =
annots.iterator.foreach(addAnnotation)

@tailrec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ package xml

import Utility._
import util.Chars.SU


import scala.collection.BufferedIterator

/** This is not a public trait - it contains common code shared
* between the library level XML parser and the compiler's.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package xml
import scala.language.unsafeNulls

import scala.collection.mutable
import scala.collection.BufferedIterator
import core.Contexts.Context
import mutable.{ Buffer, ArrayBuffer, ListBuffer }
import scala.util.control.ControlThrowable
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/printing/Printer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ abstract class Printer {
atPrec(GlobalPrec) { elem.toText(this) }

/** Render elements alternating with `sep` string */
def toText(elems: Traversable[Showable], sep: String): Text =
def toText(elems: Iterable[Showable], sep: String): Text =
Text(elems map (_ toText this), sep)

/** Render elements within highest precedence */
def toTextLocal(elems: Traversable[Showable], sep: String): Text =
def toTextLocal(elems: Iterable[Showable], sep: String): Text =
atPrec(DotPrec) { toText(elems, sep) }

/** Render elements within lowest precedence */
def toTextGlobal(elems: Traversable[Showable], sep: String): Text =
def toTextGlobal(elems: Iterable[Showable], sep: String): Text =
atPrec(GlobalPrec) { toText(elems, sep) }

/** A plain printer without any embellishments */
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/printing/Texts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ object Texts {
/** A concatenation of elements in `xs` and interspersed with
* separator strings `sep`.
*/
def apply(xs: Traversable[Text], sep: String = " "): Text =
def apply(xs: Iterable[Text], sep: String = " "): Text =
if (sep == "\n") lines(xs)
else {
val ys = xs.filterNot(_.isEmpty)
Expand All @@ -182,7 +182,7 @@ object Texts {
}

/** The given texts `xs`, each on a separate line */
def lines(xs: Traversable[Text]): Vertical = Vertical(xs.toList.reverse)
def lines(xs: Iterable[Text]): Vertical = Vertical(xs.toList.reverse)

extension (text: => Text)
def provided(cond: Boolean): Text = if (cond) text else Str("")
Expand Down

0 comments on commit c4766d6

Please sign in to comment.