TreeCopier

dotty.tools.dotc.ast.Trees.Instance.TreeCopier
abstract class TreeCopier

A class for copying trees. The copy methods avoid creating a new tree If all arguments stay the same.

Note: Some of the copy methods take a context. These are exactly those methods that are overridden in TypedTreeCopier so that they selectively retype themselves. Retyping needs a context.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

protected def postProcess(tree: Instance.this.Tree, copied: Tree): copied.ThisTree[Instance.this.T]
protected def postProcess(tree: Instance.this.Tree, copied: MemberDef): copied.ThisTree[Instance.this.T]

Concrete methods

def Alternative(tree: Instance.this.Tree)(trees: List[Instance.this.Tree])(using Context): Instance.this.Alternative
def Annotated(tree: Instance.this.Tree)(arg: Instance.this.Tree, annot: Instance.this.Tree)(using Context): Instance.this.Annotated
def AppliedTypeTree(tree: Instance.this.Tree)(tpt: Instance.this.Tree, args: List[Instance.this.Tree])(using Context): Instance.this.AppliedTypeTree
def Apply(tree: Instance.this.Tree)(fun: Instance.this.Tree, args: List[Instance.this.Tree])(using Context): Instance.this.Apply
def Assign(tree: Instance.this.Tree)(lhs: Instance.this.Tree, rhs: Instance.this.Tree)(using Context): Instance.this.Assign
def Bind(tree: Instance.this.Tree)(name: Name, body: Instance.this.Tree)(using Context): Instance.this.Bind
def Block(tree: Instance.this.Tree)(stats: List[Instance.this.Tree], expr: Instance.this.Tree)(using Context): Instance.this.Block
def ByNameTypeTree(tree: Instance.this.Tree)(result: Instance.this.Tree)(using Context): Instance.this.ByNameTypeTree
def CaseDef(tree: Instance.this.Tree)(pat: Instance.this.Tree, guard: Instance.this.Tree, body: Instance.this.Tree)(using Context): Instance.this.CaseDef
def CaseDef(tree: Instance.this.CaseDef)(pat: Instance.this.Tree = ..., guard: Instance.this.Tree = ..., body: Instance.this.Tree = ...)(using Context): Instance.this.CaseDef
def Closure(tree: Instance.this.Tree)(env: List[Instance.this.Tree], meth: Instance.this.Tree, tpt: Instance.this.Tree)(using Context): Instance.this.Closure
def Closure(tree: Instance.this.Closure)(env: List[Instance.this.Tree] = ..., meth: Instance.this.Tree = ..., tpt: Instance.this.Tree = ...)(using Context): Instance.this.Closure
def DefDef(tree: Instance.this.Tree)(name: TermName, paramss: List[Instance.this.ParamClause], tpt: Instance.this.Tree, rhs: Instance.this.LazyTree)(using Context): Instance.this.DefDef
def DefDef(tree: Instance.this.DefDef)(name: TermName = ..., paramss: List[Instance.this.ParamClause] = ..., tpt: Instance.this.Tree = ..., rhs: Instance.this.LazyTree = ...)(using Context): Instance.this.DefDef
def Export(tree: Instance.this.Tree)(expr: Instance.this.Tree, selectors: List[ImportSelector])(using Context): Instance.this.Export
def Hole(tree: Instance.this.Tree)(isTerm: Boolean, idx: Int, args: List[Instance.this.Tree], content: Instance.this.Tree)(using Context): Instance.this.Hole
def Hole(tree: Instance.this.Hole)(isTerm: Boolean = ..., idx: Int = ..., args: List[Instance.this.Tree] = ..., content: Instance.this.Tree = ...)(using Context): Instance.this.Hole
def Ident(tree: Instance.this.Tree)(name: Name)(using Context): Instance.this.Ident
def If(tree: Instance.this.Tree)(cond: Instance.this.Tree, thenp: Instance.this.Tree, elsep: Instance.this.Tree)(using Context): Instance.this.If
def If(tree: Instance.this.If)(cond: Instance.this.Tree = ..., thenp: Instance.this.Tree = ..., elsep: Instance.this.Tree = ...)(using Context): Instance.this.If
def Import(tree: Instance.this.Tree)(expr: Instance.this.Tree, selectors: List[ImportSelector])(using Context): Instance.this.Import
def Inlined(tree: Instance.this.Inlined)(call: Tree, bindings: List[Instance.this.MemberDef], expansion: Instance.this.Tree)(using Context): Instance.this.Inlined
def Labeled(tree: Instance.this.Tree)(bind: Instance.this.Bind, expr: Instance.this.Tree)(using Context): Instance.this.Labeled
def LambdaTypeTree(tree: Instance.this.Tree)(tparams: List[Instance.this.TypeDef], body: Instance.this.Tree)(using Context): Instance.this.LambdaTypeTree
def Literal(tree: Instance.this.Tree)(const: Constant)(using Context): Instance.this.Literal
def Match(tree: Instance.this.Tree)(selector: Instance.this.Tree, cases: List[Instance.this.CaseDef])(using Context): Instance.this.Match
def MatchTypeTree(tree: Instance.this.Tree)(bound: Instance.this.Tree, selector: Instance.this.Tree, cases: List[Instance.this.CaseDef])(using Context): Instance.this.MatchTypeTree
def NamedArg(tree: Instance.this.Tree)(name: Name, arg: Instance.this.Tree)(using Context): Instance.this.NamedArg
def New(tree: Instance.this.Tree)(tpt: Instance.this.Tree)(using Context): Instance.this.New
def PackageDef(tree: Instance.this.Tree)(pid: Instance.this.RefTree, stats: List[Instance.this.Tree])(using Context): Instance.this.PackageDef
def Quote(tree: Instance.this.Tree)(body: Instance.this.Tree, tags: List[Instance.this.Tree])(using Context): Instance.this.Quote
def QuotePattern(tree: Instance.this.Tree)(bindings: List[Instance.this.Tree], body: Instance.this.Tree, quotes: Instance.this.Tree)(using Context): Instance.this.QuotePattern
def Ref(tree: Instance.this.RefTree)(name: Name)(using Context): Instance.this.RefTree

