Skip to content
This repository
Browse code

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.
  • Loading branch information...
commit bb9adfbd76af0a0281912fcef4bcaca409a7c9a3 1 parent 838cbe6
Eugene Burmako xeno-by authored
2  src/compiler/scala/tools/nsc/ast/TreeGen.scala
@@ -58,7 +58,7 @@ abstract class TreeGen extends scala.reflect.internal.TreeGen with TreeDSL {
58 58 def mkUnchecked(expr: Tree): Tree = atPos(expr.pos) {
59 59 // This can't be "Annotated(New(UncheckedClass), expr)" because annotations
60 60 // 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)
62 62 }
63 63 // if it's a Match, mark the selector unchecked; otherwise nothing.
64 64 def mkUncheckedMatch(tree: Tree) = tree match {
2  src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -2106,7 +2106,7 @@ self =>
2106 2106 def annotationExpr(): Tree = atPos(in.offset) {
2107 2107 val t = exprSimpleType()
2108 2108 if (in.token == LPAREN) New(t, multipleArgumentExprs())
2109   - else New(t, ListOfNil)
  2109 + else New(t, Nil)
2110 2110 }
2111 2111
2112 2112 /* -------- PARAMETERS ------------------------------------------- */
2  src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala
@@ -237,7 +237,7 @@ abstract class TreeBuilder {
237 237 atPos(npos) {
238 238 New(
239 239 Ident(x) setPos npos.focus,
240   - ListOfNil)
  240 + Nil)
241 241 }
242 242 )
243 243 }
2  src/compiler/scala/tools/nsc/javac/JavaParsers.scala
@@ -551,7 +551,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
551 551 if (parentToken == AT && in.token == DEFAULT) {
552 552 val annot =
553 553 atPos(pos) {
554   - New(Select(scalaDot(nme.runtime), tpnme.AnnotationDefaultATTR), ListOfNil)
  554 + New(Select(scalaDot(nme.runtime), tpnme.AnnotationDefaultATTR), Nil)
555 555 }
556 556 mods1 = mods1 withAnnotations List(annot)
557 557 skipTo(SEMI)

0 comments on commit bb9adfb

Please sign in to comment.
Something went wrong with that request. Please try again.