Skip to content

Commit 84f5b14

Browse files
committed
scala corpus compiles with 2.13.16
1 parent 47a3750 commit 84f5b14

File tree

9 files changed

+13
-10
lines changed

9 files changed

+13
-10
lines changed

corpus/scala/df29ebb/compiler/scala/tools/nsc/MainBench.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ object MainBench extends Driver with EvalLoop {
2424
var start = System.nanoTime()
2525
for (i <- 0 until NIter) {
2626
if (i == NIter-1) {
27-
theCompiler.settings.Ystatistics.default.get foreach theCompiler.settings.Ystatistics.add
27+
val s = theCompiler.settings
28+
s.Ystatistics.default.get foreach s.Ystatistics.add
2829
Statistics.enabled = true
2930
}
3031
process(args)

corpus/scala/df29ebb/compiler/scala/tools/nsc/typechecker/Contexts.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ trait Contexts { self: Analyzer =>
620620

621621
def enclosingContextChain: List[Context] = this :: outer.enclosingContextChain
622622

623-
private def treeTruncated = tree.toString.replaceAll("\\s+", " ").lines.mkString("\\n").take(70)
623+
private def treeTruncated = tree.toString.replaceAll("\\s+", " ").linesIterator.mkString("\\n").take(70)
624624
private def treeIdString = if (settings.uniqid.value) "#" + System.identityHashCode(tree).toString.takeRight(3) else ""
625625
private def treeString = tree match {
626626
case x: Import => "" + x

corpus/scala/df29ebb/compiler/scala/tools/nsc/typechecker/Typers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4655,7 +4655,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
46554655
if (e.errPos == tree.pos) {
46564656
val header = f"${e.errMsg}%n Expression does not convert to assignment because:%n "
46574657
val expansion = f"%n expansion: ${show(convo)}"
4658-
NormalTypeError(tree, err.errors.flatMap(_.errMsg.lines.toList).mkString(header, f"%n ", expansion))
4658+
NormalTypeError(tree, err.errors.flatMap(_.errMsg.linesIterator.toList).mkString(header, f"%n ", expansion))
46594659
} else e
46604660
}
46614661
def advice2(errors: List[AbsTypeError]): List[AbsTypeError] =

corpus/scala/df29ebb/compiler/scala/tools/util/PathResolver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ object PathResolver {
3434
}
3535
implicit class AsLines(val s: String) extends AnyVal {
3636
// sm"""...""" could do this in one pass
37-
def asLines = s.trim.stripMargin.lines.mkLines
37+
def asLines = s.trim.stripMargin.linesIterator.mkLines
3838
}
3939

4040
/** pretty print class path */

corpus/scala/df29ebb/library/scala/collection/concurrent/TrieMap.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ private[collection] final class CNode[K, V](val bitmap: Int, val array: Array[Ba
564564
new CNode[K, V](bmp, tmparray, gen).toContracted(lev)
565565
}
566566

567-
private[concurrent] def string(lev: Int): String = "CNode %x\n%s".format(bitmap, array.map(_.string(lev + 1)).mkString("\n"))
567+
def string(lev: Int): String = "CNode %x\n%s".format(bitmap, array.map(_.string(lev + 1)).mkString("\n"))
568568

569569
/* quiescently consistent - don't call concurrently to anything involving a GCAS!! */
570570
private def collectElems: Seq[(K, V)] = array flatMap {

corpus/scala/df29ebb/library/scala/collection/mutable/StringBuilder.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ final class StringBuilder(private val underlying: JavaStringBuilder)
3636
with ReusableBuilder[Char, String]
3737
with Serializable {
3838

39+
override def isEmpty: Boolean = underlying.length() == 0
40+
3941
override protected[this] def thisCollection: StringBuilder = this
4042
override protected[this] def toCollection(repr: StringBuilder): StringBuilder = repr
4143

corpus/scala/df29ebb/reflect/scala/reflect/internal/Printers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ trait Printers extends api.Printers { self: SymbolTable =>
10471047

10481048
case Literal(k @ Constant(s: String)) if s.contains(Chars.LF) =>
10491049
val tq = "\"" * 3
1050-
val lines = s.lines.toList
1050+
val lines = s.linesIterator.toList
10511051
if (lines.lengthCompare(1) <= 0) print(k.escapedStringValue)
10521052
else {
10531053
val tqp = """["]{3}""".r

corpus/scala/df29ebb/reflect/scala/reflect/internal/Symbols.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3348,7 +3348,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
33483348
*/
33493349
class ModuleClassSymbol protected[Symbols] (owner: Symbol, pos: Position, name: TypeName)
33503350
extends ClassSymbol(owner, pos, name) {
3351-
private[this] var module: Symbol = _
3351+
private[this] var _module: Symbol = _
33523352
private[this] var typeOfThisCache: Type = _
33533353
private[this] var typeOfThisPeriod = NoPeriod
33543354

@@ -3381,8 +3381,8 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
33813381
implicitMembersCacheValue
33823382
}
33833383
// The null check seems to be necessary for the reifier.
3384-
override def sourceModule = if (module ne null) module else companionModule
3385-
override def sourceModule_=(module: Symbol) { this.module = module }
3384+
override def sourceModule = if (_module ne null) _module else companionModule
3385+
override def sourceModule_=(module: Symbol) { this._module = module }
33863386
}
33873387

33883388
class PackageObjectClassSymbol protected[Symbols] (owner0: Symbol, pos0: Position)

corpus/scala/df29ebb/reflect/scala/reflect/internal/util/StringOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ trait StringOps {
4545
else s.substring(0, end)
4646
}
4747
/** Breaks the string into lines and strips each line before reassembling. */
48-
def trimAllTrailingSpace(s: String): String = s.lines.map(trimTrailingSpace).mkString(EOL)
48+
def trimAllTrailingSpace(s: String): String = s.linesIterator.map(trimTrailingSpace).mkString(EOL)
4949

5050
def decompose(str: String, sep: Char): List[String] = {
5151
def ws(start: Int): List[String] =

0 commit comments

Comments
 (0)