Skip to content

Commit bb9adfb

Browse files
committed
more ListOfNil => Nil
Even more trees (together with Apply nodes produced by templateParents and New nodes produced by New in TreeBuilders) now distinguish nullary argument list from empty argument list.
1 parent 838cbe6 commit bb9adfb

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/compiler/scala/tools/nsc/ast/TreeGen.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ abstract class TreeGen extends scala.reflect.internal.TreeGen with TreeDSL {
5858
def mkUnchecked(expr: Tree): Tree = atPos(expr.pos) {
5959
// This can't be "Annotated(New(UncheckedClass), expr)" because annotations
6060
// are very picky about things and it crashes the compiler with "unexpected new".
61-
Annotated(New(scalaDot(UncheckedClass.name), ListOfNil), expr)
61+
Annotated(New(scalaDot(UncheckedClass.name), Nil), expr)
6262
}
6363
// if it's a Match, mark the selector unchecked; otherwise nothing.
6464
def mkUncheckedMatch(tree: Tree) = tree match {

src/compiler/scala/tools/nsc/ast/parser/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2106,7 +2106,7 @@ self =>
21062106
def annotationExpr(): Tree = atPos(in.offset) {
21072107
val t = exprSimpleType()
21082108
if (in.token == LPAREN) New(t, multipleArgumentExprs())
2109-
else New(t, ListOfNil)
2109+
else New(t, Nil)
21102110
}
21112111

21122112
/* -------- PARAMETERS ------------------------------------------- */

src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ abstract class TreeBuilder {
237237
atPos(npos) {
238238
New(
239239
Ident(x) setPos npos.focus,
240-
ListOfNil)
240+
Nil)
241241
}
242242
)
243243
}

src/compiler/scala/tools/nsc/javac/JavaParsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
551551
if (parentToken == AT && in.token == DEFAULT) {
552552
val annot =
553553
atPos(pos) {
554-
New(Select(scalaDot(nme.runtime), tpnme.AnnotationDefaultATTR), ListOfNil)
554+
New(Select(scalaDot(nme.runtime), tpnme.AnnotationDefaultATTR), Nil)
555555
}
556556
mods1 = mods1 withAnnotations List(annot)
557557
skipTo(SEMI)

0 commit comments

Comments
 (0)