From 9a98a9dc309ec7122abb79462f65765c161ff173 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Thu, 20 Sep 2018 16:58:04 -0700 Subject: [PATCH] use .linesIterator to work around scala/bug#11125 this incurs a deprecation warning on 2.12.6, but we don't have fatal warnings enabled in this repo. the deprecation warnings will go away once we start building on 2.12.7. --- fnGen/WrapFnGen.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fnGen/WrapFnGen.scala b/fnGen/WrapFnGen.scala index 5a953cb..f3d959a 100644 --- a/fnGen/WrapFnGen.scala +++ b/fnGen/WrapFnGen.scala @@ -58,12 +58,12 @@ object WrapFnGen { } implicit class SplitMyLinesAndStuff(s: String) { - def toVec = s.lines.toVector + def toVec = s.linesIterator.toVector def nonBlank = s.trim.length > 0 } implicit class TreeToText(t: Tree) { - def text = showCode(t).replace("$", "").lines.toVector + def text = showCode(t).replace("$", "").linesIterator.toVector } case class Prioritized(lines: Vector[String], priority: Int) { @@ -288,7 +288,7 @@ object WrapFnGen { def sameText(f: java.io.File, text: String): Boolean = { val x = scala.io.Source.fromFile(f) val lines = try { x.getLines.toVector } finally { x.close } - lines.iterator.filter(_.nonBlank) == text.lines.filter(_.nonBlank) + lines.iterator.filter(_.nonBlank) == text.linesIterator.filter(_.nonBlank) } def write(f: java.io.File, text: String): Unit = {