ImportInfo

dotty.tools.dotc.typer.ImportInfo
See theImportInfo companion object
class ImportInfo(symf: Context ?=> Symbol, val selectors: List[ImportSelector], val qualifier: Tree, val isRootImport: Boolean) extends Showable

Info relating to an import clause

Attributes

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
Graph
Supertypes
trait Showable
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

The names that are excluded from any wildcard import

The names that are excluded from any wildcard import

Attributes

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?

Attributes

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

Attributes

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

Attributes

The implicit references imported by this import clause

The implicit references imported by this import clause

Attributes

Does the import clause have at least one given selector?

Does the import clause have at least one given selector?

Attributes

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

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

Attributes

Does this import clause enable or disable feature?

Does this import clause enable or disable feature?

Attributes

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

Attributes

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

Attributes

def toText(printer: Printer): Text

The text representation of this showable element. This normally dispatches to a pattern matching method in Printers.

The text representation of this showable element. This normally dispatches to a pattern matching method in Printers.

Attributes

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

Attributes

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

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

Attributes

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

Attributes

Inherited from:
Showable
def show(using Context): String

The string representation of this showable element.

The string representation of this showable element.

Attributes

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).

Attributes

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.

Attributes

Inherited from:
Showable