FreshContext

dotty.tools.dotc.core.Contexts$.FreshContext
class FreshContext(base: ContextBase) extends Context

A fresh context allows selective modification of its attributes using the with... methods.

Attributes

Graph
Supertypes
class Context
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def addLocation[T](initial: T): Location[T]
def addLocation[T](): Location[T]
final def addMode(mode: Mode): FreshContext
Extension method from Contexts
def dropProperty(key: Key[_]): FreshContext.this.type
final def retractMode(mode: Mode): FreshContext
Extension method from Contexts
def setCompilationUnit(compilationUnit: CompilationUnit): FreshContext.this.type
def setCompilerCallback(callback: CompilerCallback): FreshContext.this.type
def setDebug: FreshContext.this.type
def setGadt(gadt: GadtConstraint): FreshContext.this.type
def setImplicits(implicits: ContextualImplicits): FreshContext.this.type
def setImportInfo(importInfo: ImportInfo): FreshContext.this.type
def setMode(mode: Mode): FreshContext.this.type
def setNewScope: FreshContext.this.type
def setNotNullInfos(notNullInfos: List[NotNullInfo]): FreshContext.this.type
def setOwner(owner: Symbol): FreshContext.this.type
def setPeriod(period: Period): FreshContext.this.type
def setPhase(pid: PhaseId): FreshContext.this.type
def setPhase(phase: Phase): FreshContext.this.type
def setPrinterFn(printer: Context => Printer): FreshContext.this.type
def setProfiler(profiler: Profiler): FreshContext.this.type
def setProperty[T](key: Key[T], value: T): FreshContext.this.type
def setReporter(reporter: Reporter): FreshContext.this.type
def setRun(run: Run | Null): FreshContext.this.type
def setSbtCallback(callback: AnalysisCallback): FreshContext.this.type
def setScope(scope: Scope): FreshContext.this.type
def setSearchHistory(searchHistory: SearchHistory): FreshContext.this.type
def setSetting[T](setting: Setting[T], value: T): FreshContext.this.type
def setSettings(settingsState: SettingsState): FreshContext.this.type
def setSource(source: SourceFile): FreshContext.this.type
def setTree(tree: Tree[_ >: Untyped]): FreshContext.this.type
def setTypeAssigner(typeAssigner: TypeAssigner): FreshContext.this.type
def setTyper(typer: Typer): FreshContext.this.type
def setTyperState(typerState: TyperState): FreshContext.this.type
def updateStore[T](loc: Location[T], value: T): FreshContext.this.type

Inherited methods

The current compilation unit

The current compilation unit

Attributes

Inherited from:
Context
def compilerCallback: CompilerCallback

The compiler callback implementation, or null if no callback will be called.

The compiler callback implementation, or null if no callback will be called.

Attributes

Inherited from:
Context

Is the debug option set?

Is the debug option set?

Attributes

Inherited from:
Context

Attributes

Inherited from:
Context

Either the current scope, or, if the current context owner is a class, the declarations of the current class.

Either the current scope, or, if the current context owner is a class, the declarations of the current class.

Attributes

Inherited from:
Context
final def erasedTypes: Boolean

Does current phase use an erased types interpretation?

Does current phase use an erased types interpretation?

Attributes

Inherited from:
Context

Is the explicit nulls option set?

Is the explicit nulls option set?

Attributes

Inherited from:
Context
def exprContext(stat: Tree[_ >: Untyped], exprOwner: Symbol): Context

The context of expression expr seen as a member of a statement sequence

The context of expression expr seen as a member of a statement sequence

Attributes

Inherited from:
Context

A fresh clone of this context embedded in this context.

A fresh clone of this context embedded in this context.

Attributes

Inherited from:
Context

A fresh clone of this context embedded in the specified outer context.

A fresh clone of this context embedded in the specified outer context.

Attributes

Inherited from:
Context
final def gadt: GadtConstraint

Attributes

Inherited from:
Context
protected def gadt_=(gadt: GadtConstraint): Unit

Attributes

Inherited from:
Context

AbstractFile with given path, memoized

AbstractFile with given path, memoized

Attributes

Inherited from:
Context

AbstraFile with given path name, memoized

AbstraFile with given path name, memoized

Attributes

Inherited from:
Context

SourceFile with given path, memoized

SourceFile with given path, memoized

Attributes

Inherited from:
Context

SourceFile with given path name, memoized

SourceFile with given path name, memoized

Attributes

Inherited from:
Context
def getSource(file: AbstractFile, codec: => Codec): SourceFile

Sourcefile corresponding to given abstract file, memoized

Sourcefile corresponding to given abstract file, memoized

Attributes

Inherited from:
Context

Attributes

Inherited from:
Context

A new context that summarizes an import statement

A new context that summarizes an import statement

Attributes

Inherited from:
Context

The currently active import info

The currently active import info

Attributes

Inherited from:
Context
def initialize()(using Context): Unit

Attributes

Inherited from:
Context

Is current phase after TyperPhase?

Is current phase after TyperPhase?

Attributes

Inherited from:
Context

Is this a context for the members of a class definition?

Is this a context for the members of a class definition?

Attributes

Inherited from:
Context

Is this a context that introduces an import clause?

Is this a context that introduces an import clause?

Attributes

Inherited from:
Context

Is this a context for typechecking an inlined body?

Is this a context for typechecking an inlined body?

Attributes

Inherited from:
Context
final def isJava: Boolean

Are we in a Java compilation unit?

Are we in a Java compilation unit?

Attributes

Inherited from:
Context

Is this a context that introduces a non-empty scope?

Is this a context that introduces a non-empty scope?

Attributes

Inherited from:
Context
final def isTyper: Boolean

Attributes

Inherited from:
Context
final def lastPhaseId: Int

