dotty.tools.dotc.core.Denotations

Denotation

Related Doc: package Denotations

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

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Denotation
  2. Showable
  3. DotClass
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Denotation(symbol: Symbol)

    symbol

    The referencing symbol, or NoSymbol is none exists

Abstract Value Members

  1. abstract def accessibleFrom(pre: Type, superAccess: Boolean = false)(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.

  2. abstract def altsWith(p: (Symbol) ⇒ Boolean): List[SingleDenotation]

    The alternatives of this denotation that satisfy the predicate p.

  3. abstract def atSignature(sig: Signature, site: Type = NoPrefix, relaxed: Boolean = false)(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.

    relaxed

    When true, consider only parameter signatures for a match.

  4. abstract def current(implicit ctx: Context): Denotation

    The variant of this denotation that's current in the given context.

    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.

  5. abstract def hasAltWith(p: (SingleDenotation) ⇒ Boolean): Boolean

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

  6. abstract def info(implicit ctx: Context): Type

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

  7. abstract def infoOrCompleter: Type

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

  8. abstract def isType: Boolean

    Is this a reference to a type symbol?

  9. abstract def mapInfo(f: (Type) ⇒ Type)(implicit ctx: Context): Denotation

    A denotation with the info of this denotation transformed using f

  10. abstract def signature(implicit ctx: Context): Signature

    The signature of the denotation.

  11. abstract 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.

    Exceptions thrown

    TypeError if there is at more than one alternative that satisfies p.

  12. abstract def validFor: Period

    The period during which this denotation is valid.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. def &(that: Denotation, pre: Type, safeIntersection: Boolean = false)(implicit ctx: Context): Denotation

    Form a denotation by conjoining with denotation that.

    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.

  4. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  5. final def alternatives: List[SingleDenotation]

    The set of alternative single-denotations making up this denotation

  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. final def asSingleDenotation: SingleDenotation

  8. final def asSymDenotation: SymDenotation

  9. def checkUnique(implicit ctx: Context): SingleDenotation

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

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def disambiguate(p: (Symbol) ⇒ Boolean)(implicit ctx: Context): SingleDenotation

    If this denotation is overloaded, filter with given predicate.

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

  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def exists: Boolean

    Is this denotation different from NoDenotation or an ErrorDenotation?

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

    Definition Classes
    Showable
  16. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. 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.

    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.

  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. final def isOverloaded: Boolean

    Is this denotation overloaded?

  22. def isTerm: Boolean

    Is this a reference to a term symbol?

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

  24. def mergeNames[N <: Name](names1: List[N], names2: List[N], syntheticName: (Int) ⇒ N): List[N]

    Merge two lists of names.

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

  25. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  28. final def orElse(that: ⇒ Denotation): Denotation

    If this denotation does not exist, fallback to alternative

  29. def requiredClass(name: PreName)(implicit ctx: Context): ClassSymbol

  30. def requiredMethod(name: PreName, argTypes: List[Type])(implicit ctx: Context): TermSymbol

  31. def requiredMethod(name: PreName)(implicit ctx: Context): TermSymbol

  32. def requiredMethodRef(name: PreName, argTypes: List[Type])(implicit ctx: Context): TermRef

  33. def requiredMethodRef(name: PreName)(implicit ctx: Context): TermRef

  34. def requiredSymbol(p: (Symbol) ⇒ Boolean, source: AbstractFile = null, generateStubs: Boolean = true)(implicit ctx: Context): Symbol

    Return symbol in this denotation that satisfies the given predicate.

    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.

  35. def requiredValue(name: PreName)(implicit ctx: Context): TermSymbol

  36. def requiredValueRef(name: PreName)(implicit ctx: Context): TermRef

  37. def show(implicit ctx: Context): String

    The string representation of this showable element.

    The string representation of this showable element.

    Definition Classes
    Showable
  38. def showSummary(implicit ctx: Context): String

    Definition Classes
    Showable
  39. def showSummary(depth: Int)(implicit ctx: Context): String

    The summarized string representation of this showable element.

    The summarized string representation of this showable element. Recursion depth is limited to some smallish value. Default is Config.summarizeDepth.

    Definition Classes
    Showable
  40. val symbol: Symbol

    The referencing symbol, or NoSymbol is none exists

  41. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  42. def toString(): String

    Definition Classes
    AnyRef → Any
  43. def toText(printer: Printer): Text

    The text representation of this showable element.

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

    Definition Classes
    DenotationShowable
  44. def unsupported(methodName: String): Nothing

    Throws an UnsupportedOperationException with the given method name.

    Throws an UnsupportedOperationException with the given method name.

    Definition Classes
    DotClass
  45. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. 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.

    pre

    The prefix type of the members of the denotation, used to determine an accessible symbol if it exists.

Inherited from Showable

Inherited from DotClass

Inherited from AnyRef

Inherited from Any

Ungrouped