Navigation Menu

Skip to content

Commit

Permalink
more ListOfNil => Nil
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xeno-by committed Dec 6, 2012
1 parent 838cbe6 commit bb9adfb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/ast/TreeGen.scala
Expand Up @@ -58,7 +58,7 @@ abstract class TreeGen extends scala.reflect.internal.TreeGen with TreeDSL {
def mkUnchecked(expr: Tree): Tree = atPos(expr.pos) { def mkUnchecked(expr: Tree): Tree = atPos(expr.pos) {
// This can't be "Annotated(New(UncheckedClass), expr)" because annotations // This can't be "Annotated(New(UncheckedClass), expr)" because annotations
// are very picky about things and it crashes the compiler with "unexpected new". // are very picky about things and it crashes the compiler with "unexpected new".
Annotated(New(scalaDot(UncheckedClass.name), ListOfNil), expr) Annotated(New(scalaDot(UncheckedClass.name), Nil), expr)
} }
// if it's a Match, mark the selector unchecked; otherwise nothing. // if it's a Match, mark the selector unchecked; otherwise nothing.
def mkUncheckedMatch(tree: Tree) = tree match { def mkUncheckedMatch(tree: Tree) = tree match {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
Expand Up @@ -2106,7 +2106,7 @@ self =>
def annotationExpr(): Tree = atPos(in.offset) { def annotationExpr(): Tree = atPos(in.offset) {
val t = exprSimpleType() val t = exprSimpleType()
if (in.token == LPAREN) New(t, multipleArgumentExprs()) if (in.token == LPAREN) New(t, multipleArgumentExprs())
else New(t, ListOfNil) else New(t, Nil)
} }


/* -------- PARAMETERS ------------------------------------------- */ /* -------- PARAMETERS ------------------------------------------- */
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala
Expand Up @@ -237,7 +237,7 @@ abstract class TreeBuilder {
atPos(npos) { atPos(npos) {
New( New(
Ident(x) setPos npos.focus, Ident(x) setPos npos.focus,
ListOfNil) Nil)
} }
) )
} }
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/javac/JavaParsers.scala
Expand Up @@ -551,7 +551,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
if (parentToken == AT && in.token == DEFAULT) { if (parentToken == AT && in.token == DEFAULT) {
val annot = val annot =
atPos(pos) { atPos(pos) {
New(Select(scalaDot(nme.runtime), tpnme.AnnotationDefaultATTR), ListOfNil) New(Select(scalaDot(nme.runtime), tpnme.AnnotationDefaultATTR), Nil)
} }
mods1 = mods1 withAnnotations List(annot) mods1 = mods1 withAnnotations List(annot)
skipTo(SEMI) skipTo(SEMI)
Expand Down

0 comments on commit bb9adfb

Please sign in to comment.