Trees

dotty.tools.dotc.ast.Trees$
object Trees

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Trees.type

Members list

Concise view

Type members

Classlikes

case class Alternative[-T >: Untyped] extends PatternTree[T]

tree_1 | ... | tree_n

tree_1 | ... | tree_n

Attributes

Graph
Supertypes
trait PatternTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Annotated[-T >: Untyped] extends ProxyTree[T]

arg @annot

arg @annot

Attributes

Graph
Supertypes
class ProxyTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class AppliedTypeTree[-T >: Untyped] extends ProxyTree[T] with TypTree[T]

tpt[args]

tpt[args]

Attributes

Graph
Supertypes
trait TypTree[T]
class ProxyTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Apply[-T >: Untyped] extends GenericApply[T]

fun(args)

fun(args)

Attributes

Graph
Supertypes
class GenericApply[T]
trait TermTree[T]
class ProxyTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any

The kind of application

The kind of application

Attributes

Graph
Supertypes
trait Enum
trait Product
trait Equals
class Object
trait Matchable
class Any
case class Assign[-T >: Untyped] extends TermTree[T]

name = arg, outside a parameter list

name = arg, outside a parameter list

Attributes

Graph
Supertypes
trait TermTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Bind[-T >: Untyped] extends NamedDefTree[T] with PatternTree[T]

name @ body

name @ body

Attributes

Graph
Supertypes
trait PatternTree[T]
class NamedDefTree[T]
trait WithEndMarker[T]
trait DefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Block[-T >: Untyped] extends Tree[T]

{ stats; expr }

{ stats; expr }

Attributes

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class XMLBlock
case class ByNameTypeTree[-T >: Untyped] extends TypTree[T]

=> T

=> T

Attributes

Graph
Supertypes
trait TypTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class CaseDef[-T >: Untyped] extends Tree[T]

case pat if guard => body

case pat if guard => body

Attributes

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Closure[-T >: Untyped] extends TermTree[T]

A closure with an environment and a reference to a method.

A closure with an environment and a reference to a method.

Attributes

env

The captured parameters of the closure

meth

A ref tree that refers to the method of the closure. The first (env.length) parameters of that method are filled with env values.

tpt

Either EmptyTree or a TypeTree. If tpt is EmptyTree the type of the closure is a function type, otherwise it is the type given in tpt, which must be a SAM type.

Graph
Supertypes
trait TermTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class DefDef[-T >: Untyped] extends ValOrDefDef[T]

mods def nametparams...(vparams_n): tpt = rhs

mods def nametparams...(vparams_n): tpt = rhs

Attributes

Graph
Supertypes
class ValOrDefDef[T]
class MemberDef[T]
class NamedDefTree[T]
trait WithEndMarker[T]
trait DefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
trait DefTree[-T >: Untyped] extends DenotingTree[T]

Tree defines a new symbol

Tree defines a new symbol

Attributes

Graph
Supertypes
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class NamedDefTree[T]
class Bind[T]
class MemberDef[T]
class TypeDef[T]
class ValOrDefDef[T]
class DefDef[T]
class ValDef[T]
class EmptyValDef[T]
trait ValOrTypeDef[T]
class ModuleDef
class Template[T]
abstract class DenotingTree[-T >: Untyped](implicit src: SourceFile) extends Tree[T]

Tree's denotation can be derived from its type

Tree's denotation can be derived from its type

Attributes

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
trait DefTree[T]
class NamedDefTree[T]
class Bind[T]
class MemberDef[T]
class TypeDef[T]
class ValOrDefDef[T]
class DefDef[T]
class ValDef[T]
class EmptyValDef[T]
trait ValOrTypeDef[T]
class ModuleDef
class Template[T]
class Export[T]
class Import[T]
class NameTree[T]
class Labeled[T]
class RefTree[T]
class Ident[T]
object EmptyTypeIdent.type
class Select[T]
class SelectWithSig[T]
class This[T]
class TypeTree[T]
class EmptyTree[T >: Untyped] extends Thicket[Any]

Attributes

Graph
Supertypes
class Thicket[Any]
trait WithoutTypeOrPos[Any]
class Tree[Any]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
class EmptyValDef[T >: Untyped] extends ValDef[T] with WithoutTypeOrPos[T]

Attributes