Copy Ident or Select trees

Copy Ident or Select trees

Attributes

def RefinedTypeTree(tree: Instance.this.Tree)(tpt: Instance.this.Tree, refinements: List[Instance.this.Tree])(using Context): Instance.this.RefinedTypeTree
def Return(tree: Instance.this.Tree)(expr: Instance.this.Tree, from: Instance.this.Tree)(using Context): Instance.this.Return
def Select(tree: Instance.this.Tree)(qualifier: Instance.this.Tree, name: Name)(using Context): Instance.this.Select
def SeqLiteral(tree: Instance.this.Tree)(elems: List[Instance.this.Tree], elemtpt: Instance.this.Tree)(using Context): Instance.this.SeqLiteral
def SingletonTypeTree(tree: Instance.this.Tree)(ref: Instance.this.Tree)(using Context): Instance.this.SingletonTypeTree
def Splice(tree: Instance.this.Tree)(expr: Instance.this.Tree)(using Context): Instance.this.Splice
def SplicePattern(tree: Instance.this.Tree)(body: Instance.this.Tree, typeargs: List[Instance.this.Tree], args: List[Instance.this.Tree])(using Context): Instance.this.SplicePattern
def Super(tree: Instance.this.Tree)(qual: Instance.this.Tree, mix: Ident)(using Context): Instance.this.Super
def Template(tree: Instance.this.Tree)(constr: Instance.this.DefDef, parents: List[Instance.this.Tree], derived: List[Tree], self: Instance.this.ValDef, body: Instance.this.LazyTreeList)(using Context): Instance.this.Template
def Template(tree: Instance.this.Template)(using Context)(constr: Instance.this.DefDef = ..., parents: List[Instance.this.Tree] = ..., derived: List[Tree] = ..., self: Instance.this.ValDef = ..., body: Instance.this.LazyTreeList = ...): Instance.this.Template
def TermLambdaTypeTree(tree: Instance.this.Tree)(params: List[Instance.this.ValDef], body: Instance.this.Tree)(using Context): Instance.this.TermLambdaTypeTree
def Thicket(tree: Instance.this.Tree)(trees: List[Instance.this.Tree])(using Context): Instance.this.Thicket
def This(tree: Instance.this.Tree)(qual: Ident)(using Context): Instance.this.This
def Try(tree: Instance.this.Tree)(expr: Instance.this.Tree, cases: List[Instance.this.CaseDef], finalizer: Instance.this.Tree)(using Context): Instance.this.Try
def Try(tree: Instance.this.Try)(expr: Instance.this.Tree = ..., cases: List[Instance.this.CaseDef] = ..., finalizer: Instance.this.Tree = ...)(using Context): Instance.this.Try
def TypeApply(tree: Instance.this.Tree)(fun: Instance.this.Tree, args: List[Instance.this.Tree])(using Context): Instance.this.TypeApply
def TypeBoundsTree(tree: Instance.this.Tree)(lo: Instance.this.Tree, hi: Instance.this.Tree, alias: Instance.this.Tree)(using Context): Instance.this.TypeBoundsTree
def TypeDef(tree: Instance.this.Tree)(name: TypeName, rhs: Instance.this.Tree)(using Context): Instance.this.TypeDef
def TypeDef(tree: Instance.this.TypeDef)(name: TypeName = ..., rhs: Instance.this.Tree = ...)(using Context): Instance.this.TypeDef
def Typed(tree: Instance.this.Tree)(expr: Instance.this.Tree, tpt: Instance.this.Tree)(using Context): Instance.this.Typed
def UnApply(tree: Instance.this.Tree)(fun: Instance.this.Tree, implicits: List[Instance.this.Tree], patterns: List[Instance.this.Tree])(using Context): Instance.this.UnApply
def UnApply(tree: Instance.this.UnApply)(fun: Instance.this.Tree = ..., implicits: List[Instance.this.Tree] = ..., patterns: List[Instance.this.Tree] = ...)(using Context): Instance.this.UnApply
def ValDef(tree: Instance.this.Tree)(name: TermName, tpt: Instance.this.Tree, rhs: Instance.this.LazyTree)(using Context): Instance.this.ValDef
def ValDef(tree: Instance.this.ValDef)(name: TermName = ..., tpt: Instance.this.Tree = ..., rhs: Instance.this.LazyTree = ...)(using Context): Instance.this.ValDef
def WhileDo(tree: Instance.this.Tree)(cond: Instance.this.Tree, body: Instance.this.Tree)(using Context): Instance.this.WhileDo
protected def finalize(tree: Instance.this.Tree, copied: Tree): copied.ThisTree[Instance.this.T]
protected def finalize(tree: Instance.this.Tree, copied: MemberDef): copied.ThisTree[Instance.this.T]
protected def sourceFile(tree: Instance.this.Tree): SourceFile

Soucre of the copied tree

Soucre of the copied tree

Attributes