Some handy extractors for spotting trees through the the haze of irrelevant braces: i.
The depth of the nested applies: e.
The depth of the nested applies: e.g. Apply(Apply(Apply(_, _), _), _) has depth 3. Continues through type applications (without counting them.)
Does this CaseDef catch everything of a certain Type?
Does this CaseDef catch everything of a certain Type?
Does this CaseDef catch Throwable?
Does this CaseDef catch Throwable?
The first constructor definitions in stats
The first constructor definitions in stats
The arguments to the first constructor in stats
.
The arguments to the first constructor in stats
.
Does list of trees start with a definition of a class of module with given name (ignoring imports)
If this tree represents a type application (after unwrapping any applies) the first type argument.
If this tree represents a type application (after unwrapping any applies) the first type argument. Otherwise, EmptyTree.
Is tpt a by-name parameter type of the form => T?
Is tpt a by-name parameter type of the form => T?
Is this pattern node a catch-all or type-test pattern?
Is this pattern node a catch-all or type-test pattern?
Is tree a declaration or type definition?
Is tree a declaration or type definition?
Is this pattern node a catch-all (wildcard or variable) pattern?
Is this pattern node a catch-all (wildcard or variable) pattern?
Is tree an expression which can be inlined without affecting program semantics?
Is tree an expression which can be inlined without affecting program semantics?
Note that this is not called "isExprSafeToInline" since purity (lack of side-effects) is not the litmus test. References to modules and lazy vals are side-effecting, both because side-effecting code may be executed and because the first reference takes a different code path than all to follow; but they are safe to inline because the expression result from evaluating them is always the same.
Is tree legal as a member definition of an interface?
Is name a left-associative operator?
Is name a left-associative operator?
Is tree a pure (i.
Is tpt a vararg type of the form T* ?
Is tpt a vararg type of the form T* ?
Is tree a this
node which belongs to enclClass
?
Is tree a this
node which belongs to enclClass
?
Is tree a self constructor call this(.
Is tree a self constructor call this(...)? I.e. a call to a constructor of the same object?
Is tree a self or super constructor call?
Is tree a self or super constructor call?
Is this pattern node a sequence-valued pattern?
Is this pattern node a sequence-valued pattern?
Is this tree a Star(_) after removing bindings?
Is this tree a Star(_) after removing bindings?
Is tree a super constructor call?
Is tree a super constructor call?
Is tree a variable pattern?
Is tree a variable pattern?
Is name a variable name?
Is name a variable name?
Is tree a mutable variable, or the getter of a mutable field?
Is tree a mutable variable, or the getter of a mutable field?
Is this tree comprised of nothing but identifiers, but possibly in bindings or tuples? For instance
Is this tree comprised of nothing but identifiers, but possibly in bindings or tuples? For instance
foo @ (bar, (baz, quux))
is a variable pattern; if the structure matches, then the remainder is inevitable.
Is the argument a wildcard argument of the form _
or x @ _
?
Is the argument a wildcard argument of the form _
or x @ _
?
Is this argument node of the form <expr> : _* ?
Is this argument node of the form <expr> : _* ?
Does this argument list end with an argument of the form <expr> : _* ?
Does this argument list end with an argument of the form <expr> : _* ?
can this type be a type pattern
can this type be a type pattern
Is symbol potentially a getter of a variable?
Is symbol potentially a getter of a variable?
The method part of an application node
The method part of an application node
Is this file the body of a compilation unit which should not have Predef imported?
Is this file the body of a compilation unit which should not have Predef imported?
The value definitions marked PRESUPER in this statement sequence
The value definitions marked PRESUPER in this statement sequence
The parameter ValDefs of a method definition that have vararg types of the form T*
The parameter ValDefs of a method definition that have vararg types of the form T*
If this tree has type parameters, those.
If this tree has type parameters, those. Otherwise Nil.
The underlying pattern ignoring any bindings
The underlying pattern ignoring any bindings
(Since version 2.10.0) Use isExprSafeToInline instead