Graph
Supertypes
class ValDef[T]
trait ValOrTypeDef[T]
class ValOrDefDef[T]
class MemberDef[T]
class NamedDefTree[T]
trait WithEndMarker[T]
trait DefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Export[-T >: Untyped] extends ImportOrExport[T]

export expr.selectors where a selector is either an untyped Ident, name or an untyped thicket consisting of name and rename.

export expr.selectors where a selector is either an untyped Ident, name or an untyped thicket consisting of name and rename.

Attributes

Graph
Supertypes
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
abstract class GenericApply[-T >: Untyped](implicit src: SourceFile) extends ProxyTree[T] with TermTree[T]

Attributes

Companion:
object
Graph
Supertypes
trait TermTree[T]
class ProxyTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class Apply[T]
class TypeApply[T]

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case class Hole[-T >: Untyped](isTermHole: Boolean, idx: Int, args: List[Tree[T]], content: Tree[T], tpt: Tree[T])(implicit src: SourceFile) extends Tree[T]

Tree that replaces a level 1 splices in pickled (level 0) quotes. It is only used when picking quotes (will never be in a TASTy file).

Tree that replaces a level 1 splices in pickled (level 0) quotes. It is only used when picking quotes (will never be in a TASTy file).

Attributes

args

The arguments of the splice to compute its content

content

Lambda that computes the content of the hole. This tree is empty when in a quote pickle.

idx

The index of the hole in it's enclosing level 0 quote.

isTermHole

If this hole is a term, otherwise it is a type hole.

tpt

Type of the hole

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Ident[-T >: Untyped] extends RefTree[T]

name

name

Attributes

Graph
Supertypes
class RefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
case class If[-T >: Untyped] extends TermTree[T]

if cond then thenp else elsep

if cond then thenp else elsep

Attributes

Graph
Supertypes
trait TermTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class InlineIf[T]
case class Import[-T >: Untyped] extends ImportOrExport[T]

import expr.selectors where a selector is either an untyped Ident, name or an untyped thicket consisting of name and rename.

import expr.selectors where a selector is either an untyped Ident, name or an untyped thicket consisting of name and rename.

Attributes

Graph
Supertypes
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
abstract class ImportOrExport[-T >: Untyped](implicit src: SourceFile) extends DenotingTree[T]

Attributes

Graph
Supertypes
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class Export[T]
class Import[T]
class InferredTypeTree[-T >: Untyped](implicit src: SourceFile) extends TypeTree[T]

A type tree whose type is inferred. These trees appear in two contexts

A type tree whose type is inferred. These trees appear in two contexts

  • as an argument of a TypeApply. In that case its type is always a TypeVar
  • as a (result-)type of an inferred ValDef or DefDef. Every TypeVar is created as the type of one InferredTypeTree.

Attributes

Graph
Supertypes
class TypeTree[T]
trait TypTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
class InlineIf[-T >: Untyped] extends If[T]

Attributes

Graph
Supertypes
class If[T]
trait TermTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
class InlineMatch[-T >: Untyped] extends Match[T]

Attributes

Graph
Supertypes
class Match[T]
trait TermTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Inlined[-T >: Untyped] extends Tree[T]

A tree representing inlined code.

A tree representing inlined code.

Attributes

bindings

Bindings for proxies to be used in the inlined code

call

Info about the original call that was inlined Until PostTyper, this is the full call, afterwards only a reference to the toplevel class from which the call was inlined.

expansion

The inlined tree, minus bindings. The full inlined code is equivalent to { bindings; expansion } The reason to keep bindings separate is because they are typed in a different context: bindings represent the arguments to the inlined call, whereas expansion represents the body of the inlined function.

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
abstract class Instance[T >: Untyped <: Type]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object tpd.type
object untpd.type
Self type
class JavaSeqLiteral[-T >: Untyped] extends SeqLiteral[T]

Array(elems)

Array(elems)

Attributes

