TreeInfo

trait TreeInfo[T >: Untyped <: Type]
Companion
object
class Object
trait Matchable
class Any
object tpd
object untpd

Type members

Classlikes

class MatchingArgs(params: List[Symbol], args: List[Tree])(using `x$3`: Context)

Value members

Concrete methods

def allParamSyms(ddef: `<none>`)(using Context): List[Symbol]

All type and value parameter symbols of this DefDef

All type and value parameter symbols of this DefDef

def arguments(tree: `<none>`): List[`<none>`]

The (last) list of arguments of an application

The (last) list of arguments of an application

def catchesAllOf(cdef: `<none>`, threshold: Type)(using Context): Boolean

Does this CaseDef catch everything of a certain Type?

Does this CaseDef catch everything of a certain Type?

def catchesThrowable(cdef: `<none>`)(using Context): Boolean

Does this CaseDef catch Throwable?

Does this CaseDef catch Throwable?

def firstConstructor(stats: List[`<none>`]): `<none>`

The first constructor definition in stats

The first constructor definition in stats

def forallResults(tree: `<none>`, p: `<none>` => Boolean): Boolean

Checks whether predicate p is true for all result parts of this expression, where we zoom into Ifs, Matches, and Blocks.

Checks whether predicate p is true for all result parts of this expression, where we zoom into Ifs, Matches, and Blocks.

def hasNamedArg(args: List[Any]): Boolean

Does this list contain a named argument tree?

Does this list contain a named argument tree?

def isBackquoted(tree: `<none>`): Boolean

Is tree a backquoted identifier or definition

Is tree a backquoted identifier or definition

def isDeclarationOrTypeDef(tree: `<none>`): Boolean
def isDefaultCase(cdef: `<none>`): Boolean

Is this pattern node a catch-all (wildcard or variable) pattern?

Is this pattern node a catch-all (wildcard or variable) pattern?

def isGuardedCase(cdef: `<none>`): Boolean

Is this case guarded?

Is this case guarded?

def isOpAssign(tree: `<none>`): Boolean
def isPath(tree: `<none>`): Boolean

Is tree a path?

Is tree a path?

def isRepeatedParamType(tpt: `<none>`)(using Context): Boolean

Is tpt a vararg type of the form T* or => T*?

Is tpt a vararg type of the form T* or => T*?

def isSelfConstrCall(tree: `<none>`): Boolean

Is tree a self constructor call this(...)? I.e. a call to a constructor of the same object?

Is tree a self constructor call this(...)? I.e. a call to a constructor of the same object?

def isSelfOrSuperConstrCall(tree: `<none>`): Boolean
def isSuperConstrCall(tree: `<none>`): Boolean

Is tree a super constructor call?

Is tree a super constructor call?

def isSuperSelection(tree: `<none>`): Boolean
def isSyntheticDefaultCase(cdef: `<none>`): Boolean

Is this pattern node a synthetic catch-all case, added during PartialFuction synthesis before we know whether the user provided cases are exhaustive.

Is this pattern node a synthetic catch-all case, added during PartialFuction synthesis before we know whether the user provided cases are exhaustive.

def isTypeParamClause(params: `<none>`)(using Context): Boolean
def isUsingClause(params: `<none>`)(using Context): Boolean

Is this parameter list a using clause?

Is this parameter list a using clause?

def isUsingOrTypeParamClause(params: `<none>`)(using Context): Boolean
def isVarPattern(pat: `<none>`): Boolean

Is tree a variable pattern?

Is tree a variable pattern?

def isWildcardArg(tree: `<none>`): Boolean

Is the argument a wildcard argument of the form _ or x @ _?

Is the argument a wildcard argument of the form _ or x @ _?

def isWildcardStarArg(tree: `<none>`)(using Context): Boolean

Is this argument node of the form *, or is it a reference to such an argument ? The latter case can happen when an argument is lifted.

Is this argument node of the form *, or is it a reference to such an argument ? The latter case can happen when an argument is lifted.

def isWildcardStarArgList(trees: List[`<none>`])(using Context): Boolean

Does this argument list end with an argument of the form : _* ?

Does this argument list end with an argument of the form : _* ?

def languageImport(path: `<none>`): Option[TermName]

If path looks like a language import, Some(name) where name is experimental if that sub-module is imported, and the empty term name otherwise.

If path looks like a language import, Some(name) where name is experimental if that sub-module is imported, and the empty term name otherwise.

def methPart(tree: `<none>`): `<none>`

The method part of an application node, possibly enclosed in a block with only valdefs as statements. the reason for also considering blocks is that named arguments can transform a call into a block, e.g. (b = foo, a = bar) is transformed to { val x$1 = foo val x$2 = bar (x$2, x$1) }

The method part of an application node, possibly enclosed in a block with only valdefs as statements. the reason for also considering blocks is that named arguments can transform a call into a block, e.g. (b = foo, a = bar) is transformed to { val x$1 = foo val x$2 = bar (x$2, x$1) }

def numArgs(tree: `<none>`): Int

The number of arguments in an application

The number of arguments in an application

def parentsKind(parents: List[`<none>`])(using Context): FlagSet

The largest subset of {NoInits, PureInterface} that a trait or class with these parents can have as flags.

The largest subset of {NoInits, PureInterface} that a trait or class with these parents can have as flags.

def stripAnnotated(tree: `<none>`): `<none>`
def stripApply(tree: `<none>`): `<none>`

If this is an application, its function part, stripping all Apply nodes (but leaving TypeApply nodes in). Otherwise the tree itself.

If this is an application, its function part, stripping all Apply nodes (but leaving TypeApply nodes in). Otherwise the tree itself.

def stripBlock(tree: `<none>`): `<none>`

If this is a block, its expression part

If this is a block, its expression part

def stripInlined(tree: `<none>`): `<none>`
def unbind(x: `<none>`): `<none>`

The underlying pattern ignoring any bindings

The underlying pattern ignoring any bindings

def unsplice(tree: Tree[T]): Tree[T]

Concrete fields

val isNamedArg: Any => Boolean