scala.tools.nsc.typechecker.Contexts
Is this context in all modes in the given mask
?
Is this context in all modes in the given mask
?
A bitmask containing all the boolean flags in a context, e.
A bitmask containing all the boolean flags in a context, e.g. are implicit views enabled
These messages are printed when issuing an error
These messages are printed when issuing an error
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.
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.
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.
Issue/throw the given err
according to the current mode for error reporting.
Issue/throw the given err
according to the current mode for error reporting.
Return and clear the undetermined type parameters
Return and clear the undetermined type parameters
The first error, if any, in the report buffer
The first error, if any, in the report buffer
Equivalent to imports.headOption
, but more efficient
Issue and clear all warnings from the report buffer
Issue and clear all warnings from the report buffer
Return and clear all errors from the report buffer
Return and clear all errors from the report buffer
Clear all errors from the report buffer
Clear all errors from the report buffer
Does the report buffer contain any errors?
Does the report buffer contain any errors?
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
true if the expr
evaluates to true within a silent Context that incurs no errors
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.
Is the owning symbol of this context a term?
Is the owning symbol of this context a term?
Issue/buffer/throw the given type error according to the current mode for error reporting.
Issue/buffer/throw the given type error according to the current mode for error reporting.
Issue/buffer/throw the given implicit ambiguity error according to the current mode for error reporting.
Issue/buffer/throw the given implicit ambiguity error according to the current mode for error reporting.
Issue/buffer/throw the given implicit ambiguity error according to the current mode for error reporting.
Issue/buffer/throw the given implicit ambiguity error according to the current mode for error reporting.
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.
Types for which implicit arguments are currently searched
Types for which implicit arguments are currently searched
The current owner
The current owner
A buffer for errors and warnings, used with this.bufferErrors == true
A buffer for errors and warnings, used with this.bufferErrors == true
Discard the current report buffer, and replace with other
Discard the current report buffer, and replace with other
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.
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
Append the given errors to the report buffer
Append the given errors to the report buffer
Discard the current report buffer, and replace with an empty one
Discard the current report buffer, and replace with an empty one
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.