Instance

dotty.tools.dotc.ast.Trees.Instance
abstract class Instance[T <: Untyped]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object tpd
object untpd
Self type

Members list

Type members

Classlikes

class DeepFolder[X](f: (X, Tree) => X) extends TreeAccumulator[X]

Fold f over all tree nodes, in depth-first, prefix order

Fold f over all tree nodes, in depth-first, prefix order

Attributes

Supertypes
class TreeAccumulator[X]
class Object
trait Matchable
class Any
class ShallowFolder[X](f: (X, Tree) => X) extends TreeAccumulator[X]

Fold f over all tree nodes, in depth-first, prefix order, but don't visit subtrees where f returns a different result for the root, i.e. f(x, root) ne x.

Fold f over all tree nodes, in depth-first, prefix order, but don't visit subtrees where f returns a different result for the root, i.e. f(x, root) ne x.

Attributes

Supertypes
class TreeAccumulator[X]
class Object
trait Matchable
class Any
abstract class TreeAccumulator[X]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class DeepFolder[X]
class ShallowFolder[X]
class Setup
class Extractor
object hasSkolem
Show all
Self type
abstract class TreeCopier

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

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

Supertypes
class Object
trait Matchable
class Any
Known subtypes
abstract class TreeMap(val cpy: TreeCopier)

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
abstract class TreeTraverser extends TreeAccumulator[Unit]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object TypeDefs

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
TypeDefs.type
object ValDefs

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ValDefs.type

Types

type Annotated = Annotated[T]
type Apply = Apply[T]
type Assign = Assign[T]
type Bind = Bind[T]
type Block = Block[T]
type CaseDef = CaseDef[T]
type Closure = Closure[T]
type DefDef = DefDef[T]
type DefTree = DefTree[T]
type Export = Export[T]
type Hole = Hole[T]
type Ident = Ident[T]
type If = If[T]
type Import = Import[T]
type InlineIf = InlineIf[T]
type Inlined = Inlined[T]
type Labeled = Labeled[T]
type LazyTree = LazyTree[T]
type Literal = Literal[T]
type Match = Match[T]
type MemberDef = MemberDef[T]
type NameTree = NameTree[T]
type NamedArg = NamedArg[T]
type New = New[T]
type ProxyTree = ProxyTree[T]
type Quote = Quote[T]
type RefTree = RefTree[T]
type Return = Return[T]
type Select = Select[T]
type Splice = Splice[T]
type Super = Super[T]
type Template = Template[T]
type TermTree = TermTree[T]
type Thicket = Thicket[T]
type This = This[T]
type Tree = Tree[T]
type Try = Try[T]
type TypTree = TypTree[T]
type TypeApply = TypeApply[T]
type TypeDef = TypeDef[T]
type TypeTree = TypeTree[T]
type Typed = Typed[T]
type UnApply = UnApply[T]
type ValDef = ValDef[T]
type WhileDo = WhileDo[T]

Value members

Abstract methods

protected def FunProto(args: List[Tree], resType: Type)(using Context): FunProto

Delegate to FunProto or FunProtoTyped depending on whether the prefix is untpd or tpd.

Delegate to FunProto or FunProtoTyped depending on whether the prefix is untpd or tpd.

Attributes

def localCtx(tree: Tree)(using Context): Context

The context to use when mapping or accumulating over a tree

The context to use when mapping or accumulating over a tree

Attributes

Concrete methods

def Thicket(): Thicket
def Thicket(x1: Tree, x2: Tree)(implicit src: SourceFile): Thicket
def Thicket(x1: Tree, x2: Tree, x3: Tree)(implicit src: SourceFile): Thicket
def Thicket(xs: List[Tree])(implicit src: SourceFile): Thicket[T]
def applyOverloaded(receiver: Tree, method: TermName, args: List[Tree], targs: List[Type], expectedType: Type)(using parentCtx: Context): Tree

Construct the application $receiver.$method[$targs]($args) using overloading resolution to find a matching overload of $method if necessary. This is useful when overloading resolution needs to be performed in a phase after typer. Note that this will not perform any kind of implicit search.

Construct the application $receiver.$method[$targs]($args) using overloading resolution to find a matching overload of $method if necessary. This is useful when overloading resolution needs to be performed in a phase after typer. Note that this will not perform any kind of implicit search.

Value parameters

expectedType

An expected type of the application used to guide overloading resolution

Attributes

def flatTree(xs: List[Tree])(implicit src: SourceFile): Tree
protected def inlineContext(tree: Inlined)(using Context): Context

For untyped trees, this is just the identity. For typed trees, a context derived form ctx that records call as the innermost enclosing call for which the inlined version is currently processed.

For untyped trees, this is just the identity. For typed trees, a context derived form ctx that records call as the innermost enclosing call for which the inlined version is currently processed.

Attributes

def joinParams(tparams: List[TypeDef], paramss: List[ParamClause]): List[ParamClause]

If tparams is non-empty, add it to the left paramss, merging it with a leading type parameter list of paramss, if one exists.

If tparams is non-empty, add it to the left paramss, merging it with a leading type parameter list of paramss, if one exists.

Attributes

def rename(tree: NameTree, newName: Name)(using Context): tree.ThisTree[T]
def resolveConstructor(atp: Type, args: List[Tree])(using Context): Tree
protected def skipTransform(tree: Tree)(using Context): Boolean

Hook to indicate that a transform of some subtree should be skipped

Hook to indicate that a transform of some subtree should be skipped

Attributes

def transformCtx(tree: Tree)(using Context): Context

The context to use when transforming a tree. It ensures that the source is correct, and that the local context is used if that's necessary for transforming the whole tree. TODO: ensure transform is always called with the correct context as argument

The context to use when transforming a tree. It ensures that the source is correct, and that the local context is used if that's necessary for transforming the whole tree. TODO: ensure transform is always called with the correct context as argument

Attributes

See also

Abstract fields