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 ==
The expression x == that
is equivalent to if (x eq null) that eq null else x.equals(that)
.
The expression x == that
is equivalent to if (x eq null) that eq null else x.equals(that)
.
the object to compare against this object for equality.
true
if the receiver object is equivalent to the argument; false
otherwise.
Is this context in all modes in the given mask
?
Is this context in all modes in the given mask
?
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.
ClassCastException
if the receiver object is not an instance of the erasure of type T0
.
Create a copy of the receiver object.
Create a copy of the receiver object.
The default implementation of the clone
method is platform dependent.
a copy of the receiver object.
not specified by SLS as a member of AnyRef
A bitmask containing all the boolean flags in a context, e.g.
A bitmask containing all the boolean flags in a context, e.g. are implicit views enabled
To enrich error messages involving default arguments.
To enrich error messages involving default arguments. When extending the notion, group diagnostics in an object.
The next outer context whose tree is a template or package definition
The next outer context whose tree is a template or package definition
The next enclosing context (potentially this
) that is owned by a class or method
The next enclosing context (potentially this
) that is owned by a class or method
The next outer context whose tree is a method
The next outer context whose tree is a method
...or an Apply.
...or an Apply.
The next enclosing context (potentially this
) that has a CaseDef
as a tree
The next enclosing context (potentially this
) that has a CaseDef
as a tree
Return the closest enclosing context that defines a subclass of clazz
or a companion object thereof, or NoContext
if no such context exists.
Return the closest enclosing context that defines a subclass of clazz
or a companion object thereof, or NoContext
if no such context exists.
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.
Issue/throw the given error message according to the current mode for error reporting.
Issue/throw the given error message according to the current mode for error reporting.
Return and clear the undetermined type parameters
Return and clear the undetermined type parameters
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.
not specified by SLS as a member of AnyRef
Equivalent to imports.headOption
, but more efficient
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.
The symbol with name name
imported via the import in imp
,
if any such symbol is accessible from this context.
The symbol with name name
imported via the import in imp
,
if any such symbol is accessible from this context.
The currently visible imports
Use reporter (possibly buffered) for errors/warnings and enable implicit conversion *
Use reporter (possibly buffered) for errors/warnings and enable implicit conversion *
Is sym
accessible as a member of pre
in current context?
Is sym
accessible as a member of pre
in current context?
Is sym
defined in package object of package pkg
?
Since sym may be defined in some parent of the package object,
we cannot inspect its owner only; we have to go through the
info of the package object.
Is sym
defined in package object of package pkg
?
Since sym may be defined in some parent of the package object,
we cannot inspect its owner only; we have to go through the
info of the package object. However to avoid cycles we'll check
what other ways we can before pushing that way.
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.
Find a symbol in this context or one of its outers.
Find a symbol in this context or one of its outers.
Used to find symbols are owned by methods (or fields), they can't be found in some scope.
Examples: companion module of classes owned by a method, default getter methods of nested methods. See NamesDefaults.scala
Find the symbol of a simple name starting from this context.
Find the symbol of a simple name starting from this context. All names are filtered through the "qualifies" predicate, the search continuing as long as no qualifying name is found.
Construct a child context.
Construct a child context. The parent and child will share the report buffer.
Compare with makeSilent
, in which the child has a fresh report buffer.
If tree
is an Import
, that import will be avaiable at the head of
Context#imports
.
A context for typing constructor parameter ValDefs, super or self invocation arguments and default getters of constructors.
A context for typing constructor parameter ValDefs, super or self invocation arguments and default getters of constructors. These expressions need to be type checked in a scope outside the class, cf. spec 5.3.1.
This method is called by namer / typer where this
is the context for the constructor DefDef. The
owner of the resulting (new) context is the outer context for the Template, i.e. the context for the
ClassDef. This means that class type parameters will be in scope. The value parameters of the current
constructor are also entered into the new constructor scope. Members of the class however will not be
accessible.
Make a silent child context does not allow implicits.
Make a silent child context does not allow implicits. Used to prevent chaining of implicit views.
Make a child context that represents a new nested scope
Make a child context that represents a new nested scope
Make a child context that buffers errors and warnings into a fresh report buffer.
Make a child context that buffers errors and warnings into a fresh report buffer.
Equivalent to !(this eq that)
.
Equivalent to !(this eq that)
.
true
if the argument is not a reference to the receiver object; false
otherwise.
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
Types for which implicit arguments are currently searched
Types for which implicit arguments are currently searched
The current owner
The current owner
Saved type bounds for type parameters which are narrowed in a GADT.
Saved type bounds for type parameters which are narrowed in a GADT.
Run body
with this context with no undetermined type parameters, restore the original
the original list afterwards.
Run body
with this context with no undetermined type parameters, restore the original
the original list afterwards.
Should ambiguous errors be reported during evaluation of body
?
The current scope
The current scope
Set all modes in the mask enable
to true, and all in disable
to false.
Set all modes in the mask enable
to true, and all in disable
to false.
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.
Tree associated with this context
Tree associated with this context
Undetermined type parameters.
Undetermined type parameters. See Infer#{inferExprInstance, adjustTypeArgs}
. Not inherited to child contexts
Update all modes in mask
to value
Update all modes in mask
to value
Variance relative to enclosing class
Variance relative to enclosing class
Issue/throw the given error message according to the current mode for error reporting.
Issue/throw the given error message according to the current mode for error reporting.
TypeConstructorAllowed is enabled when we are typing a higher-kinded type.
TypeConstructorAllowed is enabled when we are typing a higher-kinded type. adapt should then check kind-arity based on the prototypical type's kind arity. Type arguments should not be inferred.