Graph
Supertypes
class SeqLiteral[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Labeled[-T >: Untyped] extends NameTree[T]

label[tpt]: { expr }

label[tpt]: { expr }

Attributes

Graph
Supertypes
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class LambdaTypeTree[-T >: Untyped] extends TypTree[T]

[typeparams] -> tpt

[typeparams] -> tpt

Note: the type of such a tree is not necessarily a HKTypeLambda, it can also be a TypeBounds where the upper bound is an HKTypeLambda, and the lower bound is either a reference to Nothing or an HKTypeLambda, this happens because these trees are typed by HKTypeLambda#fromParams which makes sure to move bounds outside of the type lambda itself to simplify their handling in the compiler.

You may ask: why not normalize the trees too? That way,

LambdaTypeTree(X, TypeBoundsTree(A, B))

would become,

TypeBoundsTree(LambdaTypeTree(X, A), LambdaTypeTree(X, B))

which would maintain consistency between a tree and its type. The problem with this definition is that the same tree X appears twice, therefore we'd have to create two symbols for it which makes it harder to relate the source code written by the user with the trees used by the compiler (for example, to make "find all references" work in the IDE).

Attributes

Graph
Supertypes
trait TypTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
trait Lazy[+T <: AnyRef]

A base trait for lazy tree fields. These can be instantiated with Lazy instances which can delay tree construction until the field is first demanded.

A base trait for lazy tree fields. These can be instantiated with Lazy instances which can delay tree construction until the field is first demanded.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class LazyReader[T]
case class Literal[-T >: Untyped] extends Tree[T] with TermTree[T]

const

const

Attributes

Graph
Supertypes
trait TermTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Match[-T >: Untyped] extends TermTree[T]

selector match { cases }

selector match { cases }

Attributes

Graph
Supertypes
trait TermTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class InlineMatch[T]
case class MatchTypeTree[-T >: Untyped] extends TypTree[T]

[bound] selector match { cases }

[bound] selector match { cases }

Attributes

Graph
Supertypes
trait TypTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
abstract class MemberDef[-T >: Untyped](implicit src: SourceFile) extends NamedDefTree[T]

Tree defines a new symbol and carries modifiers. The position of a MemberDef contains only the defined identifier or pattern. The envelope of a MemberDef contains the whole definition and has its point on the opening keyword (or the next token after that if keyword is missing).

Tree defines a new symbol and carries modifiers. The position of a MemberDef contains only the defined identifier or pattern. The envelope of a MemberDef contains the whole definition and has its point on the opening keyword (or the next token after that if keyword is missing).

Attributes

Graph
Supertypes
class NamedDefTree[T]
trait WithEndMarker[T]
trait DefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class TypeDef[T]
class ValOrDefDef[T]
class DefDef[T]
class ValDef[T]
class EmptyValDef[T]
trait ValOrTypeDef[T]
class ModuleDef
abstract class NameTree[-T >: Untyped](implicit src: SourceFile) extends DenotingTree[T]

Tree has a name

Tree has a name

Attributes

Graph
Supertypes
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class Labeled[T]
class NamedDefTree[T]
class Bind[T]
class MemberDef[T]
class TypeDef[T]
class ValOrDefDef[T]
class DefDef[T]
class ValDef[T]
class EmptyValDef[T]
trait ValOrTypeDef[T]
class ModuleDef
class RefTree[T]
class Ident[T]
object EmptyTypeIdent.type
class Select[T]
class SelectWithSig[T]
case class NamedArg[-T >: Untyped] extends Tree[T]

name = arg, in a parameter list

name = arg, in a parameter list

Attributes

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
abstract class NamedDefTree[-T >: Untyped](implicit src: SourceFile) extends NameTree[T] with DefTree[T] with WithEndMarker[T]

Attributes

Graph
Supertypes
trait WithEndMarker[T]
trait DefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class Bind[T]
class MemberDef[T]
class TypeDef[T]
class ValOrDefDef[T]
class DefDef[T]
class ValDef[T]
class EmptyValDef[T]
trait ValOrTypeDef[T]
class ModuleDef
case class New[-T >: Untyped] extends Tree[T] with TermTree[T]

new tpt, but no constructor call

new tpt, but no constructor call

Attributes

Graph
Supertypes
trait TermTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class PackageDef[-T >: Untyped] extends ProxyTree[T] with WithEndMarker[T]

package pid { stats }

package pid { stats }

Attributes

Graph
Supertypes
trait WithEndMarker[T]
class ProxyTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
trait PatternTree[-T >: Untyped] extends Tree[T]

Instances of this class are trees which are not terms but are legal parts of patterns.

Instances of this class are trees which are not terms but are legal parts of patterns.

Attributes

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class Alternative[T]
class Bind[T]
class UnApply[T]
abstract class ProxyTree[-T >: Untyped](implicit src: SourceFile) extends Tree[T]

Tree's denot/isType/isTerm properties come from a subtree identified by forwardTo.

Tree's denot/isType/isTerm properties come from a subtree identified by forwardTo.

Attributes

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class Annotated[T]
class GenericApply[T]
class Apply[T]
class TypeApply[T]
class PackageDef[T]
class Super[T]
class Typed[T]
class UnApply[T]
class Parens
abstract class RefTree[-T >: Untyped](implicit src: SourceFile) extends NameTree[T]

Tree refers by name to a denotation

Tree refers by name to a denotation

Attributes

Graph
Supertypes
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class Ident[T]
object EmptyTypeIdent.type
class Select[T]
class SelectWithSig[T]
case class RefinedTypeTree[-T >: Untyped] extends ProxyTree[T] with TypTree[T]

tpt { refinements }

tpt { refinements }

Attributes

Graph
Supertypes
trait TypTree[T]
class ProxyTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Return[-T >: Untyped] extends TermTree[T]

return expr where from refers to the method or label from which the return takes place After program transformations this is not necessarily the enclosing method, because closures can intervene.

return expr where from refers to the method or label from which the return takes place After program transformations this is not necessarily the enclosing method, because closures can intervene.

Attributes

Graph
Supertypes
trait TermTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
class SearchFailureIdent[-T >: Untyped] extends Ident[T]

Attributes

Graph
Supertypes
class Ident[T]
class RefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Select[-T >: Untyped] extends RefTree[T]

qualifier.name, or qualifier#name, if qualifier is a type

qualifier.name, or qualifier#name, if qualifier is a type

Attributes

Graph
Supertypes
class RefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class SelectWithSig[T]
class SelectWithSig[-T >: Untyped] extends Select[T]

Attributes

Graph
Supertypes
class Select[T]
class RefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class SeqLiteral[-T >: Untyped] extends Tree[T]

Seq(elems)

Seq(elems)

Attributes

tpt

The element type of the sequence.

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
case class SingletonTypeTree[-T >: Untyped] extends DenotingTree[T] with TypTree[T]

ref.type

ref.type

Attributes

Graph
Supertypes
trait TypTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Super[-T >: Untyped] extends ProxyTree[T] with TermTree[T]

C.super[mix], where qual = C.this

C.super[mix], where qual = C.this

Attributes

Graph
Supertypes
trait TermTree[T]
class ProxyTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class Template[-T >: Untyped] extends DefTree[T] with WithLazyField[List[Tree[T]]]

extends parents { self => body }

extends parents { self => body }

Attributes

parentsOrDerived

A list of parents followed by a list of derived classes, if this is of class untpd.DerivingTemplate. Typed templates only have parents.

Graph
Supertypes
trait DefTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
case class TermLambdaTypeTree[-T >: Untyped] extends TypTree[T]

Attributes

Graph
Supertypes
trait TypTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
trait TermTree[-T >: Untyped] extends Tree[T]

Instances of this class are trees for which isTerm is definitely true. Note that some trees have isTerm = true without being TermTrees (e.g. Ident, Annotated)

Instances of this class are trees for which isTerm is definitely true. Note that some trees have isTerm = true without being TermTrees (e.g. Ident, Annotated)

Attributes

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class Assign[T]
class Closure[T]
class GenericApply[T]
class Apply[T]
class TypeApply[T]
class If[T]
class InlineIf[T]
class Literal[T]
class Match[T]
class InlineMatch[T]
class New[T]
class Return[T]
class Super[T]
class This[T]
class Try[T]
class Typed[T]
class WhileDo[T]
case class Thicket[-T >: Untyped](trees: List[Tree[T]])(implicit src: SourceFile) extends Tree[T] with WithoutTypeOrPos[T]

Temporary class that results from translation of ModuleDefs (and possibly other statements). The contained trees will be integrated when transformed with a transform(List[Tree]) call.

Temporary class that results from translation of ModuleDefs (and possibly other statements). The contained trees will be integrated when transformed with a transform(List[Tree]) call.

Attributes

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class EmptyTree[T]
case class This[-T >: Untyped] extends DenotingTree[T] with TermTree[T]

qual.this

qual.this

Attributes

Graph
Supertypes
trait TermTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
abstract class Tree[-T >: Untyped](implicit src: SourceFile) extends Positioned with SrcPos with Product with Container with Showable

Trees take a parameter indicating what the type of their tpe field is. Two choices: Type or Untyped. Untyped trees have type Tree[Untyped].

Trees take a parameter indicating what the type of their tpe field is. Two choices: Type or Untyped. Untyped trees have type Tree[Untyped].

Tree typing uses a copy-on-write implementation:

  • You can never observe a tpe which is null (throws an exception)
  • So when creating a typed tree with withType we can re-use the existing tree transparently, assigning its tpe field.
  • It is impossible to embed untyped trees in typed ones.
  • Typed trees can be embedded in untyped ones provided they are rooted in a TypedSplice node.
  • Type checking an untyped tree should remove all embedded TypedSplice nodes.

Attributes

Graph
Supertypes
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class Block[T]
class XMLBlock
class CaseDef[T]
class DenotingTree[T]
trait DefTree[T]
class NamedDefTree[T]
class Bind[T]
class MemberDef[T]
class TypeDef[T]
class ValOrDefDef[T]
class DefDef[T]
class ValDef[T]
class EmptyValDef[T]
trait ValOrTypeDef[T]
class ModuleDef
class Template[T]
class Export[T]
class Import[T]
class NameTree[T]
class Labeled[T]
class RefTree[T]
class Ident[T]
object EmptyTypeIdent.type
class Select[T]
class SelectWithSig[T]
class This[T]
class TypeTree[T]
class Hole[T]
class Inlined[T]
class Literal[T]
class NamedArg[T]
class New[T]
trait PatternTree[T]
class Alternative[T]
class UnApply[T]
class ProxyTree[T]
class Annotated[T]
class GenericApply[T]
class Apply[T]
class TypeApply[T]
class PackageDef[T]
class Super[T]
class Typed[T]
class Parens
class SeqLiteral[T]
trait TermTree[T]
class Assign[T]
class Closure[T]
class If[T]
class InlineIf[T]
class Match[T]
class InlineMatch[T]
class Return[T]
class Try[T]
class WhileDo[T]
class Thicket[T]
class EmptyTree[T]
trait TypTree[T]
class MatchTypeTree[T]
class Function
class GenAlias
class GenFrom
class MacroTree
class OpTree
class InfixOp
class PostfixOp
class PrefixOp
class Tuple
case class Try[-T >: Untyped] extends TermTree[T]

try block catch cases finally finalizer

try block catch cases finally finalizer

Attributes

Graph
Supertypes
trait TermTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
trait TypTree[-T >: Untyped] extends Tree[T]

Instances of this class are trees for which isType is definitely true. Note that some trees have isType = true without being TypTrees (e.g. Ident, Annotated)

Instances of this class are trees for which isType is definitely true. Note that some trees have isType = true without being TypTrees (e.g. Ident, Annotated)

Attributes

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
case class TypeApply[-T >: Untyped] extends GenericApply[T]

fun[args]

fun[args]

Attributes

Graph
Supertypes
class GenericApply[T]
trait TermTree[T]
class ProxyTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class TypeBoundsTree[-T >: Untyped] extends TypTree[T]

: lo <: hi : lo <: hi = alias for RHS of bounded opaque type

Attributes

Graph
Supertypes
trait TypTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class TypeDef[-T >: Untyped] extends MemberDef[T] with ValOrTypeDef[T]

mods class name template or mods trait name template or mods type name = rhs or mods type name >: lo <: hi, if rhs = TypeBoundsTree(lo, hi) or mods type name >: lo <: hi = rhs if rhs = TypeBoundsTree(lo, hi, alias) and opaque in mods

mods class name template or mods trait name template or mods type name = rhs or mods type name >: lo <: hi, if rhs = TypeBoundsTree(lo, hi) or mods type name >: lo <: hi = rhs if rhs = TypeBoundsTree(lo, hi, alias) and opaque in mods

Attributes

Graph
Supertypes
trait ValOrTypeDef[T]
class MemberDef[T]
class NamedDefTree[T]
trait WithEndMarker[T]
trait DefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class TypeTree[-T >: Untyped]()(implicit src: SourceFile) extends DenotingTree[T] with TypTree[T]

A type tree that represents an existing or inferred type

A type tree that represents an existing or inferred type

Attributes

Graph
Supertypes
trait TypTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
case class Typed[-T >: Untyped] extends ProxyTree[T] with TermTree[T]

expr : tpt

expr : tpt

Attributes

Graph
Supertypes
trait TermTree[T]
class ProxyTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
case class UnApply[-T >: Untyped] extends ProxyTree[T] with PatternTree[T]

The typed translation of extractor(patterns) in a pattern. The translation has the following components:

The typed translation of extractor(patterns) in a pattern. The translation has the following components:

Attributes

fun

is extractor.unapply (or, for backwards compatibility, extractor.unapplySeq) possibly with type parameters

implicits

Any implicit parameters passed to the unapply after the selector

patterns

The argument patterns in the pattern match. It is typed with same type as first fun argument Given a match selector sel a pattern UnApply(fun, implicits, patterns) is roughly translated as follows val result = fun(sel)(implicits) if (result.isDefined) "match patterns against result"

Graph
Supertypes
trait PatternTree[T]
class ProxyTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any

Attributes

Graph
Supertypes
class Exception
class Throwable
class Object
trait Matchable
class Any
case class ValDef[-T >: Untyped] extends ValOrDefDef[T] with ValOrTypeDef[T]

mods val name: tpt = rhs

mods val name: tpt = rhs

Attributes

Graph
Supertypes
trait ValOrTypeDef[T]
class ValOrDefDef[T]
class MemberDef[T]
class NamedDefTree[T]
trait WithEndMarker[T]
trait DefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class EmptyValDef[T]
abstract class ValOrDefDef[-T >: Untyped](implicit src: SourceFile) extends MemberDef[T] with WithLazyField[Tree[T]]

A ValDef or DefDef tree

A ValDef or DefDef tree

Attributes

Graph
Supertypes
class MemberDef[T]
class NamedDefTree[T]
trait WithEndMarker[T]
trait DefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class DefDef[T]
class ValDef[T]
class EmptyValDef[T]
trait ValOrTypeDef[-T >: Untyped] extends MemberDef[T]

Attributes

Graph
Supertypes
class MemberDef[T]
class NamedDefTree[T]
trait WithEndMarker[T]
trait DefTree[T]
class NameTree[T]
class DenotingTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class TypeDef[T]
class ValDef[T]
class EmptyValDef[T]
case class WhileDo[-T >: Untyped] extends TermTree[T]

while (cond) { body }

while (cond) { body }

Attributes

Graph
Supertypes
trait TermTree[T]
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait WithEndMarker[-T >: Untyped]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class NamedDefTree[T]
class Bind[T]
class MemberDef[T]
class TypeDef[T]
class ValOrDefDef[T]
class DefDef[T]
class ValDef[T]
class EmptyValDef[T]
trait ValOrTypeDef[T]
class ModuleDef
class PackageDef[T]
Self type
trait WithLazyField[+T <: AnyRef]

A tree that can have a lazy field The field is represented by some private var which is accessed by unforced and force. Forcing the field will set the var to the underlying value.

A tree that can have a lazy field The field is represented by some private var which is accessed by unforced and force. Forcing the field will set the var to the underlying value.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Template[T]
class ValOrDefDef[T]
class DefDef[T]
class ValDef[T]
class EmptyValDef[T]
trait WithoutTypeOrPos[-T >: Untyped] extends Tree[T]

Attributes

Graph
Supertypes
class Tree[T]
trait Showable
trait Container
trait Cloneable
trait Product
trait Equals
trait SrcPos
class Object
trait Matchable
class Any
Known subtypes
class EmptyValDef[T]
class Thicket[T]
class EmptyTree[T]
object EmptyTypeIdent.type

Types

type LazyTree[-T >: Untyped] = Tree[T] | Lazy[Tree[T]]
type LazyTreeList[-T >: Untyped] = List[Tree[T]] | Lazy[List[Tree[T]]]
type ParamClause[T >: Untyped] = List[ValDef[T]] | List[TypeDef[T]]
type Untyped = Nothing

Value members

Concrete methods

def flatten[T >: Untyped](trees: List[Tree[T]]): List[Tree[T]]

Concrete fields

Property key for backquoted identifiers and definitions

Property key for backquoted identifiers and definitions

Attributes

Property key for trees with documentation strings attached

Property key for trees with documentation strings attached

Attributes

var ntrees: Int

The total number of created tree nodes, maintained if Stats.enabled

The total number of created tree nodes, maintained if Stats.enabled

Attributes

Extensions

Extensions

extension (mdef: DefTree)