Dotty Documentation

0.15.0-bin-SNAPSHOT

abstract class Denotation
extends PreDenotation 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 , myInfo: Type )

[-] Members

[+] type AsSeenFromResult = Nothing <: Denotation
[+] protected var myInfo : Type
[+] 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. 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. 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 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 exists.

[+] final def alternatives : List [ SingleDenotation ]

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.

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

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

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.

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

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

[+] final def containsSym ( sym: Symbol ) : Boolean

Group contains a denotation that refers to given symbol

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

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

Find member of this denotation with given name, all required flags and no excluded flag, and produce a denotation that contains the type of the member as seen from given prefix pre.

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

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

[+] def hasUniqueSym : Boolean

Denotation points to unique symbol; false for overloaded denotations and JointRef denotations.

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

The type info. The info is an instance of TypeType iff this is a type denotation Uncompleted denotations set myInfo to a LazyType.

[+] def infoOrCompleter : Type

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?

[+] def isTerm : Boolean

Is this a reference to a term symbol?

[+] def isType : Boolean

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

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

[+] protected def myInfo_= ( x$1: Type ) : Unit
[+] def name ( implicit ctx: Context ) : Name

The name of the denotation

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

If this denotation does not exist, fallback to alternative

[+] def requiredClass ( pname: PreName ) ( implicit ctx: Context ) : ClassSymbol
[+] def requiredMethod ( pname: PreName ) ( implicit ctx: Context ) : TermSymbol
[+] def requiredMethod ( pname: 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 ( kind: String , name: Name , site: Denotation , args: List [ Type ] , source: AbstractFile , generateStubs: Boolean ) ( p: Symbol => 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. Throw a TypeError if predicate fails to disambiguate symbol or no alternative matches.

[+] def requiredSymbol$default$3 : NoDenotation.type

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$4 : Nil.type

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$5 : Null

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$6 : Boolean

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 requiredType ( pname: PreName ) ( implicit ctx: Context ) : TypeSymbol
[+] def requiredValue ( pname: PreName ) ( implicit ctx: Context ) : TermSymbol
[+] def requiredValueRef ( name: PreName ) ( implicit ctx: Context ) : TermRef
[+] def signature ( implicit ctx: Context ) : Signature

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.

[+] final def toDenot ( pre: Type ) ( implicit ctx: Context ) : Denotation

Convert to full denotation by &-ing all elements

[+] def toText ( printer: Printer ) : Text

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.

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

Form a choice between this denotation and that one.