Attributes

Inherited from:
Context
final def mode: Mode

Attributes

Inherited from:
Context
protected def mode_=(mode: Mode): Unit

Attributes

Inherited from:
Context
final def moreProperties: Map[Key[Any], Any]

Attributes

Inherited from:
Context
protected def moreProperties_=(moreProperties: Map[Key[Any], Any]): Unit

Attributes

Inherited from:
Context

Attributes

Inherited from:
Context

The paths currently known to be not null

The paths currently known to be not null

Attributes

Inherited from:
Context
final def outer: Context

Attributes

Inherited from:
Context
protected def outer_=(outer: Context): Unit

Attributes

Inherited from:
Context

All outer contexts, ending in base.initialCtx and then NoContext

All outer contexts, ending in base.initialCtx and then NoContext

Attributes

Inherited from:
Context
final def owner: Symbol

Attributes

Inherited from:
Context
protected def owner_=(owner: Symbol): Unit

Attributes

Inherited from:
Context
def pendingUnderlying: HashSet[Type]

Attributes

Inherited from:
Context
final def period: Period

Attributes

Inherited from:
Context
protected def period_=(period: Period): Unit

Attributes

Inherited from:
Context
final def phase: Phase

Attributes

Inherited from:
Context
final def phaseId: PhaseId

Attributes

Inherited from:
Context

Attributes

Inherited from:
Context

A function creating a printer

A function creating a printer

Attributes

Inherited from:
Context

The current plain printer

The current plain printer

Attributes

Inherited from:
Context

The current compiler-run profiler

The current compiler-run profiler

Attributes

Inherited from:
Context
def property[T](key: Key[T]): Option[T]

Attributes

Inherited from:
Context

The current reporter

The current reporter

Attributes

Inherited from:
Context
def reuseIn(outer: Context): Context.this.type

Attributes

Inherited from:
Context
def run: Run | Null

The current compiler-run

The current compiler-run

Attributes

Inherited from:
Context
final def runId: RunId

Attributes

Inherited from:
Context
def sbtCallback: AnalysisCallback

The sbt callback implementation if we are run from sbt, null otherwise

The sbt callback implementation if we are run from sbt, null otherwise

Attributes

Inherited from:
Context
final def scope: Scope

Attributes

Inherited from:
Context
protected def scope_=(scope: Scope): Unit

Attributes

Inherited from:
Context

Attributes

Inherited from:
Context
protected def searchHistory_=(searchHistory: SearchHistory): Unit

Attributes

Inherited from:
Context

Attributes

Inherited from:
Context

The current settings values

The current settings values

Attributes

Inherited from:
Context
final def source: SourceFile

Attributes

Inherited from:
Context
protected def source_=(source: SourceFile): Unit

Attributes

Inherited from:
Context
final def store: Store

Attributes

Inherited from:
Context
protected def store_=(store: Store): Unit

Attributes

Inherited from:
Context

The context for a supercall. This context is used for elaborating the parents of a class and their arguments. The context is computed from the current class context. It has

The context for a supercall. This context is used for elaborating the parents of a class and their arguments. The context is computed from the current class context. It has

  • as owner: The primary constructor of the class
  • as outer context: The context enclosing the class context
  • as scope: The parameter accessors in the class context

The reasons for this peculiar choice of attributes are as follows:

  • The constructor must be the owner, because that's where any local methods or closures should go.
  • The context may not see any class members (inherited or defined), and should instead see definitions defined in the outer context which might be shadowed by such class members. That's why the outer context must be the outer context of the class.
  • At the same time the context should see the parameter accessors of the current class, that's why they get added to the local scope. An alternative would have been to have the context see the constructor parameters instead, but then we'd need a final substitution step from constructor parameters to class parameter accessors.

Attributes

Inherited from:
Context

The context for the arguments of a this(...) constructor call. The context is computed from the local auxiliary constructor context. It has

The context for the arguments of a this(...) constructor call. The context is computed from the local auxiliary constructor context. It has

  • as owner: The auxiliary constructor
  • as outer context: The context enclosing the enclosing class context
  • as scope: The parameters of the auxiliary constructor.

Attributes

Inherited from:
Context
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
Context -> Any
Inherited from:
Context
final def tree: Tree[_ >: Untyped]

Attributes

Inherited from:
Context
protected def tree_=(tree: Tree[_ >: Untyped]): Unit

Attributes

Inherited from:
Context

The current type assigner or typer

The current type assigner or typer

Attributes

Inherited from:
Context

Attributes

Inherited from:
Context

Attributes

Inherited from:
Context
protected def typerState_=(typerState: TyperState): Unit

Attributes

Inherited from:
Context

Attributes

Inherited from:
Context

Attributes

Inherited from:
Context

Should use colors when printing?

Should use colors when printing?

Attributes

Inherited from:
Context

Is the verbose option set?

Is the verbose option set?

Attributes

Inherited from:
Context
final def withOwner(owner: Symbol): Context

Attributes

Inherited from:
Context
final def withPhase(pid: PhaseId): Context

Attributes

Inherited from:
Context
final def withPhase(phase: Phase): Context

Attributes

Inherited from:
Context
final def withProperty[T](key: Key[T], value: Option[T]): Context

Attributes

Inherited from:
Context
final def withSource(source: SourceFile): Context

Attributes

Inherited from:
Context
final def withTyperState(typerState: TyperState): Context

Attributes

Inherited from:
Context

Attributes

Inherited from:
Context

Inherited fields

protected var implicitsCache: ContextualImplicits | Null

The new implicit references that are introduced by this scope

The new implicit references that are introduced by this scope

Attributes

Inherited from:
Context

Givens

Inherited givens

Attributes

Inherited from:
Context