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].
A transformer that translates all encountered subtrees in prefix traversal orders
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
.
New owners, replacing previous owners.
The symbols that need to be substituted.
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.
If sym
is one of oldOwners
, replace by corresponding symbol in newOwners
New owners, replacing previous owners.
Previous owners.
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
.
The symbols that need to be substituted.
The substitution targets.
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.
A transformer that translates all encountered subtrees in prefix traversal orders
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].
The tree map with the substitution between originals syms
and mapped symbols mapped
.
The tree map with the substitution between originals syms
and mapped symbols mapped
. Also goes into mapped classes
and substitutes their declarations.
Apply typeMap
and ownerMap
to given symbols syms
and return a treemap that contains the substitution
between original and mapped symbols.
The current tree map composed with a substitution [from -> to]
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