@@ -433,7 +433,7 @@ object Trees {
433433 case class Select [- T >: Untyped ] private [ast] (qualifier : Tree [T ], name : Name )
434434 extends RefTree [T ] {
435435 type ThisTree [- T >: Untyped ] = Select [T ]
436- def withName (name : Name )(implicit ctx : Context ): untpd.Select = untpd.cpy.Select (this )(name = name)
436+ def withName (name : Name )(implicit ctx : Context ): untpd.Select = untpd.cpy.Select (this )(qualifier, name)
437437 }
438438
439439 class SelectWithSig [- T >: Untyped ] private [ast] (qualifier : Tree [T ], name : Name , val sig : Signature )
@@ -620,7 +620,7 @@ object Trees {
620620 case class SelectFromTypeTree [- T >: Untyped ] private [ast] (qualifier : Tree [T ], name : Name )
621621 extends RefTree [T ] {
622622 type ThisTree [- T >: Untyped ] = SelectFromTypeTree [T ]
623- def withName (name : Name )(implicit ctx : Context ): untpd.SelectFromTypeTree = untpd.cpy.SelectFromTypeTree (this )(name = name)
623+ def withName (name : Name )(implicit ctx : Context ): untpd.SelectFromTypeTree = untpd.cpy.SelectFromTypeTree (this )(qualifier, name)
624624 }
625625
626626 /** left & right */
@@ -666,7 +666,7 @@ object Trees {
666666 extends NameTree [T ] with DefTree [T ] with PatternTree [T ] {
667667 type ThisTree [- T >: Untyped ] = Bind [T ]
668668 override def envelope : Position = pos union initialPos
669- def withName (name : Name )(implicit ctx : Context ): untpd.Bind = untpd.cpy.Bind (this )(name = name )
669+ def withName (name : Name )(implicit ctx : Context ): untpd.Bind = untpd.cpy.Bind (this )(name, body )
670670 }
671671
672672 /** tree_1 | ... | tree_n */
@@ -1094,24 +1094,24 @@ object Trees {
10941094 }
10951095
10961096 // Copier methods with default arguments; these demand that the original tree
1097- // is of the same class as the copy
1098-
1099- def Select (tree : Select )(qualifier : Tree = tree.qualifier, name : Name = tree.name): Select =
1100- Select (tree : Tree )(qualifier, name)
1101- def Super (tree : Super )(qual : Tree = tree.qual, mix : TypeName = tree.mix): Super =
1102- Super (tree : Tree )(qual, mix)
1103- def Apply (tree : Apply )(fun : Tree = tree.fun, args : List [Tree ] = tree.args): Apply =
1104- Apply (tree : Tree )(fun, args)
1105- def TypeApply (tree : TypeApply )(fun : Tree = tree.fun, args : List [Tree ] = tree.args): TypeApply =
1106- TypeApply (tree : Tree )(fun, args)
1107- def Typed (tree : Typed )(expr : Tree = tree.expr, tpt : Tree = tree.tpt): Typed =
1108- Typed (tree : Tree )(expr, tpt)
1109- def NamedArg (tree : NamedArg )(name : Name = tree.name, arg : Tree = tree.arg): NamedArg =
1110- NamedArg (tree : Tree )(name, arg)
1111- def Assign (tree : Assign )(lhs : Tree = tree.lhs, rhs : Tree = tree.rhs): Assign =
1112- Assign (tree : Tree )(lhs, rhs)
1113- def Block (tree : Block )(stats : List [Tree ] = tree.stats, expr : Tree = tree.expr): Block =
1114- Block (tree : Tree )(stats, expr)
1097+ // is of the same class as the copy. We only include trees with more than 2 elements here.
1098+
1099+ // def Select(tree: Select)(qualifier: Tree = tree.qualifier, name: Name = tree.name): Select =
1100+ // Select(tree: Tree)(qualifier, name)
1101+ // def Super(tree: Super)(qual: Tree = tree.qual, mix: TypeName = tree.mix): Super =
1102+ // Super(tree: Tree)(qual, mix)
1103+ // def Apply(tree: Apply)(fun: Tree = tree.fun, args: List[Tree] = tree.args): Apply =
1104+ // Apply(tree: Tree)(fun, args)
1105+ // def TypeApply(tree: TypeApply)(fun: Tree = tree.fun, args: List[Tree] = tree.args): TypeApply =
1106+ // TypeApply(tree: Tree)(fun, args)
1107+ // def Typed(tree: Typed)(expr: Tree = tree.expr, tpt: Tree = tree.tpt): Typed =
1108+ // Typed(tree: Tree)(expr, tpt)
1109+ // def NamedArg(tree: NamedArg)(name: Name = tree.name, arg: Tree = tree.arg): NamedArg =
1110+ // NamedArg(tree: Tree)(name, arg)
1111+ // def Assign(tree: Assign)(lhs: Tree = tree.lhs, rhs: Tree = tree.rhs): Assign =
1112+ // Assign(tree: Tree)(lhs, rhs)
1113+ // def Block(tree: Block)(stats: List[Tree] = tree.stats, expr: Tree = tree.expr): Block =
1114+ // Block(tree: Tree)(stats, expr)
11151115 def If (tree : If )(cond : Tree = tree.cond, thenp : Tree = tree.thenp, elsep : Tree = tree.elsep): If =
11161116 If (tree : Tree )(cond, thenp, elsep)
11171117 def Closure (tree : Closure )(env : List [Tree ] = tree.env, meth : Tree = tree.meth, tpt : Tree = tree.tpt): Closure =
@@ -1120,20 +1120,20 @@ object Trees {
11201120 Match (tree : Tree )(selector, cases)
11211121 def CaseDef (tree : CaseDef )(pat : Tree = tree.pat, guard : Tree = tree.guard, body : Tree = tree.body): CaseDef =
11221122 CaseDef (tree : Tree )(pat, guard, body)
1123- def Return (tree : Return )(expr : Tree = tree.expr, from : Tree = tree.from): Return =
1124- Return (tree : Tree )(expr, from)
1123+ // def Return(tree: Return)(expr: Tree = tree.expr, from: Tree = tree.from): Return =
1124+ // Return(tree: Tree)(expr, from)
11251125 def Try (tree : Try )(expr : Tree = tree.expr, handler : Tree = tree.handler, finalizer : Tree = tree.finalizer): Try =
11261126 Try (tree : Tree )(expr, handler, finalizer)
1127- def SelectFromTypeTree (tree : SelectFromTypeTree )(qualifier : Tree = tree.qualifier, name : Name = tree.name):
1128- SelectFromTypeTree = SelectFromTypeTree (tree : Tree )(qualifier, name)
1129- def RefinedTypeTree (tree : RefinedTypeTree )(tpt : Tree = tree.tpt, refinements : List [Tree ] = tree.refinements):
1130- RefinedTypeTree = RefinedTypeTree (tree : Tree )(tpt, refinements)
1131- def AppliedTypeTree (tree : AppliedTypeTree )(tpt : Tree = tree.tpt, args : List [Tree ] = tree.args): AppliedTypeTree =
1132- AppliedTypeTree (tree : Tree )(tpt, args)
1133- def TypeBoundsTree (tree : TypeBoundsTree )(lo : Tree = tree.lo, hi : Tree = tree.hi): TypeBoundsTree =
1134- TypeBoundsTree (tree : Tree )(lo, hi)
1135- def Bind (tree : Bind )(name : Name = tree.name, body : Tree = tree.body): Bind =
1136- Bind (tree : Tree )(name, body)
1127+ // def SelectFromTypeTree(tree: SelectFromTypeTree)(qualifier: Tree = tree.qualifier, name: Name = tree.name):
1128+ // SelectFromTypeTree = SelectFromTypeTree(tree: Tree)(qualifier, name)
1129+ // def RefinedTypeTree(tree: RefinedTypeTree)(tpt: Tree = tree.tpt, refinements: List[Tree] = tree.refinements):
1130+ // RefinedTypeTree = RefinedTypeTree(tree: Tree)(tpt, refinements)
1131+ // def AppliedTypeTree(tree: AppliedTypeTree)(tpt: Tree = tree.tpt, args: List[Tree] = tree.args): AppliedTypeTree =
1132+ // AppliedTypeTree(tree: Tree)(tpt, args)
1133+ // def TypeBoundsTree(tree: TypeBoundsTree)(lo: Tree = tree.lo, hi: Tree = tree.hi): TypeBoundsTree =
1134+ // TypeBoundsTree(tree: Tree)(lo, hi)
1135+ // def Bind(tree: Bind)(name: Name = tree.name, body: Tree = tree.body): Bind =
1136+ // Bind(tree: Tree)(name, body)
11371137 def UnApply (tree : UnApply )(fun : Tree = tree.fun, implicits : List [Tree ] = tree.implicits, patterns : List [Tree ] = tree.patterns): UnApply =
11381138 UnApply (tree : Tree )(fun, implicits, patterns)
11391139 def ValDef (tree : ValDef )(mods : Modifiers = tree.mods, name : TermName = tree.name, tpt : Tree = tree.tpt, rhs : Tree = tree.rhs): ValDef =
@@ -1144,12 +1144,12 @@ object Trees {
11441144 TypeDef (tree : Tree )(mods, name, rhs, tparams)
11451145 def Template (tree : Template )(constr : DefDef = tree.constr, parents : List [Tree ] = tree.parents, self : ValDef = tree.self, body : List [Tree ] = tree.body): Template =
11461146 Template (tree : Tree )(constr, parents, self, body)
1147- def Import (tree : Import )(expr : Tree = tree.expr, selectors : List [untpd.Tree ] = tree.selectors): Import =
1148- Import (tree : Tree )(expr, selectors)
1149- def PackageDef (tree : PackageDef )(pid : RefTree = tree.pid, stats : List [Tree ] = tree.stats): PackageDef =
1150- PackageDef (tree : Tree )(pid, stats)
1151- def Annotated (tree : Annotated )(annot : Tree = tree.annot, arg : Tree = tree.arg): Annotated =
1152- Annotated (tree : Tree )(annot, arg)
1147+ // def Import(tree: Import)(expr: Tree = tree.expr, selectors: List[untpd.Tree] = tree.selectors): Import =
1148+ // Import(tree: Tree)(expr, selectors)
1149+ // def PackageDef(tree: PackageDef)(pid: RefTree = tree.pid, stats: List[Tree] = tree.stats): PackageDef =
1150+ // PackageDef(tree: Tree)(pid, stats)
1151+ // def Annotated(tree: Annotated)(annot: Tree = tree.annot, arg: Tree = tree.arg): Annotated =
1152+ // Annotated(tree: Tree)(annot, arg)
11531153 }
11541154
11551155 abstract class TreeMap (val cpy : TreeCopier = inst.cpy) {
0 commit comments