TreeTypeMap

class TreeTypeMap(val typeMap: Type => Type, val treeMap: Tree => Tree, val oldOwners: List[Symbol], val newOwners: List[Symbol], val substFrom: List[Symbol], val substTo: List[Symbol])(using `x$7`: Context) extends TreeMap

A map that applies three functions and a substitution together to a tree and makes sure they are coordinated so that the result is well-typed. The functions are

Value Params
newOwners

New owners, replacing previous owners.

oldOwners

Previous owners. If a top-level local symbol in the mapped tree has one of these as an owner, the owner is replaced by the corresponding symbol in newOwners.

substFrom

The symbols that need to be substituted.

substTo

The substitution targets. The reason the substitution is broken out from the rest of the type map is that all symbols have to be substituted at the same time. If we do not do this, we risk data races on named types. Example: Say we have outer#1.inner#2 and we have two substitutions S1 = [outer#1 := outer#3], S2 = [inner#2 := inner#4] where hashtags precede symbol ids. If we do S1 first, we get outer#2.inner#3. If we then do S2 we get outer#2.inner#4. But that means that the named type outer#2.inner gets two different denotations in the same period. Hence, if -Yno-double-bindings is set, we would get a data race assertion error.

treeMap

A transformer that translates all encountered subtrees in prefix traversal orders

typeMap

A function from Type to Type that gets applied to the type of every tree node and to all locally defined symbols, followed by the substitution [substFrom := substTo].

class TreeMap
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[ThisTree <: Tree](tree: ThisTree): ThisTree
def copy(typeMap: Type => Type, treeMap: Tree => Tree, oldOwners: List[Symbol], newOwners: List[Symbol], substFrom: List[Symbol], substTo: List[Symbol])(using Context): TreeTypeMap
def mapOwner(sym: Symbol): Symbol

If sym is one of oldOwners, replace by corresponding symbol in newOwners

If sym is one of oldOwners, replace by corresponding symbol in newOwners

def mapType(tp: Type): Type
override def transform(tree: Tree)(using Context): Tree
Definition Classes
def transformDefs[TT <: Tree](trees: List[TT])(using Context): (TreeTypeMap, List[TT])
def transformInlined(tree: Inlined)(using Context): Tree
override def transformStats(trees: List[Tree], exprOwner: Symbol)(using Context): List[Tree]
Definition Classes

Apply typeMap and ownerMap to given symbols syms and return a treemap that contains the substitution between original and mapped symbols.

Apply typeMap and ownerMap to given symbols syms and return a treemap that contains the substitution between original and mapped symbols.

The tree map with the substitution between originals syms and mapped symbols mapped. Also goes into mapped classes and substitutes their declarations.

The tree map with the substitution between originals syms and mapped symbols mapped. Also goes into mapped classes and substitutes their declarations.

The current tree map composed with a substitution [from -> to]

The current tree map composed with a substitution [from -> to]

Inherited methods

def transform(trees: List[Tree])(using Context): List[Tree]
Inherited from
TreeMap
Inherited from
TreeMap
Inherited from
TreeMap
def transformSub[Tr <: Tree](trees: List[Tr])(using Context): List[Tr]
Inherited from
TreeMap
def transformSub[Tr <: Tree](tree: Tr)(using Context): Tr
Inherited from
TreeMap

Concrete fields

val treeMap: Tree => Tree
val typeMap: Type => Type

Inherited fields

Inherited from
TreeMap