Dotty Documentation

0.15.0-bin-SNAPSHOT

abstract class SingleDenotation
extends Denotation

A non-overloaded denotation

[-] Constructors

SingleDenotation ( symbol: Symbol , initInfo: Type )

[-] Members

[+] type AsSeenFromResult = SingleDenotation
[+] private val initInfo : Type
[+] private var myValidFor : Period
[+] protected var nextInRun : SingleDenotation

The next SingleDenotation in this run, with wrap-around from last to first.

There may be several SingleDenotations with different validity representing the same underlying definition at different phases. These are called a "flock". Flock members are generated by

[+] private val symbol : Symbol
[+] def accessibleFrom ( pre: Type , superAccess: Boolean ) ( implicit ctx: Context ) : Denotation

The denotation made up from the alternatives of this denotation that are accessible from prefix pre, or NoDenotation if no accessible alternative exists.

[+] def altsWith ( p: Symbol => Boolean ) : List [ SingleDenotation ]

The alternatives of this denotation that satisfy the predicate p.

[+] def atSignature ( sig: Signature , site: Type , relaxed: Boolean ) ( implicit ctx: Context ) : SingleDenotation

Resolve overloaded denotation to pick the ones with the given signature when seen from prefix site.

[+] private def bringForward ( ) ( implicit ctx: Context ) : SingleDenotation

Move validity period of this denotation to a new run. Throw a StaleSymbol error if denotation is no longer valid. However, StaleSymbol error is not thrown in the following situations:

  • If ctx.acceptStale returns true (e.g. because we are in the IDE), update the symbol to the new version if it exists, or return the old version otherwise.
  • If the symbol did not have a denotation that was defined at the current phase return a NoDenotation instead.
[+] private def compatibleWith ( required: FlagConjunction , excluded: FlagSet ) ( implicit ctx: Context ) : Boolean

Does this denotation have all the required flags but none of the excluded flags?

[+] protected def computeAsSeenFrom ( pre: Type ) ( implicit ctx: Context ) : SingleDenotation
[+] def coveredInterval ( implicit ctx: Context ) : Period

The period (interval of phases) for which there exists a valid denotation in this flock.

[+] def current ( implicit ctx: Context ) : SingleDenotation

Produce a denotation that is valid for the given context. Usually called when !(validFor contains ctx.period) (even though this is not a precondition). If the runId of the context is the same as runId of this denotation, the right flock member is located, or, if it does not exist yet, created by invoking a transformer (@See Transformers). If the runId's differ, but this denotation is a SymDenotation and its toplevel owner class or module is still a member of its enclosing package, then the whole flock is brought forward to be valid in the new runId. Otherwise the symbol is stale, which constitutes an internal error.

[+] def definedPeriodsString : String
[+] private def demandOutsideDefinedMsg ( implicit ctx: Context ) : String
[+] def derivedSingleDenotation ( symbol: Symbol , info: Type ) ( implicit ctx: Context ) : SingleDenotation
[+] final def filterDisjoint ( denots: PreDenotation ) ( implicit ctx: Context ) : SingleDenotation

Keep only those denotations in this group which have a signature that's not already defined by denots.

[+] def filterWithFlags ( required: FlagConjunction , excluded: FlagSet ) ( implicit ctx: Context ) : SingleDenotation

Keep only those denotations in this group that have all of the flags in required, but none of the flags in excluded.

[+] final def filterWithPredicate ( p: SingleDenotation => Boolean ) : SingleDenotation

Keep only those denotations in this group which satisfy predicate p.

[+] final def first : SingleDenotation

First/last denotation in the group

[+] def hasAltWith ( p: SingleDenotation => Boolean ) : Boolean

Does this denotation have an alternative that satisfies the predicate p?

[+] def history : List [ SingleDenotation ]
[+] def initial : SingleDenotation

The version of this SingleDenotation that was valid in the first phase of this run.

[+] private def insertAfter ( prev: SingleDenotation ) : Unit

Insert this denotation so that it follows prev.

[+] protected def installAfter ( phase: DenotTransformer ) ( implicit ctx: Context ) : Unit

Install this denotation to be the result of the given denotation transformer. This is the implementation of the same-named method in SymDenotations. It's placed here because it needs access to private fields of SingleDenotation.

[+] def invalidateInheritedInfo ( ) : Unit

Invalidate all caches and fields that depend on base classes and their contents

[+] final def last : SingleDenotation
[+] def mapInfo ( f: Type => Type ) ( implicit ctx: Context ) : SingleDenotation

A denotation with the info of this denotation transformed using f

[+] def mapInherited ( ownDenots: PreDenotation , prevDenots: PreDenotation , pre: Type ) ( implicit ctx: Context ) : SingleDenotation

Keep only those inherited members M of this predenotation for which the following is true - M is not marked Private - If M has a unique symbol, it does not appear in prevDenots. - M's signature as seen from prefix pre does not appear in ownDenots Return the denotation as seen from pre. Called from SymDenotations.computeMember. There, ownDenots are the denotations found in the base class, which shadow any inherited denotations with the same signature. prevDenots are the denotations that are defined in the class or inherited from a base type which comes earlier in the linearization.

[+] final def matches ( other: SingleDenotation ) ( implicit ctx: Context ) : Boolean

Group contains a denotation with the same signature as other

[+] final def name ( implicit ctx: Context ) : Name

The name of the denotation

[+] protected def newLikeThis ( symbol: Symbol , info: Type ) : SingleDenotation
[+] private def nextDefined : SingleDenotation

The next defined denotation (following nextInRun) or an arbitrary undefined denotation, if all denotations in a nextinRun cycle are undefined.

[+] protected def nextInRun_= ( x$1: SingleDenotation ) : Unit

The next SingleDenotation in this run, with wrap-around from last to first.

There may be several SingleDenotations with different validity representing the same underlying definition at different phases. These are called a "flock". Flock members are generated by

[+] def orElse ( that: => SingleDenotation ) : SingleDenotation
[+] def replaceWith ( newd: SingleDenotation ) : Unit

Insert this denotation instead of old. Also ensure that old refers with nextInRun to this denotation and set its validFor field to NoWhere. This is necessary so that references to the old denotation can be brought forward via current to a valid denotation.

The code to achieve this is subtle in that it works correctly whether the replaced denotation is the only one in its cycle or not.

[+] def showDcl ( implicit ctx: Context ) : String

Show declaration string; useful for showing declarations as seen from subclasses.

[+] final def signature ( implicit ctx: Context ) : Signature

The signature of the denotation.

[+] def skipRemoved ( implicit ctx: Context ) : SingleDenotation

Skip any denotations that have been removed by an installAfter or that are otherwise undefined.

[+] def staleSymbolError ( implicit ctx: Context ) : Nothing
[+] def staleSymbolMsg ( implicit ctx: Context ) : String
[+] def suchThat ( p: Symbol => Boolean ) ( implicit ctx: Context ) : SingleDenotation

The unique alternative of this denotation that satisfies the predicate p, or NoDenotation if no satisfying alternative exists.

[+] override def toString : String
[+] protected def transformAfter ( phase: DenotTransformer , f: SymDenotation => SymDenotation ) ( implicit ctx: Context ) : Unit

Apply a transformation f to all denotations in this group that start at or after given phase. Denotations are replaced while keeping the same validity periods.

[+] private def updateValidity ( ) ( implicit ctx: Context ) : SingleDenotation
[+] def validFor : Period

The period during which this denotation is valid.

[+] def validFor_= ( p: Period ) : Unit