abstract class Denotation
extends DotClass with Showable

A denotation is the result of resolving a name (either simple identifier or select) during a given period.

Denotations can be combined with & and |. & is conjunction, | is disjunction.

& will create an overloaded denotation from two non-overloaded denotations if their signatures differ. Analogously | of two denotations with different signatures will give an empty denotation NoDenotation.

A denotation might refer to NoSymbol. This is the case if the denotation was produced from a disjunction of two denotations with different symbols and there was no common symbol in a superclass that could substitute for both symbols. Here is an example:

Say, we have:

class A { def f: A } class B { def f: B } val x: A | B = if (test) new A else new B val y = x.f

Then the denotation of y is SingleDenotation(NoSymbol, A | B).

Constructors

Denotation ( symbol: Symbol )

Members

[+] val symbol : Symbol
[+] def & ( that: Denotation , pre: Type , safeIntersection: Boolean ) ( implicit ctx: Context ) : Denotation

Form a denotation by conjoining with denotation that.

NoDenotations are dropped. MultiDenotations are handled by merging parts with same signatures. Sin...

    Form a denotation by conjoining with denotation that.

    NoDenotations are dropped. MultiDenotations are handled by merging parts with same signatures. SingleDenotations with equal signatures are joined as follows:

    In a first step, consider only those denotations which have symbols that are accessible from prefix pre.

    If there are several such denotations, try to pick one by applying the following three precedence rules in decreasing order of priority:

    1. Prefer denotations with more specific infos.
    2. If infos are equally specific, prefer denotations with concrete symbols over denotations with abstract symbols.
    3. If infos are equally specific and symbols are equally concrete, prefer denotations with symbols defined in subclasses over denotations with symbols defined in proper superclasses.

    If there is exactly one (preferred) accessible denotation, return it.

    If there is no preferred accessible denotation, return a JointRefDenotation with one of the operand symbols (unspecified which one), and an info which is the intersection (using & or safe_& if safeIntersection is true) of the infos of the operand denotations.

    If SingleDenotations with different signatures are joined, return NoDenotation.

    [+] def &$default$3 : Boolean

    Form a denotation by conjoining with denotation that.

    NoDenotations are dropped. MultiDenotations are handled by merging parts with same signatures. Sin...

      Form a denotation by conjoining with denotation that.

      NoDenotations are dropped. MultiDenotations are handled by merging parts with same signatures. SingleDenotations with equal signatures are joined as follows:

      In a first step, consider only those denotations which have symbols that are accessible from prefix pre.

      If there are several such denotations, try to pick one by applying the following three precedence rules in decreasing order of priority:

      1. Prefer denotations with more specific infos.
      2. If infos are equally specific, prefer denotations with concrete symbols over denotations with abstract symbols.
      3. If infos are equally specific and symbols are equally concrete, prefer denotations with symbols defined in subclasses over denotations with symbols defined in proper superclasses.

      If there is exactly one (preferred) accessible denotation, return it.

      If there is no preferred accessible denotation, return a JointRefDenotation with one of the operand symbols (unspecified which one), and an info which is the intersection (using & or safe_& if safeIntersection is true) of the infos of the operand denotations.

      If SingleDenotations with different signatures are joined, return NoDenotation.

      [+] 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 exist...

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

      [+] def accessibleFrom$default$2 : Boolean

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

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

      [+] final def alternatives : List [ SingleDenotation ]

      The set of alternative single-denotations making up this denotation

      The set of alternative single-denotations making up this denotation

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

      The alternatives of this denotation that satisfy the predicate p.

      The alternatives of this denotation that satisfy the predicate p.

      [+] final def asSingleDenotation : SingleDenotation
      [+] final def asSymDenotation : SymDenotation
      [+] def atSignature ( sig: Signature , site: Type , relaxed: Boolean ) ( implicit ctx: Context ) : Denotation

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

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

      [+] def atSignature$default$2 : NoPrefix$

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

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

      [+] def atSignature$default$3 : Boolean

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

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

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

      If this is a SingleDenotation, return it, otherwise throw a TypeError

      If this is a SingleDenotation, return it, otherwise throw a TypeError

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

      The variant of this denotation that's current in the given context. If no such denotation exists, returns the denotation with each alternative at its fi...

      The variant of this denotation that's current in the given context. If no such denotation exists, returns the denotation with each alternative at its first point of definition.

      [+] def disambiguate ( p: Symbol => Boolean ) ( implicit ctx: Context ) : SingleDenotation

      If this denotation is overloaded, filter with given predicate. If result is still overloaded throw a TypeError. Note: disambiguate is slightly different...

      If this denotation is overloaded, filter with given predicate. If result is still overloaded throw a TypeError. Note: disambiguate is slightly different from suchThat in that single-denotations that do not satisfy the predicate are left alone (whereas suchThat would map them to NoDenotation).

      [+] def exists : Boolean

      Is this denotation different from NoDenotation or an ErrorDenotation?

      Is this denotation different from NoDenotation or an ErrorDenotation?

      [+] def findMember ( name: Name , pre: Type , excluded: FlagSet ) ( implicit ctx: Context ) : Denotation

      Find member of this denotation with given name and produce a denotation that contains the type of the member as seen from given prefix pre. Exclude all...

      Find member of this denotation with given name and produce a denotation that contains the type of the member as seen from given prefix pre. Exclude all members that have flags in excluded from consideration.

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

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

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

      [+] def info ( implicit ctx: Context ) : Type

      The type info of the denotation, exists only for non-overloaded denotations

      The type info of the denotation, exists only for non-overloaded denotations

      [+] def infoOrCompleter : Type

      The type info, or, if this is a SymDenotation where the symbol is not yet completed, the completer

      The type info, or, if this is a SymDenotation where the symbol is not yet completed, the completer

      [+] final def isOverloaded : Boolean

      Is this denotation overloaded?

      Is this denotation overloaded?

      [+] def isTerm : Boolean

      Is this a reference to a term symbol?

      Is this a reference to a term symbol?

      [+] def isType : Boolean

      Is this a reference to a type symbol?

      Is this a reference to a type symbol?

      [+] def mapInfo ( f: Type => Type ) ( implicit ctx: Context ) : Denotation

      A denotation with the info of this denotation transformed using f

      A denotation with the info of this denotation transformed using f

      [+] def matchingDenotation ( site: Type , targetType: Type ) ( implicit ctx: Context ) : SingleDenotation

      The alternative of this denotation that has a type matching targetType when seen as a member of type site, NoDenotation if none exists.

      The alternative of this denotation that has a type matching targetType when seen as a member of type site, NoDenotation if none exists.

      [+] private def mergeConflict ( tp1: Type , tp2: Type ) ( implicit ctx: Context ) : Type

      Handle merge conflict by throwing a MergeError exception

      Handle merge conflict by throwing a MergeError exception

      [+] def mergeNames ( names1: List [ N ] , names2: List [ N ] , syntheticName: Int => N ) : List [ N ]

      Merge two lists of names. If names in corresponding positions match, keep them, otherwise generate new synthetic names.

      Merge two lists of names. If names in corresponding positions match, keep them, otherwise generate new synthetic names.

      [+] final def orElse ( that: => Denotation ) : Denotation

      If this denotation does not exist, fallback to alternative

      If this denotation does not exist, fallback to alternative

      [+] def requiredClass ( name: PreName ) ( implicit ctx: Context ) : ClassSymbol
      [+] def requiredMethod ( name: PreName ) ( implicit ctx: Context ) : TermSymbol
      [+] def requiredMethod ( name: PreName , argTypes: List [ Type ] ) ( implicit ctx: Context ) : TermSymbol
      [+] def requiredMethodRef ( name: PreName ) ( implicit ctx: Context ) : TermRef
      [+] def requiredMethodRef ( name: PreName , argTypes: List [ Type ] ) ( implicit ctx: Context ) : TermRef
      [+] def requiredSymbol ( p: Symbol => Boolean , source: AbstractFile , generateStubs: Boolean ) ( implicit ctx: Context ) : Symbol

      Return symbol in this denotation that satisfies the given predicate. if generateStubs is specified, return a stubsymbol if denotation is a missing ref.

      Return symbol in this denotation that satisfies the given predicate. if generateStubs is specified, return a stubsymbol if denotation is a missing ref. Throw a TypeError if predicate fails to disambiguate symbol or no alternative matches.

      [+] def requiredSymbol$default$2 : Null

      Return symbol in this denotation that satisfies the given predicate. if generateStubs is specified, return a stubsymbol if denotation is a missing ref.

      Return symbol in this denotation that satisfies the given predicate. if generateStubs is specified, return a stubsymbol if denotation is a missing ref. Throw a TypeError if predicate fails to disambiguate symbol or no alternative matches.

      [+] def requiredSymbol$default$3 : Boolean

      Return symbol in this denotation that satisfies the given predicate. if generateStubs is specified, return a stubsymbol if denotation is a missing ref.

      Return symbol in this denotation that satisfies the given predicate. if generateStubs is specified, return a stubsymbol if denotation is a missing ref. Throw a TypeError if predicate fails to disambiguate symbol or no alternative matches.

      [+] def requiredValue ( name: PreName ) ( implicit ctx: Context ) : TermSymbol
      [+] def requiredValueRef ( name: PreName ) ( implicit ctx: Context ) : TermRef
      [+] def signature ( implicit ctx: Context ) : Signature

      The signature of the denotation.

      The signature of the denotation.

      [+] 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.

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

      [+] 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.

      [+] def validFor : Period

      The period during which this denotation is valid.

      The period during which this denotation is valid.

      [+] def | ( that: Denotation , pre: Type ) ( implicit ctx: Context ) : Denotation

      Form a choice between this denotation and that one.

      Form a choice between this denotation and that one.