@@ -153,7 +153,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
153153 ta.assignType(untpd.SeqLiteral (elems, elemtpt), elems, elemtpt)
154154
155155 def JavaSeqLiteral (elems : List [Tree ], elemtpt : Tree )(implicit ctx : Context ): JavaSeqLiteral =
156- ta.assignType(new untpd.JavaSeqLiteral (elems, elemtpt), elems, elemtpt).asInstanceOf [JavaSeqLiteral ]
156+ ta.assignType(untpd.JavaSeqLiteral (elems, elemtpt), elems, elemtpt).asInstanceOf [JavaSeqLiteral ]
157157
158158 def Inlined (call : Tree , bindings : List [MemberDef ], expansion : Tree )(implicit ctx : Context ): Inlined =
159159 ta.assignType(untpd.Inlined (call, bindings, expansion), bindings, expansion)
@@ -231,7 +231,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
231231 def valueParamss (tp : Type ): (List [List [TermSymbol ]], Type ) = tp match {
232232 case tp : MethodType =>
233233 val isParamDependent = tp.isParamDependent
234- val previousParamRefs = if (isParamDependent) new mutable.ListBuffer [TermRef ]() else null
234+ val previousParamRefs = if (isParamDependent) mutable.ListBuffer [TermRef ]() else null
235235
236236 def valueParam (name : TermName , origInfo : Type ): TermSymbol = {
237237 val maybeImplicit =
@@ -294,7 +294,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
294294 val newTypeParams =
295295 for (tparam <- cls.typeParams if ! (bodyTypeParams contains tparam))
296296 yield TypeDef (tparam)
297- val findLocalDummy = new FindLocalDummyAccumulator (cls)
297+ val findLocalDummy = FindLocalDummyAccumulator (cls)
298298 val localDummy = ((NoSymbol : Symbol ) /: body)(findLocalDummy.apply)
299299 .orElse(ctx.newLocalDummy(cls))
300300 val impl = untpd.Template (constr, parents, Nil , selfType, newTypeParams ++ body)
@@ -391,7 +391,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
391391 private def followOuterLinks (t : Tree )(implicit ctx : Context ) = t match {
392392 case t : This if ctx.erasedTypes && ! (t.symbol == ctx.owner.enclosingClass || t.symbol.isStaticOwner) =>
393393 // after erasure outer paths should be respected
394- new ExplicitOuter .OuterOps (ctx).path(toCls = t.tpe.widen.classSymbol)
394+ ExplicitOuter .OuterOps (ctx).path(toCls = t.tpe.widen.classSymbol)
395395 case t =>
396396 t
397397 }
@@ -538,9 +538,9 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
538538 }
539539
540540 override val cpy : TypedTreeCopier = // Type ascription needed to pick up any new members in TreeCopier (currently there are none)
541- new TypedTreeCopier
541+ TypedTreeCopier ()
542542
543- val cpyBetweenPhases : TimeTravellingTreeCopier = new TimeTravellingTreeCopier
543+ val cpyBetweenPhases : TimeTravellingTreeCopier = TimeTravellingTreeCopier ()
544544
545545 class TypedTreeCopier extends TreeCopier {
546546 def postProcess (tree : Tree , copied : untpd.Tree ): copied.ThisTree [Type ] =
@@ -746,16 +746,16 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
746746 }
747747
748748 def shallowFold [T ](z : T )(op : (T , tpd.Tree ) => T )(implicit ctx : Context ): T =
749- new ShallowFolder (op).apply(z, tree)
749+ ShallowFolder (op).apply(z, tree)
750750
751751 def deepFold [T ](z : T )(op : (T , tpd.Tree ) => T )(implicit ctx : Context ): T =
752- new DeepFolder (op).apply(z, tree)
752+ DeepFolder (op).apply(z, tree)
753753
754754 def find [T ](pred : (tpd.Tree ) => Boolean )(implicit ctx : Context ): Option [tpd.Tree ] =
755755 shallowFold[Option [tpd.Tree ]](None )((accum, tree) => if (pred(tree)) Some (tree) else accum)
756756
757757 def subst (from : List [Symbol ], to : List [Symbol ])(implicit ctx : Context ): ThisTree =
758- new TreeTypeMap (substFrom = from, substTo = to).apply(tree)
758+ TreeTypeMap (substFrom = from, substTo = to).apply(tree)
759759
760760 /** Change owner from `from` to `to`. If `from` is a weak owner, also change its
761761 * owner to `to`, and continue until a non-weak owner is reached.
@@ -766,7 +766,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
766766 loop(from.owner, from :: froms, to :: tos)
767767 else {
768768 // println(i"change owner ${from :: froms}%, % ==> $tos of $tree")
769- new TreeTypeMap (oldOwners = from :: froms, newOwners = tos).apply(tree)
769+ TreeTypeMap (oldOwners = from :: froms, newOwners = tos).apply(tree)
770770 }
771771 }
772772 if (from == to) tree else loop(from, Nil , to :: Nil )
@@ -788,7 +788,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
788788 }
789789 val owners = ownerAcc(immutable.Set .empty[Symbol ], tree).toList
790790 val newOwners = List .fill(owners.size)(newOwner)
791- new TreeTypeMap (oldOwners = owners, newOwners = newOwners).apply(tree)
791+ TreeTypeMap (oldOwners = owners, newOwners = newOwners).apply(tree)
792792 }
793793
794794 /** After phase `trans`, set the owner of every definition in this tree that was formerly
@@ -1008,7 +1008,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
10081008 }
10091009
10101010 /** Replace Ident nodes references to the underlying tree that defined them */
1011- def underlying (implicit ctx : Context ): Tree = new MapToUnderlying ().transform(tree)
1011+ def underlying (implicit ctx : Context ): Tree = MapToUnderlying ().transform(tree)
10121012
10131013 // --- Higher order traversal methods -------------------------------
10141014
@@ -1030,7 +1030,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
10301030
10311031 /** All subtrees of this tree that satisfy predicate `p`. */
10321032 def filterSubTrees (f : Tree => Boolean )(implicit ctx : Context ): List [Tree ] = {
1033- val buf = new mutable.ListBuffer [Tree ]
1033+ val buf = mutable.ListBuffer [Tree ]()
10341034 foreachSubTree { tree => if (f(tree)) buf += tree }
10351035 buf.toList
10361036 }
@@ -1137,7 +1137,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
11371137 def applyOverloaded (receiver : Tree , method : TermName , args : List [Tree ], targs : List [Type ],
11381138 expectedType : Type , isContextual : Boolean = false )(implicit ctx : Context ): Tree = {
11391139 val typer = ctx.typer
1140- val proto = new FunProtoTyped (args, expectedType)(typer, isContextual)
1140+ val proto = FunProtoTyped (args, expectedType)(typer, isContextual)
11411141 val denot = receiver.tpe.member(method)
11421142 assert(denot.exists, i " no member $receiver . $method, members = ${receiver.tpe.decls}" )
11431143 val selected =
@@ -1162,7 +1162,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
11621162 val fun = receiver.select(selected).appliedToTypes(targs)
11631163
11641164 val apply = untpd.Apply (fun, args)
1165- new typer.ApplyToTyped (apply, fun, selected, args, expectedType).result.asInstanceOf [Tree ] // needed to handle varargs
1165+ typer.ApplyToTyped (apply, fun, selected, args, expectedType).result.asInstanceOf [Tree ] // needed to handle varargs
11661166 }
11671167
11681168 @ tailrec
@@ -1221,7 +1221,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
12211221 }
12221222
12231223 /** A key to be used in a context property that tracks enclosing inlined calls */
1224- private val InlinedCalls = new Property .Key [List [Tree ]]
1224+ private val InlinedCalls = Property .Key [List [Tree ]]()
12251225
12261226 /** Record an enclosing inlined call.
12271227 * EmptyTree calls (for parameters) cancel the next-enclosing call in the list instead of being added to it.
0 commit comments