trait TreeInfo [ T ]

Constructors

Members

[+] class MatchingArgs
[+] val isNamedArg : Any => Boolean
[+] def arguments ( tree: Tree ) : List [ Tree ]

The (last) list of arguments of an application

The (last) list of arguments of an application

[+] def catchesAllOf ( cdef: CaseDef , threshold: Type ) ( implicit ctx: Context ) : Boolean

Does this CaseDef catch everything of a certain Type?

Does this CaseDef catch everything of a certain Type?

[+] def catchesThrowable ( cdef: CaseDef ) ( implicit ctx: Context ) : Boolean

Does this CaseDef catch Throwable?

Does this CaseDef catch Throwable?

[+] def defKind ( tree: Tree ) : FlagSet

The largest subset of {NoInits, PureInterface} that a trait enclosing this statement can have as flags. Does tree contain an initialization part when se...

The largest subset of {NoInits, PureInterface} that a trait enclosing this statement can have as flags. Does tree contain an initialization part when seen as a member of a class or trait?

[+] def firstConstructor ( stats: List [ Tree ] ) : Tree

The first constructor definition in stats

The first constructor definition in stats

[+] def firstConstructorArgs ( stats: List [ Tree ] ) : List [ Tree ]

The arguments to the first constructor in stats.

The arguments to the first constructor in stats.

[+] def forallResults ( tree: Tree , p: Tree => 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 isDeclarationOrTypeDef ( tree: Tree ) : Boolean
[+] def isDefaultCase ( cdef: CaseDef ) : 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: CaseDef ) : Boolean

Is this case guarded?

Is this case guarded?

[+] def isLeftAssoc ( operator: Name ) : Boolean

Is name a left-associative operator?

Is name a left-associative operator?

[+] def isOpAssign ( tree: Tree ) : Boolean
[+] def isRepeatedParamType ( tpt: Tree ) ( implicit ctx: 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: Tree ) : 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: Tree ) : Boolean
[+] def isSuperConstrCall ( tree: Tree ) : Boolean

Is tree a super constructor call?

Is tree a super constructor call?

[+] def isSuperSelection ( tree: Tree ) : Boolean
[+] def isSyntheticDefaultCase ( cdef: CaseDef ) : 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 isVarPattern ( pat: Tree ) : Boolean

Is tree a variable pattern?

Is tree a variable pattern?

[+] def isWildcardArg ( tree: Tree ) : 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: Tree ) ( implicit ctx: Context ) : Boolean

Is this argument node of the form : _* ?

Is this argument node of the form : _* ?

[+] def isWildcardStarArgList ( trees: List [ Tree ] ) ( implicit ctx: 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 mayBeTypePat ( tree: Tree ) : Boolean

can this type be a type pattern?

can this type be a type pattern?

[+] def methPart ( tree: Tree ) : Tree

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 nam...

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: Tree ) : Int

The number of arguments in an application

The number of arguments in an application

[+] def stripApply ( tree: Tree ) : Tree

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 unbind ( x: Tree ) : Tree

The underlying pattern ignoring any bindings

The underlying pattern ignoring any bindings

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