Skip to content

Commit

Permalink
Merge pull request #4561 from sjrd/no-toiterable
Browse files Browse the repository at this point in the history
Remove all uses of toIterable in code compiled with Scala 2.13.x.
  • Loading branch information
sjrd committed Sep 29, 2021
2 parents ccd8cf0 + a5b1ea3 commit 0d04e61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ object JUnitTestPlatformImpl {
}

def writeLines(lines: List[String], file: String): Unit =
Files.write(Paths.get(file), lines.toIterable.asJava, UTF_8)
Files.write(Paths.get(file), (lines: Iterable[String]).asJava, UTF_8)

def readLines(file: String): List[String] =
Files.readAllLines(Paths.get(file), UTF_8).asScala.toList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class EntryPointAnalyzerBackend(linkerConfig: StandardConfig,
implicit ec: ExecutionContext): Future[Report] = {

val modules = moduleSet.modules.flatMap(_.externalDependencies).toSet
Files.write(entryPointOutputFile, modules.toIterable.asJava,
Files.write(entryPointOutputFile, (modules: Iterable[String]).asJava,
StandardCharsets.UTF_8)

standard.emit(moduleSet, output, logger)
Expand Down
4 changes: 2 additions & 2 deletions scalalib/overrides-2.13/scala/Enumeration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ abstract class Enumeration (initial: Int) extends Serializable {
override protected def fromSpecific(coll: IterableOnce[Value]) = ValueSet.fromSpecific(coll)
override protected def newSpecificBuilder = ValueSet.newBuilder

def map(f: Value => Value): ValueSet = fromSpecific(new View.Map(toIterable, f))
def flatMap(f: Value => IterableOnce[Value]): ValueSet = fromSpecific(new View.FlatMap(toIterable, f))
def map(f: Value => Value): ValueSet = fromSpecific(new View.Map(this, f))
def flatMap(f: Value => IterableOnce[Value]): ValueSet = fromSpecific(new View.FlatMap(this, f))

// necessary for disambiguation:
override def map[B](f: Value => B)(implicit @implicitNotFound(ValueSet.ordMsg) ev: Ordering[B]): immutable.SortedSet[B] =
Expand Down

0 comments on commit 0d04e61

Please sign in to comment.