@@ -984,8 +984,6 @@ object Trees {
984984 /** Soucre of the copied tree */
985985 protected def sourceFile (tree : Tree ): SourceFile = tree.source
986986
987- protected def sameSourceFile (tree : Tree ): Boolean = tree.source == sourceFile(tree)
988-
989987 protected def finalize (tree : Tree , copied : untpd.Tree ): copied.ThisTree [T ] =
990988 postProcess(tree, copied.withSpan(tree.span).withAttachmentsFrom(tree))
991989
@@ -994,16 +992,16 @@ object Trees {
994992
995993 def Ident (tree : Tree )(name : Name )(implicit ctx : Context ): Ident = tree match {
996994 case tree : BackquotedIdent =>
997- if (name == tree.name && sameSourceFile(tree) ) tree
995+ if (name == tree.name) tree
998996 else finalize(tree, new BackquotedIdent (name)(sourceFile(tree)))
999- case tree : Ident if name == tree.name && sameSourceFile(tree) => tree
997+ case tree : Ident if name == tree.name => tree
1000998 case _ => finalize(tree, untpd.Ident (name)(sourceFile(tree)))
1001999 }
10021000 def Select (tree : Tree )(qualifier : Tree , name : Name )(implicit ctx : Context ): Select = tree match {
10031001 case tree : SelectWithSig =>
10041002 if ((qualifier eq tree.qualifier) && (name == tree.name)) tree
10051003 else finalize(tree, new SelectWithSig (qualifier, name, tree.sig)(sourceFile(tree)))
1006- case tree : Select if (qualifier eq tree.qualifier) && (name == tree.name) && sameSourceFile(tree) => tree
1004+ case tree : Select if (qualifier eq tree.qualifier) && (name == tree.name) => tree
10071005 case _ => finalize(tree, untpd.Select (qualifier, name)(sourceFile(tree)))
10081006 }
10091007 /** Copy Ident or Select trees */
@@ -1012,169 +1010,169 @@ object Trees {
10121010 case Select (qual, _) => Select (tree)(qual, name)
10131011 }
10141012 def This (tree : Tree )(qual : untpd.Ident )(implicit ctx : Context ): This = tree match {
1015- case tree : This if (qual eq tree.qual) && sameSourceFile(tree) => tree
1013+ case tree : This if (qual eq tree.qual) => tree
10161014 case _ => finalize(tree, untpd.This (qual)(sourceFile(tree)))
10171015 }
10181016 def Super (tree : Tree )(qual : Tree , mix : untpd.Ident )(implicit ctx : Context ): Super = tree match {
1019- case tree : Super if (qual eq tree.qual) && (mix eq tree.mix) && sameSourceFile(tree) => tree
1017+ case tree : Super if (qual eq tree.qual) && (mix eq tree.mix) => tree
10201018 case _ => finalize(tree, untpd.Super (qual, mix)(sourceFile(tree)))
10211019 }
10221020 def Apply (tree : Tree )(fun : Tree , args : List [Tree ])(implicit ctx : Context ): Apply = tree match {
1023- case tree : Apply if (fun eq tree.fun) && (args eq tree.args) && sameSourceFile(tree) => tree
1021+ case tree : Apply if (fun eq tree.fun) && (args eq tree.args) => tree
10241022 case _ => finalize(tree, untpd.Apply (fun, args)(sourceFile(tree)))
10251023 }
10261024 def TypeApply (tree : Tree )(fun : Tree , args : List [Tree ])(implicit ctx : Context ): TypeApply = tree match {
1027- case tree : TypeApply if (fun eq tree.fun) && (args eq tree.args) && sameSourceFile(tree) => tree
1025+ case tree : TypeApply if (fun eq tree.fun) && (args eq tree.args) => tree
10281026 case _ => finalize(tree, untpd.TypeApply (fun, args)(sourceFile(tree)))
10291027 }
10301028 def Literal (tree : Tree )(const : Constant )(implicit ctx : Context ): Literal = tree match {
1031- case tree : Literal if const == tree.const && sameSourceFile(tree) => tree
1029+ case tree : Literal if const == tree.const => tree
10321030 case _ => finalize(tree, untpd.Literal (const)(sourceFile(tree)))
10331031 }
10341032 def New (tree : Tree )(tpt : Tree )(implicit ctx : Context ): New = tree match {
1035- case tree : New if (tpt eq tree.tpt) && sameSourceFile(tree) => tree
1033+ case tree : New if (tpt eq tree.tpt) => tree
10361034 case _ => finalize(tree, untpd.New (tpt)(sourceFile(tree)))
10371035 }
10381036 def Typed (tree : Tree )(expr : Tree , tpt : Tree )(implicit ctx : Context ): Typed = tree match {
1039- case tree : Typed if (expr eq tree.expr) && (tpt eq tree.tpt) && sameSourceFile(tree) => tree
1037+ case tree : Typed if (expr eq tree.expr) && (tpt eq tree.tpt) => tree
10401038 case tree => finalize(tree, untpd.Typed (expr, tpt)(sourceFile(tree)))
10411039 // .ensuring(res => res.uniqueId != 1471, s"source = $tree, ${tree.uniqueId}")
10421040 }
10431041 def NamedArg (tree : Tree )(name : Name , arg : Tree )(implicit ctx : Context ): NamedArg = tree match {
1044- case tree : NamedArg if (name == tree.name) && (arg eq tree.arg) && sameSourceFile(tree) => tree
1042+ case tree : NamedArg if (name == tree.name) && (arg eq tree.arg) => tree
10451043 case _ => finalize(tree, untpd.NamedArg (name, arg)(sourceFile(tree)))
10461044 }
10471045 def Assign (tree : Tree )(lhs : Tree , rhs : Tree )(implicit ctx : Context ): Assign = tree match {
1048- case tree : Assign if (lhs eq tree.lhs) && (rhs eq tree.rhs) && sameSourceFile(tree) => tree
1046+ case tree : Assign if (lhs eq tree.lhs) && (rhs eq tree.rhs) => tree
10491047 case _ => finalize(tree, untpd.Assign (lhs, rhs)(sourceFile(tree)))
10501048 }
10511049 def Block (tree : Tree )(stats : List [Tree ], expr : Tree )(implicit ctx : Context ): Block = tree match {
1052- case tree : Block if (stats eq tree.stats) && (expr eq tree.expr) && sameSourceFile(tree) => tree
1050+ case tree : Block if (stats eq tree.stats) && (expr eq tree.expr) => tree
10531051 case _ => finalize(tree, untpd.Block (stats, expr)(sourceFile(tree)))
10541052 }
10551053 def If (tree : Tree )(cond : Tree , thenp : Tree , elsep : Tree )(implicit ctx : Context ): If = tree match {
1056- case tree : If if (cond eq tree.cond) && (thenp eq tree.thenp) && (elsep eq tree.elsep) && sameSourceFile(tree) => tree
1054+ case tree : If if (cond eq tree.cond) && (thenp eq tree.thenp) && (elsep eq tree.elsep) => tree
10571055 case tree : InlineIf => finalize(tree, untpd.InlineIf (cond, thenp, elsep)(sourceFile(tree)))
10581056 case _ => finalize(tree, untpd.If (cond, thenp, elsep)(sourceFile(tree)))
10591057 }
10601058 def Closure (tree : Tree )(env : List [Tree ], meth : Tree , tpt : Tree )(implicit ctx : Context ): Closure = tree match {
1061- case tree : Closure if (env eq tree.env) && (meth eq tree.meth) && (tpt eq tree.tpt) && sameSourceFile(tree) => tree
1059+ case tree : Closure if (env eq tree.env) && (meth eq tree.meth) && (tpt eq tree.tpt) => tree
10621060 case _ => finalize(tree, untpd.Closure (env, meth, tpt)(sourceFile(tree)))
10631061 }
10641062 def Match (tree : Tree )(selector : Tree , cases : List [CaseDef ])(implicit ctx : Context ): Match = tree match {
1065- case tree : Match if (selector eq tree.selector) && (cases eq tree.cases) && sameSourceFile(tree) => tree
1063+ case tree : Match if (selector eq tree.selector) && (cases eq tree.cases) => tree
10661064 case tree : InlineMatch => finalize(tree, untpd.InlineMatch (selector, cases)(sourceFile(tree)))
10671065 case _ => finalize(tree, untpd.Match (selector, cases)(sourceFile(tree)))
10681066 }
10691067 def CaseDef (tree : Tree )(pat : Tree , guard : Tree , body : Tree )(implicit ctx : Context ): CaseDef = tree match {
1070- case tree : CaseDef if (pat eq tree.pat) && (guard eq tree.guard) && (body eq tree.body) && sameSourceFile(tree) => tree
1068+ case tree : CaseDef if (pat eq tree.pat) && (guard eq tree.guard) && (body eq tree.body) => tree
10711069 case _ => finalize(tree, untpd.CaseDef (pat, guard, body)(sourceFile(tree)))
10721070 }
10731071 def Labeled (tree : Tree )(bind : Bind , expr : Tree )(implicit ctx : Context ): Labeled = tree match {
1074- case tree : Labeled if (bind eq tree.bind) && (expr eq tree.expr) && sameSourceFile(tree) => tree
1072+ case tree : Labeled if (bind eq tree.bind) && (expr eq tree.expr) => tree
10751073 case _ => finalize(tree, untpd.Labeled (bind, expr)(sourceFile(tree)))
10761074 }
10771075 def Return (tree : Tree )(expr : Tree , from : Tree )(implicit ctx : Context ): Return = tree match {
1078- case tree : Return if (expr eq tree.expr) && (from eq tree.from) && sameSourceFile(tree) => tree
1076+ case tree : Return if (expr eq tree.expr) && (from eq tree.from) => tree
10791077 case _ => finalize(tree, untpd.Return (expr, from)(sourceFile(tree)))
10801078 }
10811079 def WhileDo (tree : Tree )(cond : Tree , body : Tree )(implicit ctx : Context ): WhileDo = tree match {
1082- case tree : WhileDo if (cond eq tree.cond) && (body eq tree.body) && sameSourceFile(tree) => tree
1080+ case tree : WhileDo if (cond eq tree.cond) && (body eq tree.body) => tree
10831081 case _ => finalize(tree, untpd.WhileDo (cond, body)(sourceFile(tree)))
10841082 }
10851083 def Try (tree : Tree )(expr : Tree , cases : List [CaseDef ], finalizer : Tree )(implicit ctx : Context ): Try = tree match {
1086- case tree : Try if (expr eq tree.expr) && (cases eq tree.cases) && (finalizer eq tree.finalizer) && sameSourceFile(tree) => tree
1084+ case tree : Try if (expr eq tree.expr) && (cases eq tree.cases) && (finalizer eq tree.finalizer) => tree
10871085 case _ => finalize(tree, untpd.Try (expr, cases, finalizer)(sourceFile(tree)))
10881086 }
10891087 def SeqLiteral (tree : Tree )(elems : List [Tree ], elemtpt : Tree )(implicit ctx : Context ): SeqLiteral = tree match {
10901088 case tree : JavaSeqLiteral =>
1091- if ((elems eq tree.elems) && (elemtpt eq tree.elemtpt) && sameSourceFile(tree) ) tree
1092- else finalize(tree, new JavaSeqLiteral (elems, elemtpt))
1093- case tree : SeqLiteral if (elems eq tree.elems) && (elemtpt eq tree.elemtpt) && sameSourceFile(tree) => tree
1089+ if ((elems eq tree.elems) && (elemtpt eq tree.elemtpt)) tree
1090+ else finalize(tree, untpd. JavaSeqLiteral (elems, elemtpt))
1091+ case tree : SeqLiteral if (elems eq tree.elems) && (elemtpt eq tree.elemtpt) => tree
10941092 case _ => finalize(tree, untpd.SeqLiteral (elems, elemtpt)(sourceFile(tree)))
10951093 }
10961094 def Inlined (tree : Tree )(call : tpd.Tree , bindings : List [MemberDef ], expansion : Tree )(implicit ctx : Context ): Inlined = tree match {
1097- case tree : Inlined if (call eq tree.call) && (bindings eq tree.bindings) && (expansion eq tree.expansion) && sameSourceFile(tree) => tree
1095+ case tree : Inlined if (call eq tree.call) && (bindings eq tree.bindings) && (expansion eq tree.expansion) => tree
10981096 case _ => finalize(tree, untpd.Inlined (call, bindings, expansion)(sourceFile(tree)))
10991097 }
11001098 def SingletonTypeTree (tree : Tree )(ref : Tree )(implicit ctx : Context ): SingletonTypeTree = tree match {
1101- case tree : SingletonTypeTree if (ref eq tree.ref) && sameSourceFile(tree) => tree
1099+ case tree : SingletonTypeTree if (ref eq tree.ref) => tree
11021100 case _ => finalize(tree, untpd.SingletonTypeTree (ref)(sourceFile(tree)))
11031101 }
11041102 def AndTypeTree (tree : Tree )(left : Tree , right : Tree )(implicit ctx : Context ): AndTypeTree = tree match {
1105- case tree : AndTypeTree if (left eq tree.left) && (right eq tree.right) && sameSourceFile(tree) => tree
1103+ case tree : AndTypeTree if (left eq tree.left) && (right eq tree.right) => tree
11061104 case _ => finalize(tree, untpd.AndTypeTree (left, right)(sourceFile(tree)))
11071105 }
11081106 def OrTypeTree (tree : Tree )(left : Tree , right : Tree )(implicit ctx : Context ): OrTypeTree = tree match {
1109- case tree : OrTypeTree if (left eq tree.left) && (right eq tree.right) && sameSourceFile(tree) => tree
1107+ case tree : OrTypeTree if (left eq tree.left) && (right eq tree.right) => tree
11101108 case _ => finalize(tree, untpd.OrTypeTree (left, right)(sourceFile(tree)))
11111109 }
11121110 def RefinedTypeTree (tree : Tree )(tpt : Tree , refinements : List [Tree ])(implicit ctx : Context ): RefinedTypeTree = tree match {
1113- case tree : RefinedTypeTree if (tpt eq tree.tpt) && (refinements eq tree.refinements) && sameSourceFile(tree) => tree
1111+ case tree : RefinedTypeTree if (tpt eq tree.tpt) && (refinements eq tree.refinements) => tree
11141112 case _ => finalize(tree, untpd.RefinedTypeTree (tpt, refinements)(sourceFile(tree)))
11151113 }
11161114 def AppliedTypeTree (tree : Tree )(tpt : Tree , args : List [Tree ])(implicit ctx : Context ): AppliedTypeTree = tree match {
1117- case tree : AppliedTypeTree if (tpt eq tree.tpt) && (args eq tree.args) && sameSourceFile(tree) => tree
1115+ case tree : AppliedTypeTree if (tpt eq tree.tpt) && (args eq tree.args) => tree
11181116 case _ => finalize(tree, untpd.AppliedTypeTree (tpt, args)(sourceFile(tree)))
11191117 }
11201118 def LambdaTypeTree (tree : Tree )(tparams : List [TypeDef ], body : Tree )(implicit ctx : Context ): LambdaTypeTree = tree match {
1121- case tree : LambdaTypeTree if (tparams eq tree.tparams) && (body eq tree.body) && sameSourceFile(tree) => tree
1119+ case tree : LambdaTypeTree if (tparams eq tree.tparams) && (body eq tree.body) => tree
11221120 case _ => finalize(tree, untpd.LambdaTypeTree (tparams, body)(sourceFile(tree)))
11231121 }
11241122 def MatchTypeTree (tree : Tree )(bound : Tree , selector : Tree , cases : List [CaseDef ])(implicit ctx : Context ): MatchTypeTree = tree match {
1125- case tree : MatchTypeTree if (bound eq tree.bound) && (selector eq tree.selector) && (cases eq tree.cases) && sameSourceFile(tree) => tree
1123+ case tree : MatchTypeTree if (bound eq tree.bound) && (selector eq tree.selector) && (cases eq tree.cases) => tree
11261124 case _ => finalize(tree, untpd.MatchTypeTree (bound, selector, cases)(sourceFile(tree)))
11271125 }
11281126 def ByNameTypeTree (tree : Tree )(result : Tree )(implicit ctx : Context ): ByNameTypeTree = tree match {
1129- case tree : ByNameTypeTree if (result eq tree.result) && sameSourceFile(tree) => tree
1127+ case tree : ByNameTypeTree if (result eq tree.result) => tree
11301128 case _ => finalize(tree, untpd.ByNameTypeTree (result)(sourceFile(tree)))
11311129 }
11321130 def TypeBoundsTree (tree : Tree )(lo : Tree , hi : Tree )(implicit ctx : Context ): TypeBoundsTree = tree match {
1133- case tree : TypeBoundsTree if (lo eq tree.lo) && (hi eq tree.hi) && sameSourceFile(tree) => tree
1131+ case tree : TypeBoundsTree if (lo eq tree.lo) && (hi eq tree.hi) => tree
11341132 case _ => finalize(tree, untpd.TypeBoundsTree (lo, hi)(sourceFile(tree)))
11351133 }
11361134 def Bind (tree : Tree )(name : Name , body : Tree )(implicit ctx : Context ): Bind = tree match {
1137- case tree : Bind if (name eq tree.name) && (body eq tree.body) && sameSourceFile(tree) => tree
1135+ case tree : Bind if (name eq tree.name) && (body eq tree.body) => tree
11381136 case _ => finalize(tree, untpd.Bind (name, body)(sourceFile(tree)))
11391137 }
11401138 def Alternative (tree : Tree )(trees : List [Tree ])(implicit ctx : Context ): Alternative = tree match {
1141- case tree : Alternative if (trees eq tree.trees) && sameSourceFile(tree) => tree
1139+ case tree : Alternative if (trees eq tree.trees) => tree
11421140 case _ => finalize(tree, untpd.Alternative (trees)(sourceFile(tree)))
11431141 }
11441142 def UnApply (tree : Tree )(fun : Tree , implicits : List [Tree ], patterns : List [Tree ])(implicit ctx : Context ): UnApply = tree match {
1145- case tree : UnApply if (fun eq tree.fun) && (implicits eq tree.implicits) && (patterns eq tree.patterns) && sameSourceFile(tree) => tree
1143+ case tree : UnApply if (fun eq tree.fun) && (implicits eq tree.implicits) && (patterns eq tree.patterns) => tree
11461144 case _ => finalize(tree, untpd.UnApply (fun, implicits, patterns)(sourceFile(tree)))
11471145 }
11481146 def ValDef (tree : Tree )(name : TermName , tpt : Tree , rhs : LazyTree )(implicit ctx : Context ): ValDef = tree match {
1149- case tree : ValDef if (name == tree.name) && (tpt eq tree.tpt) && (rhs eq tree.unforcedRhs) && sameSourceFile(tree) => tree
1147+ case tree : ValDef if (name == tree.name) && (tpt eq tree.tpt) && (rhs eq tree.unforcedRhs) => tree
11501148 case _ => finalize(tree, untpd.ValDef (name, tpt, rhs)(sourceFile(tree)))
11511149 }
11521150 def DefDef (tree : Tree )(name : TermName , tparams : List [TypeDef ], vparamss : List [List [ValDef ]], tpt : Tree , rhs : LazyTree )(implicit ctx : Context ): DefDef = tree match {
1153- case tree : DefDef if (name == tree.name) && (tparams eq tree.tparams) && (vparamss eq tree.vparamss) && (tpt eq tree.tpt) && (rhs eq tree.unforcedRhs) && sameSourceFile(tree) => tree
1151+ case tree : DefDef if (name == tree.name) && (tparams eq tree.tparams) && (vparamss eq tree.vparamss) && (tpt eq tree.tpt) && (rhs eq tree.unforcedRhs) => tree
11541152 case _ => finalize(tree, untpd.DefDef (name, tparams, vparamss, tpt, rhs)(sourceFile(tree)))
11551153 }
11561154 def TypeDef (tree : Tree )(name : TypeName , rhs : Tree )(implicit ctx : Context ): TypeDef = tree match {
1157- case tree : TypeDef if (name == tree.name) && (rhs eq tree.rhs) && sameSourceFile(tree) => tree
1155+ case tree : TypeDef if (name == tree.name) && (rhs eq tree.rhs) => tree
11581156 case _ => finalize(tree, untpd.TypeDef (name, rhs)(sourceFile(tree)))
11591157 }
11601158 def Template (tree : Tree )(constr : DefDef , parents : List [Tree ], derived : List [untpd.Tree ], self : ValDef , body : LazyTreeList )(implicit ctx : Context ): Template = tree match {
1161- case tree : Template if (constr eq tree.constr) && (parents eq tree.parents) && (derived eq tree.derived) && (self eq tree.self) && (body eq tree.unforcedBody) && sameSourceFile(tree) => tree
1159+ case tree : Template if (constr eq tree.constr) && (parents eq tree.parents) && (derived eq tree.derived) && (self eq tree.self) && (body eq tree.unforcedBody) => tree
11621160 case tree => finalize(tree, untpd.Template (constr, parents, derived, self, body)(sourceFile(tree)))
11631161 }
11641162 def Import (tree : Tree )(impliedOnly : Boolean , expr : Tree , selectors : List [untpd.Tree ])(implicit ctx : Context ): Import = tree match {
1165- case tree : Import if (impliedOnly == tree.impliedOnly) && (expr eq tree.expr) && (selectors eq tree.selectors) && sameSourceFile(tree) => tree
1163+ case tree : Import if (impliedOnly == tree.impliedOnly) && (expr eq tree.expr) && (selectors eq tree.selectors) => tree
11661164 case _ => finalize(tree, untpd.Import (impliedOnly, expr, selectors)(sourceFile(tree)))
11671165 }
11681166 def PackageDef (tree : Tree )(pid : RefTree , stats : List [Tree ])(implicit ctx : Context ): PackageDef = tree match {
1169- case tree : PackageDef if (pid eq tree.pid) && (stats eq tree.stats) && sameSourceFile(tree) => tree
1167+ case tree : PackageDef if (pid eq tree.pid) && (stats eq tree.stats) => tree
11701168 case _ => finalize(tree, untpd.PackageDef (pid, stats)(sourceFile(tree)))
11711169 }
11721170 def Annotated (tree : Tree )(arg : Tree , annot : Tree )(implicit ctx : Context ): Annotated = tree match {
1173- case tree : Annotated if (arg eq tree.arg) && (annot eq tree.annot) && sameSourceFile(tree) => tree
1171+ case tree : Annotated if (arg eq tree.arg) && (annot eq tree.annot) => tree
11741172 case _ => finalize(tree, untpd.Annotated (arg, annot)(sourceFile(tree)))
11751173 }
11761174 def Thicket (tree : Tree )(trees : List [Tree ])(implicit ctx : Context ): Thicket = tree match {
1177- case tree : Thicket if (trees eq tree.trees) && sameSourceFile(tree) => tree
1175+ case tree : Thicket if (trees eq tree.trees) => tree
11781176 case _ => finalize(tree, untpd.Thicket (trees)(sourceFile(tree)))
11791177 }
11801178
0 commit comments