@@ -914,7 +914,7 @@ object Trees {
914
914
915
915
/** A class for copying trees. The copy methods avid creating a new tree
916
916
* If all arguments stay the same.
917
-
917
+ *
918
918
* Note: Some of the copy methods take a context.
919
919
* These are exactly those methods that are overridden in TypedTreeCopier
920
920
* so that they selectively retype themselves. Retyping needs a context.
@@ -948,35 +948,35 @@ object Trees {
948
948
case tree : Super if (qual eq tree.qual) && (mix == tree.mix) => tree
949
949
case _ => finalize(tree, untpd.Super (qual, mix))
950
950
}
951
- def Apply (tree : Tree )(fun : Tree , args : List [Tree ]): Apply = tree match {
951
+ def Apply (tree : Tree )(fun : Tree , args : List [Tree ])( implicit ctx : Context ) : Apply = tree match {
952
952
case tree : Apply if (fun eq tree.fun) && (args eq tree.args) => tree
953
953
case _ => finalize(tree, untpd.Apply (fun, args))
954
954
}
955
- def TypeApply (tree : Tree )(fun : Tree , args : List [Tree ]): TypeApply = tree match {
955
+ def TypeApply (tree : Tree )(fun : Tree , args : List [Tree ])( implicit ctx : Context ) : TypeApply = tree match {
956
956
case tree : TypeApply if (fun eq tree.fun) && (args eq tree.args) => tree
957
957
case _ => finalize(tree, untpd.TypeApply (fun, args))
958
958
}
959
- def Literal (tree : Tree )(const : Constant ): Literal = tree match {
959
+ def Literal (tree : Tree )(const : Constant )( implicit ctx : Context ) : Literal = tree match {
960
960
case tree : Literal if (const == tree.const) => tree
961
961
case _ => finalize(tree, untpd.Literal (const))
962
962
}
963
- def New (tree : Tree )(tpt : Tree ): New = tree match {
963
+ def New (tree : Tree )(tpt : Tree )( implicit ctx : Context ) : New = tree match {
964
964
case tree : New if (tpt eq tree.tpt) => tree
965
965
case _ => finalize(tree, untpd.New (tpt))
966
966
}
967
967
def Pair (tree : Tree )(left : Tree , right : Tree )(implicit ctx : Context ): Pair = tree match {
968
968
case tree : Pair if (left eq tree.left) && (right eq tree.right) => tree
969
969
case _ => finalize(tree, untpd.Pair (left, right))
970
970
}
971
- def Typed (tree : Tree )(expr : Tree , tpt : Tree ): Typed = tree match {
971
+ def Typed (tree : Tree )(expr : Tree , tpt : Tree )( implicit ctx : Context ) : Typed = tree match {
972
972
case tree : Typed if (expr eq tree.expr) && (tpt eq tree.tpt) => tree
973
973
case _ => finalize(tree, untpd.Typed (expr, tpt))
974
974
}
975
- def NamedArg (tree : Tree )(name : Name , arg : Tree ): NamedArg = tree match {
975
+ def NamedArg (tree : Tree )(name : Name , arg : Tree )( implicit ctx : Context ) : NamedArg = tree match {
976
976
case tree : NamedArg if (name == tree.name) && (arg eq tree.arg) => tree
977
977
case _ => finalize(tree, untpd.NamedArg (name, arg))
978
978
}
979
- def Assign (tree : Tree )(lhs : Tree , rhs : Tree ): Assign = tree match {
979
+ def Assign (tree : Tree )(lhs : Tree , rhs : Tree )( implicit ctx : Context ) : Assign = tree match {
980
980
case tree : Assign if (lhs eq tree.lhs) && (rhs eq tree.rhs) => tree
981
981
case _ => finalize(tree, untpd.Assign (lhs, rhs))
982
982
}
@@ -988,7 +988,7 @@ object Trees {
988
988
case tree : If if (cond eq tree.cond) && (thenp eq tree.thenp) && (elsep eq tree.elsep) => tree
989
989
case _ => finalize(tree, untpd.If (cond, thenp, elsep))
990
990
}
991
- def Closure (tree : Tree )(env : List [Tree ], meth : Tree , tpt : Tree ): Closure = tree match {
991
+ def Closure (tree : Tree )(env : List [Tree ], meth : Tree , tpt : Tree )( implicit ctx : Context ) : Closure = tree match {
992
992
case tree : Closure if (env eq tree.env) && (meth eq tree.meth) && (tpt eq tree.tpt) => tree
993
993
case _ => finalize(tree, untpd.Closure (env, meth, tpt))
994
994
}
@@ -1000,15 +1000,15 @@ object Trees {
1000
1000
case tree : CaseDef if (pat eq tree.pat) && (guard eq tree.guard) && (body eq tree.body) => tree
1001
1001
case _ => finalize(tree, untpd.CaseDef (pat, guard, body))
1002
1002
}
1003
- def Return (tree : Tree )(expr : Tree , from : Tree ): Return = tree match {
1003
+ def Return (tree : Tree )(expr : Tree , from : Tree )( implicit ctx : Context ) : Return = tree match {
1004
1004
case tree : Return if (expr eq tree.expr) && (from eq tree.from) => tree
1005
1005
case _ => finalize(tree, untpd.Return (expr, from))
1006
1006
}
1007
1007
def Try (tree : Tree )(expr : Tree , handler : Tree , finalizer : Tree )(implicit ctx : Context ): Try = tree match {
1008
1008
case tree : Try if (expr eq tree.expr) && (handler eq tree.handler) && (finalizer eq tree.finalizer) => tree
1009
1009
case _ => finalize(tree, untpd.Try (expr, handler, finalizer))
1010
1010
}
1011
- def Throw (tree : Tree )(expr : Tree ): Throw = tree match {
1011
+ def Throw (tree : Tree )(expr : Tree )( implicit ctx : Context ) : Throw = tree match {
1012
1012
case tree : Throw if (expr eq tree.expr) => tree
1013
1013
case _ => finalize(tree, untpd.Throw (expr))
1014
1014
}
@@ -1104,7 +1104,7 @@ object Trees {
1104
1104
// is of the same class as the copy. We only include trees with more than 2 elements here.
1105
1105
def If (tree : If )(cond : Tree = tree.cond, thenp : Tree = tree.thenp, elsep : Tree = tree.elsep)(implicit ctx : Context ): If =
1106
1106
If (tree : Tree )(cond, thenp, elsep)
1107
- def Closure (tree : Closure )(env : List [Tree ] = tree.env, meth : Tree = tree.meth, tpt : Tree = tree.tpt): Closure =
1107
+ def Closure (tree : Closure )(env : List [Tree ] = tree.env, meth : Tree = tree.meth, tpt : Tree = tree.tpt)( implicit ctx : Context ) : Closure =
1108
1108
Closure (tree : Tree )(env, meth, tpt)
1109
1109
def CaseDef (tree : CaseDef )(pat : Tree = tree.pat, guard : Tree = tree.guard, body : Tree = tree.body)(implicit ctx : Context ): CaseDef =
1110
1110
CaseDef (tree : Tree )(pat, guard, body)
0 commit comments