Trees
Type members
Classlikes
case pat if guard => body; only appears as child of a Match
case pat if guard => body; only appears as child of a Match
A closure with an environment and a reference to a method.
A closure with an environment and a reference to a method.
- Value Params
- 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.
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
.
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
.
A tree representing inlined code.
A tree representing inlined code.
- Value Params
- 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, whereasexpansion
represents the body of the inlined function.
[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).
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.
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).
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.
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
.
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.
qualifier.name, or qualifier#name, if qualifier is a type
qualifier.name, or qualifier#name, if qualifier is a type
extends parents { self => body }
extends parents { self => body }
- Value Params
- parentsOrDerived
A list of parents followed by a list of derived classes, if this is of class untpd.DerivingTemplate. Typed templates only have parents.
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)
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.
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 isnull
(throws an exception) - So when creating a typed tree with
withType
we can re-use the existing tree transparently, assigning itstpe
field, provided it wasnull
before. - 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.
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)
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
A type tree that represents an existing or inferred type
A type tree that represents an existing or inferred type
A type tree that defines a new type variable. Its type is always a TypeVar. Every TypeVar is created as the type of one TypeVarBinder.
A type tree that defines a new type variable. Its type is always a TypeVar. Every TypeVar is created as the type of one TypeVarBinder.
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:
- Value Params
- 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 selectorsel
a pattern UnApply(fun, implicits, patterns) is roughly translated as follows val result = fun(sel)(implicits) if (result.isDefined) "match patterns against result"
A ValDef or DefDef tree
A ValDef or DefDef tree
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.
Value members
Concrete methods
Concrete fields
Property key for backquoted identifiers and definitions
Property key for backquoted identifiers and definitions
Property key for trees with documentation strings attached
Property key for trees with documentation strings attached