Denotations

dotty.tools.dotc.core.Denotations$
object Denotations

Denotations represent the meaning of symbols and named types. The following diagram shows how the principal types of denotations and their denoting entities relate to each other. Lines ending in a down-arrow v are member methods. The two methods shown in the diagram are "symbol" and "deref". Both methods are parameterized by the current context, and are effectively indexed by current period.

Lines ending in a horizontal line mean subtyping (right is a subtype of left).

NamedType | Symbol---------ClassSymbol | | | | denot | denot | denot v v v Denotation-+-----SingleDenotation-+------SymDenotation-+----ClassDenotation | | +-----MultiDenotation | | +--UniqueRefDenotation +--JointRefDenotation

Here's a short summary of the classes in this diagram.

NamedType A type consisting of a prefix type and a name, with fields prefix: Type name: Name It has two subtypes: TermRef and TypeRef Symbol A label for a definition or declaration in one compiler run ClassSymbol A symbol representing a class Denotation The meaning of a named type or symbol during a period MultiDenotation A denotation representing several overloaded members SingleDenotation A denotation representing a non-overloaded member or definition, with main fields symbol: Symbol info: Type UniqueRefDenotation A denotation referring to a single definition with some member type JointRefDenotation A denotation referring to a member that could resolve to several definitions SymDenotation A denotation representing a single definition with its original type, with main fields name: Name owner: Symbol flags: Flags privateWithin: Symbol annotations: List[Annotation] ClassDenotation A denotation representing a single class definition.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class DenotUnion(denot1: PreDenotation, denot2: PreDenotation) extends MultiPreDenotation

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
abstract class Denotation(val symbol: Symbol, var myInfo: Type, val isType: Boolean) extends PreDenotation, Showable

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

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

Value parameters

symbol

The referencing symbol, or NoSymbol is none exists

Attributes

Supertypes
trait Showable
class Object
trait Matchable
class Any
Known subtypes
class ErrorDenotation(using x$1: Context) extends NonSymSingleDenotation

Attributes

Supertypes
class Denotation
trait Showable
class Object
trait Matchable
class Any
Show all
Known subtypes
class JointRefDenotation(symbol: Symbol, initInfo: Type, initValidFor: Period, prefix: Type, val isRefinedMethod: Boolean) extends NonSymSingleDenotation

Attributes

Supertypes
class Denotation
trait Showable
class Object
trait Matchable
class Any
Show all
case class MissingRef(owner: SingleDenotation, name: Name)(using x$3: Context) extends ErrorDenotation

An error denotation that provides more info about the missing reference. Produced by staticRef, consumed by requiredSymbol.

An error denotation that provides more info about the missing reference. Produced by staticRef, consumed by requiredSymbol.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Denotation
trait Showable
class Object
trait Matchable
class Any
Show all
case class MultiDenotation(denot1: Denotation, denot2: Denotation) extends Denotation, MultiPreDenotation

An overloaded denotation consisting of the alternatives of both given denotations.

An overloaded denotation consisting of the alternatives of both given denotations.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Denotation
trait Showable
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class NoQualifyingRef(alts: List[SingleDenotation])(using x$2: Context) extends ErrorDenotation

An error denotation that provides more info about alternatives that were found but that do not qualify. Produced by staticRef, consumed by requiredSymbol.

An error denotation that provides more info about alternatives that were found but that do not qualify. Produced by staticRef, consumed by requiredSymbol.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Denotation
trait Showable
class Object
trait Matchable
class Any
Show all
abstract class NonSymSingleDenotation(symbol: Symbol, initInfo: Type, val prefix: Type) extends SingleDenotation

Attributes

Supertypes
class Denotation
trait Showable
class Object
trait Matchable
class Any
Show all
Known subtypes
abstract class PreDenotation

A PreDenotation represents a group of single denotations or a single multi-denotation It is used as an optimization to avoid forming MultiDenotations too eagerly.

A PreDenotation represents a group of single denotations or a single multi-denotation It is used as an optimization to avoid forming MultiDenotations too eagerly.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
abstract class SingleDenotation(symbol: Symbol, initInfo: Type, isType: Boolean) extends Denotation

A non-overloaded denotation

A non-overloaded denotation

Attributes

Supertypes
class Denotation
trait Showable
class Object
trait Matchable
class Any
Show all
Known subtypes
class StaleSymbol(msg: => String) extends Exception

An exception for accessing symbols that are no longer valid in current run

An exception for accessing symbols that are no longer valid in current run

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
class UniqueRefDenotation(symbol: Symbol, initInfo: Type, initValidFor: Period, prefix: Type) extends NonSymSingleDenotation

Attributes

Supertypes
class Denotation
trait Showable
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def infoMeet(tp1: Type, tp2: Type, safeIntersection: Boolean)(using Context): Type

Normally, tp1 & tp2, with extra care taken to return tp1 or tp2 directly if that's a valid answer. Special cases for matching methods and classes, with the possibility of returning NoType. Special handling of ExprTypes, where mixed intersections widen the ExprType away.

Normally, tp1 & tp2, with extra care taken to return tp1 or tp2 directly if that's a valid answer. Special cases for matching methods and classes, with the possibility of returning NoType. Special handling of ExprTypes, where mixed intersections widen the ExprType away.

Attributes

def isDoubleDef(sym1: Symbol, sym2: Symbol)(using Context): Boolean

A double definition

A double definition

Attributes

def missingHook(owner: Symbol, name: Name)(using Context): Symbol

If we are looking for a non-existing term name in a package, assume it is a package for which we do not have a directory and enter it.

If we are looking for a non-existing term name in a package, assume it is a package for which we do not have a directory and enter it.

Attributes

def staticRef(path: Name, generateStubs: Boolean, isPackage: Boolean)(using Context): Denotation

The current denotation of the static reference given by path, or a MissingRef or NoQualifyingRef instance, if it does not exist. if generateStubs is set, generates stubs for missing top-level symbols

The current denotation of the static reference given by path, or a MissingRef or NoQualifyingRef instance, if it does not exist. if generateStubs is set, generates stubs for missing top-level symbols

Attributes

Implicits

Implicits