ImportInfo

class ImportInfo(symf: Context => Symbol, val selectors: List[ImportSelector], val qualifier: Tree, val isRootImport: Boolean) extends Showable

Info relating to an import clause

Value Params
isRootImport

true if this is one of the implicit imports of scala, java.lang, scala.Predef in the start context, false otherwise.

qualifier

The import qualifier, or EmptyTree for root imports. Defined for all explicit imports from ident or select nodes.

selectors

The selector clauses

symf

A function that computes the import symbol defined by the clause

Companion
object
trait Showable
class Object
trait Matchable
class Any

Value members

Concrete methods

The names that are excluded from any wildcard import

The names that are excluded from any wildcard import

def featureImported(feature: TermName)(using Context): Boolean

Does this import clause or a preceding import clause enable feature?

Does this import clause or a preceding import clause enable feature?

Value Params
feature

a possibly quailified name, e.g. strictEquality experimental.genericNumberLiterals An excluded feature such as strictEquality => _ in a language import means that preceding imports are not considered and the feature is not imported.

A mapping from original to renamed names

A mapping from original to renamed names

def givenBound(using Context): Type

The upper bound for given wildcards, or Nothing if there are none

The upper bound for given wildcards, or Nothing if there are none

def importSym(using Context): Symbol

The implicit references imported by this import clause

The implicit references imported by this import clause

Does the import clause have at least one given selector?

Does the import clause have at least one given selector?

Does the import clause contain wildcard selectors (both _ and given count)?

Does the import clause contain wildcard selectors (both _ and given count)?

Does this import clause enable or disable feature?

Does this import clause enable or disable feature?

Value Params
feature

See featureImported for a description

Returns

Some(true) if feature is imported Some(false) if feature is excluded None if feature is not mentioned, or this is not a language import

A mapping from renamed to original names

A mapping from renamed to original names

def site(using Context): Type

The (TermRef) type of the qualifier of the import clause

The (TermRef) type of the qualifier of the import clause

def toText(printer: Printer): Text

The root import symbol hidden by this symbol, or NoSymbol if no such symbol is hidden. Note: this computation needs to work even for un-initialized import infos, and is not allowed to force initialization.

The root import symbol hidden by this symbol, or NoSymbol if no such symbol is hidden. Note: this computation needs to work even for un-initialized import infos, and is not allowed to force initialization.

TODO: Once we have fully bootstrapped, I would prefer if we expressed unimport with an override modifier, and generalized it to all imports. I believe this would be more transparent than the current set of conditions. E.g.

override import Predef.{any2stringAdd => _, StringAdd => _, _} // disables String +
override import java.lang.{}                                   // disables all imports

The upper bound for _ wildcards, or Nothing if there are none

The upper bound for _ wildcards, or Nothing if there are none

Inherited methods

def fallbackToText(printer: Printer): Text

A fallback text representation, if the pattern matching in Printers does not have a case for this showable element

A fallback text representation, if the pattern matching in Printers does not have a case for this showable element

Inherited from
Showable
def show(using Context): String

The string representation of this showable element.

The string representation of this showable element.

Inherited from
Showable
def showIndented(margin: Int)(using Context): String

The string representation with each line after the first one indented by the given given margin (in spaces).

The string representation with each line after the first one indented by the given given margin (in spaces).

Inherited from
Showable
def showSummary(depth: Int)(using Context): String

The summarized string representation of this showable element. Recursion depth is limited to some smallish value. Default is Config.summarizeDepth.

The summarized string representation of this showable element. Recursion depth is limited to some smallish value. Default is Config.summarizeDepth.

Inherited from
Showable