Some handy extractors for spotting trees through the the haze of irrelevant braces: i.
Test two objects for inequality.
Test two objects for inequality.
true
if !(this == that), false otherwise.
Equivalent to x.hashCode
except for boxed numeric types and null
.
Equivalent to x.hashCode
except for boxed numeric types and null
.
For numerics, it returns a hash value which is consistent
with value equality: if two value type instances compare
as true, then ## will produce the same hash value for each
of them.
For null
returns a hashcode where null.hashCode
throws a
NullPointerException
.
a hash value consistent with ==
Test two objects for equality.
Test two objects for equality.
The expression x == that
is equivalent to if (x eq null) that eq null else x.equals(that)
.
true
if the receiver object is equivalent to the argument; false
otherwise.
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.)
Cast the receiver object to be of type T0
.
Cast the receiver object to be of type T0
.
Note that the success of a cast at runtime is modulo Scala's erasure semantics.
Therefore the expression 1.asInstanceOf[String]
will throw a ClassCastException
at
runtime, while the expression List(1).asInstanceOf[List[String]]
will not.
In the latter example, because the type argument is erased as part of compilation it is
not possible to check whether the contents of the list are of the requested type.
the receiver object.
if the receiver object is not an instance of the erasure of type T0
.
Does this CaseDef catch everything of a certain Type?
Does this CaseDef catch Throwable?
Create a copy of the receiver object.
Tests whether the argument (arg0
) is a reference to the receiver object (this
).
Tests whether the argument (arg0
) is a reference to the receiver object (this
).
The eq
method implements an equivalence relation on
non-null instances of AnyRef
, and has three additional properties:
x
and y
of type AnyRef
, multiple invocations of
x.eq(y)
consistently returns true
or consistently returns false
.x
of type AnyRef
, x.eq(null)
and null.eq(x)
returns false
.null.eq(null)
returns true
. When overriding the equals
or hashCode
methods, it is important to ensure that their behavior is
consistent with reference equality. Therefore, if two objects are references to each other (o1 eq o2
), they
should be equal to each other (o1 == o2
) and they should hash to the same value (o1.hashCode == o2.hashCode
).
true
if the argument is a reference to the receiver object; false
otherwise.
The equality method for reference types.
Called by the garbage collector on the receiver object when there are no more references to the object.
Called by the garbage collector on the receiver object when there are no more references to the object.
The details of when and if the finalize
method is invoked, as
well as the interaction between finalize
and non-local returns
and exceptions, are all platform dependent.
The first constructor definitions 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.
Returns string formatted according to given format
string.
Returns string formatted according to given format
string.
Format strings are as for String.format
(@see java.lang.String.format).
A representation that corresponds to the dynamic class of the receiver object.
A representation that corresponds to the dynamic class of the receiver object.
The nature of the representation is platform dependent.
a representation that corresponds to the dynamic class of the receiver object.
not specified by SLS as a member of AnyRef
The hashCode method for reference types.
Is tpt a by-name parameter type of the form => T?
Is this pattern node a catch-all or type-test pattern?
Is tree a declaration or type definition?
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.
Test whether the dynamic type of the receiver object is T0
.
Test whether the dynamic type of the receiver object is T0
.
Note that the result of the test is modulo Scala's erasure semantics.
Therefore the expression 1.isInstanceOf[String]
will return false
, while the
expression List(1).isInstanceOf[List[String]]
will return true
.
In the latter example, because the type argument is erased as part of compilation it is
not possible to check whether the contents of the list are of the specified type.
true
if the receiver object is an instance of erasure of type T0
; false
otherwise.
Is tree legal as a member definition of an interface?
Is name a left-associative operator?
Is tree a pure (i.
Is tree a pure (i.e. non-side-effecting) definition?
Is tpt a vararg type of the form T* ?
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 this pattern node a sequence-valued pattern?
Is this tree a Star(_) after removing bindings?
Is tree a super constructor call?
a Match(Typed(_, tpt), _) must be translated into a switch if isSwitchAnnotation(tpt.
a Match(Typed(_, tpt), _) must be translated into a switch if isSwitchAnnotation(tpt.tpe)
a Match(Typed(_, tpt), _) is unchecked if isUncheckedAnnotation(tpt.
a Match(Typed(_, tpt), _) is unchecked if isUncheckedAnnotation(tpt.tpe)
Is tree a variable pattern?
Is name a variable name?
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 this argument node of the form <expr> : _* ?
Does this argument list end with an argument of the form <expr> : _* ?
can this type be a type pattern
Is symbol potentially a getter of a variable?
The method part of an application node
Equivalent to !(this eq that)
.
Equivalent to !(this eq that)
.
true
if the argument is not a reference to the receiver object; false
otherwise.
Is this file the body of a compilation unit which should not have Predef imported?
Wakes up a single thread that is waiting on the receiver object's monitor.
Wakes up a single thread that is waiting on the receiver object's monitor.
not specified by SLS as a member of AnyRef
Wakes up all threads that are waiting on the receiver object's monitor.
Wakes up all threads that are waiting on the receiver object's monitor.
not specified by SLS as a member of AnyRef
The value definitions marked PRESUPER in this statement sequence
The parameter ValDefs of a method definition that have vararg types of the form T*
Named arguments can transform a constructor call into a block, e.
Named arguments can transform a constructor call into a block, e.g. <init>(b = foo, a = bar) is transformed to { val x$1 = foo val x$2 = bar <init>(x$2, x$1) }
Creates a String representation of this object.
Creates a String representation of this object. The default representation is platform dependent. On the java platform it is the concatenation of the class name, "@", and the object's hashcode in hexadecimal.
a String representation of the object.
If this tree has type parameters, those.
If this tree has type parameters, those. Otherwise Nil.
The underlying pattern ignoring any bindings
(Since version 2.10.0) Use isExprSafeToInline instead
(Since version 2.10.0) Use leftOfArrow instead
(Since version 2.10.0) Use resultOfEnsuring instead
This class ...
1.0