trait ImportContext extends Analyzer.Context
- Alphabetic
- By Inheritance
- ImportContext
- Context
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Type Members
Value Members
-
final
def
!=(arg0: Any): Boolean
Test two objects for inequality.
Test two objects for inequality.
- returns
true
if !(this == that), false otherwise.
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
Equivalent to
x.hashCode
except for boxed numeric types andnull
.Equivalent to
x.hashCode
except for boxed numeric types andnull
. 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. Fornull
returns a hashcode wherenull.hashCode
throws aNullPointerException
.- returns
a hash value consistent with ==
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from Analyzer.ImportContext to any2stringadd[Analyzer.ImportContext] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (Analyzer.ImportContext, B)
- Implicit
- This member is added by an implicit conversion from Analyzer.ImportContext to ArrowAssoc[Analyzer.ImportContext] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
The expression
x == that
is equivalent toif (x eq null) that eq null else x.equals(that)
.The expression
x == that
is equivalent toif (x eq null) that eq null else x.equals(that)
.- returns
true
if the receiver object is equivalent to the argument;false
otherwise.
- Definition Classes
- AnyRef → Any
-
def
ambiguousErrors: Boolean
- Definition Classes
- Context
-
def
apply(mask: ContextMode): Boolean
Is this context in all modes in the given
mask
?Is this context in all modes in the given
mask
?- Definition Classes
- Context
-
final
def
asInstanceOf[T0]: T0
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 aClassCastException
at runtime, while the expressionList(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.- returns
the receiver object.
- Definition Classes
- Any
- Exceptions thrown
ClassCastException
if the receiver object is not an instance of the erasure of typeT0
.
-
def
bufferErrors: Boolean
- Definition Classes
- Context
-
def
clone(): AnyRef
Create a copy of the receiver object.
Create a copy of the receiver object.
The default implementation of the
clone
method is platform dependent.- returns
a copy of the receiver object.
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- Note
not specified by SLS as a member of AnyRef
-
var
contextMode: ContextMode
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
- Definition Classes
- Context
-
def
defaultModeForTyped: Mode
- Definition Classes
- Context
-
def
deprecationWarning(pos: Global.Position, sym: Global.Symbol): Unit
- Definition Classes
- Context
-
def
deprecationWarning(pos: Global.Position, sym: Global.Symbol, msg: String, since: String): Unit
- Definition Classes
- Context
-
val
depth: Int
- Definition Classes
- Context
-
var
diagUsedDefaults: Boolean
To enrich error messages involving default arguments.
To enrich error messages involving default arguments. When extending the notion, group diagnostics in an object.
- Definition Classes
- Context
-
def
echo(pos: Global.Position, msg: String): Unit
- Definition Classes
- Context
-
var
enclClass: Analyzer.Context
The next outer context whose tree is a template or package definition
The next outer context whose tree is a template or package definition
- Definition Classes
- Context
-
def
enclClassOrMethod: Analyzer.Context
The next enclosing context (potentially
this
) that is owned by a class or methodThe next enclosing context (potentially
this
) that is owned by a class or method- Definition Classes
- Context
-
var
enclMethod: Analyzer.Context
The next outer context whose tree is a method
The next outer context whose tree is a method
- Definition Classes
- Context
-
def
enclosingApply: Analyzer.Context
...or an Apply.
...or an Apply.
- Definition Classes
- Context
-
def
enclosingCaseDef: Analyzer.Context
The next enclosing context (potentially
this
) that has aCaseDef
as a treeThe next enclosing context (potentially
this
) that has aCaseDef
as a tree- Definition Classes
- Context
-
def
enclosingContextChain: List[Analyzer.Context]
- Definition Classes
- Context
-
def
enclosingNonImportContext: Analyzer.Context
- Definition Classes
- Context
-
def
enclosingSubClassContext(clazz: Global.Symbol): Analyzer.Context
Return the closest enclosing context that defines a subclass of
clazz
or a companion object thereof, orNoContext
if no such context exists.Return the closest enclosing context that defines a subclass of
clazz
or a companion object thereof, orNoContext
if no such context exists.- Definition Classes
- Context
-
def
enrichmentEnabled: Boolean
- Definition Classes
- Context
-
def
enrichmentEnabled_=(value: Boolean): Unit
- Definition Classes
- Context
-
def
ensuring(cond: (Analyzer.ImportContext) ⇒ Boolean, msg: ⇒ Any): Analyzer.ImportContext
- Implicit
- This member is added by an implicit conversion from Analyzer.ImportContext to Ensuring[Analyzer.ImportContext] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (Analyzer.ImportContext) ⇒ Boolean): Analyzer.ImportContext
- Implicit
- This member is added by an implicit conversion from Analyzer.ImportContext to Ensuring[Analyzer.ImportContext] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): Analyzer.ImportContext
- Implicit
- This member is added by an implicit conversion from Analyzer.ImportContext to Ensuring[Analyzer.ImportContext] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): Analyzer.ImportContext
- Implicit
- This member is added by an implicit conversion from Analyzer.ImportContext to Ensuring[Analyzer.ImportContext] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
Tests whether the argument (
that
) is a reference to the receiver object (this
).Tests whether the argument (
that
) is a reference to the receiver object (this
).The
eq
method implements an equivalence relation on non-null instances ofAnyRef
, and has three additional properties:- It is consistent: for any non-null instances
x
andy
of typeAnyRef
, multiple invocations ofx.eq(y)
consistently returnstrue
or consistently returnsfalse
. - For any non-null instance
x
of typeAnyRef
,x.eq(null)
andnull.eq(x)
returnsfalse
. null.eq(null)
returnstrue
.
When overriding the
equals
orhashCode
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
).- returns
true
if the argument is a reference to the receiver object;false
otherwise.
- Definition Classes
- AnyRef
- It is consistent: for any non-null instances
-
def
equals(arg0: Any): Boolean
The equality method for reference types.
-
def
error(pos: Global.Position, msg: String): Unit
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.
- Definition Classes
- Context
-
def
extractUndetparams(): List[Global.Symbol]
Return and clear the undetermined type parameters
Return and clear the undetermined type parameters
- Definition Classes
- Context
-
def
featureWarning(pos: Global.Position, featureName: String, featureDesc: String, featureTrait: Global.Symbol, construct: ⇒ String = "", required: Boolean): Unit
- Definition Classes
- Context
-
def
finalize(): Unit
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 betweenfinalize
and non-local returns and exceptions, are all platform dependent.- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- Note
not specified by SLS as a member of AnyRef
-
final
def
firstImport: Some[Analyzer.ImportInfo]
Equivalent to
imports.headOption
, but more efficientEquivalent to
imports.headOption
, but more efficient- Definition Classes
- ImportContext → Context
-
def
fixPosition(pos: Global.Position): Global.Position
- Definition Classes
- Context
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from Analyzer.ImportContext to StringFormat[Analyzer.ImportContext] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
Returns the runtime class representation of the object.
Returns the runtime class representation of the object.
- returns
a class object corresponding to the runtime type of the receiver.
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
The hashCode method for reference types.
-
def
implicitsEnabled: Boolean
- Definition Classes
- Context
-
def
implicitsEnabled_=(value: Boolean): Unit
- Definition Classes
- Context
-
def
implicitss: List[List[Analyzer.ImplicitInfo]]
- Definition Classes
- Context
-
final
def
imports: collection.immutable.List[Analyzer.ImportInfo]
The currently visible imports
The currently visible imports
- Definition Classes
- ImportContext → Context
-
def
inConstructorSuffix: Boolean
- Definition Classes
- Context
-
def
inConstructorSuffix_=(value: Boolean): Unit
- Definition Classes
- Context
-
def
inPatAlternative: Boolean
- Definition Classes
- Context
-
def
inPatAlternative_=(value: Boolean): Unit
- Definition Classes
- Context
-
def
inReturnExpr: Boolean
- Definition Classes
- Context
-
def
inSecondTry: Boolean
- Definition Classes
- Context
-
def
inSecondTry_=(value: Boolean): Unit
- Definition Classes
- Context
-
def
inSelfSuperCall: Boolean
- Definition Classes
- Context
-
def
inSelfSuperCall_=(value: Boolean): Unit
- Definition Classes
- Context
-
final
def
inSilentMode(expr: ⇒ Boolean): Boolean
- Definition Classes
- Context
- Annotations
- @inline()
-
def
inSuperInit: Boolean
- Definition Classes
- Context
-
def
inSuperInit_=(value: Boolean): Unit
- Definition Classes
- Context
-
def
inTypeConstructorAllowed: Boolean
- Definition Classes
- Context
-
def
initRootContext(throwing: Boolean = false, checking: Boolean = false): Unit
Use reporter (possibly buffered) for errors/warnings and enable implicit conversion *
Use reporter (possibly buffered) for errors/warnings and enable implicit conversion *
- Definition Classes
- Context
-
def
isAccessible(sym: Global.Symbol, pre: Global.Type, superAccess: Boolean = false): Boolean
Is
sym
accessible as a member ofpre
in current context?Is
sym
accessible as a member ofpre
in current context?- Definition Classes
- Context
-
def
isInPackageObject(sym: Global.Symbol, pkg: Global.Symbol): Boolean
Must
sym
defined in package object of packagepkg
, if it selected from a prefix withpkg
as its type symbol?Must
sym
defined in package object of packagepkg
, if it selected from a prefix withpkg
as its type symbol?- Definition Classes
- Context
-
final
def
isInstanceOf[T0]: Boolean
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 returnfalse
, while the expressionList(1).isInstanceOf[List[String]]
will returntrue
. 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.- returns
true
if the receiver object is an instance of erasure of typeT0
;false
otherwise.
- Definition Classes
- Any
-
def
isNameInScope(name: Global.Name): Boolean
- Definition Classes
- Context
-
final
def
isRootImport: Boolean
- Definition Classes
- ImportContext → Context
-
def
lookup(name: Global.Name, expectedOwner: Global.Symbol): Global.Symbol
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
- Definition Classes
- Context
-
def
lookupSymbol(name: Global.Name, qualifies: (Global.Symbol) ⇒ Boolean): Global.NameLookup
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.
- Definition Classes
- Context
-
def
macrosEnabled: Boolean
- Definition Classes
- Context
-
def
macrosEnabled_=(value: Boolean): Unit
- Definition Classes
- Context
-
def
make(tree: Global.Tree, owner: Global.Symbol, scope: Global.Scope): Analyzer.Context
- Definition Classes
- Context
-
def
make(tree: Global.Tree = tree, owner: Global.Symbol = owner, scope: Global.Scope = scope, unit: Global.CompilationUnit = unit, reporter: Analyzer.ContextReporter = this.reporter): Analyzer.Context
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 anImport
, that import will be avaiable at the head ofContext#imports
.- Definition Classes
- Context
-
def
makeConstructorContext: Analyzer.Context
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.- Definition Classes
- Context
-
def
makeImplicit(reportAmbiguousErrors: Boolean): Analyzer.Context
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.
- Definition Classes
- Context
-
def
makeNewScope(tree: Global.Tree, owner: Global.Symbol, reporter: Analyzer.ContextReporter = this.reporter): Analyzer.Context
Make a child context that represents a new nested scope
Make a child context that represents a new nested scope
- Definition Classes
- Context
-
def
makeNonSilent(newtree: Global.Tree): Analyzer.Context
- Definition Classes
- Context
-
def
makeSilent(reportAmbiguousErrors: Boolean = ambiguousErrors, newtree: Global.Tree = tree): Analyzer.Context
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.
- Definition Classes
- Context
-
var
namedApplyBlockInfo: Option[(Global.Tree, Analyzer.NamedApplyInfo)]
- Definition Classes
- Context
-
final
def
ne(arg0: AnyRef): Boolean
Equivalent to
!(this eq that)
.Equivalent to
!(this eq that)
.- returns
true
if the argument is not a reference to the receiver object;false
otherwise.
- Definition Classes
- AnyRef
-
def
nextEnclosing(p: (Analyzer.Context) ⇒ Boolean): Analyzer.Context
- Definition Classes
- Context
-
final
def
notify(): Unit
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.
- Definition Classes
- AnyRef
- Note
not specified by SLS as a member of AnyRef
-
final
def
notifyAll(): Unit
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.
- Definition Classes
- AnyRef
- Note
not specified by SLS as a member of AnyRef
-
var
openImplicits: List[Analyzer.OpenImplicit]
Types for which implicit arguments are currently searched
Types for which implicit arguments are currently searched
- Definition Classes
- Context
-
final
def
outer: Analyzer.Context
- Definition Classes
- Context
-
def
outerDepth: Int
- Attributes
- protected
- Definition Classes
- Context
-
val
owner: Global.Symbol
The current owner
The current owner
- Definition Classes
- Context
-
var
prefix: Global.Type
- Definition Classes
- Context
-
def
pushTypeBounds(sym: Global.Symbol): Unit
- Definition Classes
- Context
-
def
reportErrors: Boolean
- Definition Classes
- Context
-
def
reporter: Analyzer.ContextReporter
- Definition Classes
- Context
-
def
resetCache(): Unit
- Definition Classes
- Context
-
def
restoreTypeBounds(tp: Global.Type): Global.Type
- Definition Classes
- Context
-
def
returnsSeen: Boolean
- Definition Classes
- Context
-
def
returnsSeen_=(value: Boolean): Unit
- Definition Classes
- Context
-
def
retyping: Boolean
- Definition Classes
- Context
-
def
retyping_=(value: Boolean): Unit
- Definition Classes
- Context
-
var
savedTypeBounds: List[(Global.Symbol, Global.Type)]
Saved type bounds for type parameters which are narrowed in a GADT.
Saved type bounds for type parameters which are narrowed in a GADT.
- Definition Classes
- Context
-
def
savingUndeterminedTypeParams[A](reportAmbiguous: Boolean = ambiguousErrors)(body: ⇒ A): A
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.- reportAmbiguous
Should ambiguous errors be reported during evaluation of
body
?
- Definition Classes
- Context
-
val
scope: Global.Scope
The current scope
The current scope
- Definition Classes
- Context
-
def
set(enable: ContextMode = NOmode, disable: ContextMode = NOmode): ImportContext.this.type
Set all modes in the mask
enable
to true, and all indisable
to false.Set all modes in the mask
enable
to true, and all indisable
to false.- Definition Classes
- Context
-
def
siteString: String
- Definition Classes
- Context
-
def
starPatterns: Boolean
- Definition Classes
- Context
-
def
starPatterns_=(value: Boolean): Unit
- Definition Classes
- Context
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
toString(): String
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.
- returns
a String representation of the object.
- Definition Classes
- ImportContext → Context → AnyRef → Any
-
val
tree: Global.Tree
Tree associated with this context
Tree associated with this context
- Definition Classes
- Context
-
def
undetparams: List[Global.Symbol]
Undetermined type parameters.
Undetermined type parameters. See
Infer#{inferExprInstance, adjustTypeArgs}
. Not inherited to child contexts- Definition Classes
- Context
-
def
undetparamsString: String
- Definition Classes
- Context
-
def
undetparams_=(ps: List[Global.Symbol]): Unit
- Definition Classes
- Context
-
val
unit: Global.CompilationUnit
- Definition Classes
- Context
-
def
update(mask: ContextMode, value: Boolean): Unit
Update all modes in
mask
tovalue
Update all modes in
mask
tovalue
- Definition Classes
- Context
-
var
variance: Variance
Variance relative to enclosing class
Variance relative to enclosing class
- Definition Classes
- Context
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
warning(pos: Global.Position, msg: String): Unit
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.
- Definition Classes
- Context
-
final
def
withImplicits[T](enabled: Boolean)(op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withImplicitsDisabled[T](op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withImplicitsDisabledAllowEnrichment[T](op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withImplicitsEnabled[T](op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withMacros[T](enabled: Boolean)(op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withMacrosDisabled[T](op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withMacrosEnabled[T](op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withMode[T](enabled: ContextMode = NOmode, disabled: ContextMode = NOmode)(op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withOnlyStickyModes[T](op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withinPatAlternative[T](op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withinReturnExpr[T](op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withinSecondTry[T](op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withinStarPatterns[T](op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withinSuperInit[T](op: ⇒ T): T
- Definition Classes
- Context
- Annotations
- @inline()
-
final
def
withinTypeConstructorAllowed[T](op: ⇒ T): T
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.
- Definition Classes
- Context
- Annotations
- @inline()
-
def
→[B](y: B): (Analyzer.ImportContext, B)
- Implicit
- This member is added by an implicit conversion from Analyzer.ImportContext to ArrowAssoc[Analyzer.ImportContext] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
The Scala compiler API.
The following resources are useful for Scala plugin/compiler development: