dotty.tools.dotc.ast

Type members

Classlikes

Helper methods to desugar enums

Helper methods to desugar enums

Utility functions to go from typed to untyped ASTs

Utility functions to go from typed to untyped ASTs

abstract class Positioned(implicit @constructorOnly src: SourceFile) extends SrcPos with Product with Cloneable

A base class for things that have positions (currently: modifiers and trees)

A base class for things that have positions (currently: modifiers and trees)

Companion:
object
object Positioned
Companion:
class
trait TreeInfo[T >: Untyped <: Type]
Companion:
object
object TreeInfo
Companion:
class

A TreeMap that maintains the necessary infrastructure to support contextual implicit searches (type-scope implicits are supported anyway).

A TreeMap that maintains the necessary infrastructure to support contextual implicit searches (type-scope implicits are supported anyway).

This incudes implicits defined in scope as well as imported implicits.

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], cpy: TreeCopier)(using x$8: 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

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 parameters:
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].

object Trees
trait TypedTreeInfo extends TreeInfo[Type]
object desugar
object tpd extends Instance[Type] with TypedTreeInfo

Some creators for typed trees

Some creators for typed trees

object untpd extends Instance[Untyped] with UntypedTreeInfo