Skip to content

Commit 0fdb604

Browse files
authored
Merge pull request #49 from retronym/topic/2.13-restore
Minor changes to the scala corpus for 2.13 compat
2 parents 922af4d + 78c72cf commit 0fdb604

File tree

8 files changed

+37
-37
lines changed

8 files changed

+37
-37
lines changed

corpus/scala/21d12e9/compiler/scala/tools/nsc/ast/parser/Parsers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,7 +1971,7 @@ self =>
19711971
* }}}
19721972
*/
19731973
def pattern3(): Tree = {
1974-
val top = simplePattern(badPattern3)
1974+
val top = simplePattern(() => badPattern3())
19751975
val base = opstack
19761976
// See SI-3189, SI-4832 for motivation. Cf SI-3480 for counter-motivation.
19771977
def isCloseDelim = in.token match {
@@ -1987,7 +1987,7 @@ self =>
19871987
case _ => EmptyTree
19881988
}
19891989
def loop(top: Tree): Tree = reducePatternStack(base, top) match {
1990-
case next if isIdent && !isRawBar => pushOpInfo(next) ; loop(simplePattern(badPattern3))
1990+
case next if isIdent && !isRawBar => pushOpInfo(next) ; loop(simplePattern(() => badPattern3()))
19911991
case next => next
19921992
}
19931993
checkWildStar orElse stripParens(loop(top))

corpus/scala/21d12e9/compiler/scala/tools/nsc/ast/parser/Scanners.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,9 @@ trait Scanners extends ScannersCommon {
546546
def fetchSingleQuote() = {
547547
nextChar()
548548
if (isIdentifierStart(ch))
549-
charLitOr(getIdentRest)
549+
charLitOr(() => getIdentRest())
550550
else if (isOperatorPart(ch) && (ch != '\\'))
551-
charLitOr(getOperatorRest)
551+
charLitOr(() => getOperatorRest())
552552
else if (!isAtEnd && (ch != SU && ch != CR && ch != LF || isUnicodeEscape)) {
553553
getLitChar()
554554
if (ch == '\'') {

corpus/scala/21d12e9/compiler/scala/tools/nsc/javac/JavaParsers.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
315315
if (in.token == LT) {
316316
in.nextToken()
317317
val t1 = convertToTypeId(t)
318-
val args = repsep(typeArg, COMMA)
318+
val args = repsep(() => typeArg(), COMMA)
319319
acceptClosingAngle()
320320
atPos(t1.pos) {
321321
val t2: Tree = AppliedTypeTree(t1, args)
@@ -401,7 +401,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
401401
def typeParams(): List[TypeDef] =
402402
if (in.token == LT) {
403403
in.nextToken()
404-
val tparams = repsep(typeParam, COMMA)
404+
val tparams = repsep(() => typeParam(), COMMA)
405405
acceptClosingAngle()
406406
tparams
407407
} else List()
@@ -428,7 +428,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
428428

429429
def formalParams(): List[ValDef] = {
430430
accept(LPAREN)
431-
val vparams = if (in.token == RPAREN) List() else repsep(formalParam, COMMA)
431+
val vparams = if (in.token == RPAREN) List() else repsep(() => formalParam(), COMMA)
432432
accept(RPAREN)
433433
vparams
434434
}
@@ -449,7 +449,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
449449
def optThrows() {
450450
if (in.token == THROWS) {
451451
in.nextToken()
452-
repsep(typ, COMMA)
452+
repsep(() => typ(), COMMA)
453453
}
454454
}
455455

@@ -679,7 +679,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
679679
def interfacesOpt() =
680680
if (in.token == IMPLEMENTS) {
681681
in.nextToken()
682-
repsep(typ, COMMA)
682+
repsep(() => typ(), COMMA)
683683
} else {
684684
List()
685685
}
@@ -711,7 +711,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
711711
val parents =
712712
if (in.token == EXTENDS) {
713713
in.nextToken()
714-
repsep(typ, COMMA)
714+
repsep(() => typ(), COMMA)
715715
} else {
716716
List(javaLangObject())
717717
}

corpus/scala/21d12e9/compiler/scala/tools/nsc/transform/patmat/MatchOptimization.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ trait MatchOptimization extends MatchTreeMaking with MatchAnalysis {
104104
reusedTest <- test.reuses;
105105
nextDeps <- dependencies.get(reusedTest);
106106
diff <- (nextDeps -- currDeps).headOption;
107-
_ <- Some(currDeps = nextDeps))
107+
_ <- {currDeps = nextDeps; Some(currDeps)})
108108
yield diff).nonEmpty
109109
}
110110

corpus/scala/21d12e9/compiler/scala/tools/nsc/typechecker/Typers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
757757
if (immediate) {
758758
action()
759759
} else {
760-
unit.toCheck += action
760+
unit.toCheck += {() => action}
761761
true
762762
}
763763
}

corpus/scala/21d12e9/compiler/scala/tools/nsc/util/ShowPickled.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,17 @@ object ShowPickled extends Names {
210210
case CONSTANTtpe =>
211211
printTypeRef(); printConstantRef()
212212
case TYPEREFtpe =>
213-
printTypeRef(); printSymbolRef(); buf.until(end, printTypeRef)
213+
printTypeRef(); printSymbolRef(); buf.until(end, () => printTypeRef())
214214
case TYPEBOUNDStpe =>
215215
printTypeRef(); printTypeRef()
216216
case REFINEDtpe =>
217-
printSymbolRef(); buf.until(end, printTypeRef)
217+
printSymbolRef(); buf.until(end, () => printTypeRef())
218218
case CLASSINFOtpe =>
219-
printSymbolRef(); buf.until(end, printTypeRef)
219+
printSymbolRef(); buf.until(end, () => printTypeRef())
220220
case METHODtpe | IMPLICITMETHODtpe =>
221-
printTypeRef(); buf.until(end, printTypeRef)
221+
printTypeRef(); buf.until(end, () => printTypeRef())
222222
case POLYtpe =>
223-
printTypeRef(); buf.until(end, printSymbolRef)
223+
printTypeRef(); buf.until(end, () => printSymbolRef())
224224
case LITERALboolean =>
225225
out.print(if (buf.readLong(len) == 0L) " false" else " true")
226226
case LITERALbyte =>
@@ -246,17 +246,17 @@ object ShowPickled extends Names {
246246
case LITERALclass =>
247247
printTypeRef()
248248
case CHILDREN =>
249-
printSymbolRef(); buf.until(end, printSymbolRef)
249+
printSymbolRef(); buf.until(end, () => printSymbolRef())
250250
case SYMANNOT =>
251-
printSymbolRef(); printTypeRef(); buf.until(end, printAnnotArgRef)
251+
printSymbolRef(); printTypeRef(); buf.until(end, () => printAnnotArgRef())
252252
case ANNOTATEDtpe =>
253-
printTypeRef(); buf.until(end, printAnnotInfoRef)
253+
printTypeRef(); buf.until(end, () => printAnnotInfoRef())
254254
case ANNOTINFO =>
255-
printTypeRef(); buf.until(end, printAnnotArgRef)
255+
printTypeRef(); buf.until(end, () => printAnnotArgRef())
256256
case ANNOTARGARRAY =>
257-
buf.until(end, printConstAnnotArgRef)
257+
buf.until(end, () => printConstAnnotArgRef())
258258
case EXISTENTIALtpe =>
259-
printTypeRef(); buf.until(end, printSymbolRef)
259+
printTypeRef(); buf.until(end, () => printSymbolRef())
260260

261261
case _ =>
262262
}

corpus/scala/21d12e9/library/scala/sys/process/BasicIO.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ object BasicIO {
162162
*/
163163
def processFully(processLine: String => Unit): InputStream => Unit = in => {
164164
val reader = new BufferedReader(new InputStreamReader(in))
165-
try processLinesFully(processLine)(reader.readLine)
165+
try processLinesFully(processLine)(() => reader.readLine())
166166
finally reader.close()
167167
}
168168

corpus/scala/21d12e9/reflect/scala/reflect/internal/pickling/UnPickler.scala

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ abstract class UnPickler {
146146
}
147147

148148
private def maybeReadSymbol(): Either[Int, Symbol] = readNat() match {
149-
case index if isSymbolRef(index) => Right(at(index, readSymbol))
149+
case index if isSymbolRef(index) => Right(at(index, () => readSymbol()))
150150
case index => Left(index)
151151
}
152152

@@ -268,7 +268,7 @@ abstract class UnPickler {
268268

269269
// symbols that were pickled with Pickler.writeSymInfo
270270
val nameref = readNat()
271-
val name = at(nameref, readName)
271+
val name = at(nameref, () => readName())
272272
val owner = readSymbolRef()
273273
val flags = pickledToRawFlags(readLongNat())
274274

@@ -446,9 +446,9 @@ abstract class UnPickler {
446446
* as a Constant or a Tree.
447447
*/
448448
protected def readAnnotArg(i: Int): Tree = bytes(index(i)) match {
449-
case TREE => at(i, readTree)
449+
case TREE => at(i, () => readTree())
450450
case _ =>
451-
val const = at(i, readConstant)
451+
val const = at(i, () => readConstant())
452452
Literal(const) setType const.tpe
453453
}
454454

@@ -460,9 +460,9 @@ abstract class UnPickler {
460460
until(end, () => readClassfileAnnotArg(readNat())).toArray(JavaArgumentTag)
461461
}
462462
protected def readClassfileAnnotArg(i: Int): ClassfileAnnotArg = bytes(index(i)) match {
463-
case ANNOTINFO => NestedAnnotArg(at(i, readAnnotation))
463+
case ANNOTINFO => NestedAnnotArg(at(i, () => readAnnotation()))
464464
case ANNOTARGARRAY => at(i, () => ArrayAnnotArg(readArrayAnnot()))
465-
case _ => LiteralAnnotArg(at(i, readConstant))
465+
case _ => LiteralAnnotArg(at(i, () => readConstant()))
466466
}
467467

468468
/** Read an AnnotationInfo. Not to be called directly, use
@@ -475,7 +475,7 @@ abstract class UnPickler {
475475
while (readIndex != end) {
476476
val argref = readNat()
477477
if (isNameEntry(argref)) {
478-
val name = at(argref, readName)
478+
val name = at(argref, () => readName())
479479
val arg = readClassfileAnnotArg(readNat())
480480
assocs += ((name, arg))
481481
}
@@ -634,12 +634,12 @@ abstract class UnPickler {
634634
r.asInstanceOf[Symbol]
635635
}
636636

637-
protected def readNameRef(): Name = at(readNat(), readName)
637+
protected def readNameRef(): Name = at(readNat(), () => readName())
638638
protected def readTypeRef(): Type = at(readNat(), () => readType()) // after the NMT_TRANSITION period, we can leave off the () => ... ()
639-
protected def readConstantRef(): Constant = at(readNat(), readConstant)
640-
protected def readAnnotationRef(): AnnotationInfo = at(readNat(), readAnnotation)
641-
protected def readModifiersRef(): Modifiers = at(readNat(), readModifiers)
642-
protected def readTreeRef(): Tree = at(readNat(), readTree)
639+
protected def readConstantRef(): Constant = at(readNat(), () => readConstant())
640+
protected def readAnnotationRef(): AnnotationInfo = at(readNat(), () => readAnnotation())
641+
protected def readModifiersRef(): Modifiers = at(readNat(), () => readModifiers())
642+
protected def readTreeRef(): Tree = at(readNat(), () => readTree())
643643

644644
protected def readTypeNameRef(): TypeName = readNameRef().toTypeName
645645

@@ -749,7 +749,7 @@ abstract class UnPickler {
749749
override def completeInternal(sym: Symbol) = try {
750750
super.completeInternal(sym)
751751

752-
var alias = at(j, readSymbol)
752+
var alias = at(j, () => readSymbol())
753753
if (alias.isOverloaded)
754754
alias = slowButSafeEnteringPhase(picklerPhase)((alias suchThat (alt => sym.tpe =:= sym.owner.thisType.memberType(alt))))
755755

0 commit comments

Comments
 (0)