dotty.tools.dotc.core

Members list

Concise view

Type members

Classlikes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
enum Atoms

Indicates the singleton types that a type must or may consist of.

Indicates the singleton types that a type must or may consist of.

Attributes

hi

The upper bound: all singleton types in the carrier type are guaranteed to be in this set If the underlying type of a singleton type is another singleton type, only the latter type ends up in the sets.

lo

The lower bound: singleton types in this set are guaranteed to be in the carrier type.

Graph
Supertypes
trait Enum
trait Product
trait Equals
class Object
trait Matchable
class Any

Realizability status

Realizability status

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class CheckRealizable(using x$1: Context)

Compute realizability status.

Compute realizability status.

A type T is realizable iff it is inhabited by non-null values. This ensures that its type members have good bounds (in the sense from DOT papers). A type projection T#L is legal if T is realizable, and can be understood as Scala 2's v.L forSome { val v: T }.

In general, a realizable type can have multiple inhabitants, hence it need not be stable (in the sense of Type.isStable).

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
class ClassfileLoader(val classfile: AbstractFile) extends SymbolLoader

Attributes

Graph
Supertypes
class LazyType
trait Symbol => LazyType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
object Comments

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Constants

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class Constraint extends Showable

Constraint over undetermined type parameters. Constraints are built over values of the following types:

Constraint over undetermined type parameters. Constraints are built over values of the following types:

  • TypeLambda A constraint constrains the type parameters of a set of TypeLambdas
  • TypeParamRef The parameters of the constrained type lambdas
  • TypeVar Every constrained parameter might be associated with a TypeVar that has the TypeParamRef as origin.

Attributes

Graph
Supertypes
trait Showable
class Object
trait Matchable
class Any
Known subtypes

Methods for adding constraints and solving them.

Methods for adding constraints and solving them.

What goes into a Constraint as opposed to a ConstrainHandler?

Constraint code is purely functional: Operations get constraints and produce new ones. Constraint code does not have access to a type-comparer. Anything regarding lubs and glbs has to be done elsewhere.

By comparison: Constraint handlers are parts of type comparers and can use their functionality. Constraint handlers update the current constraint as a side effect.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Run
class TASTYRun
Self type
object ContextOps

Extension methods for contexts where we want to keep the ctx. syntax

Extension methods for contexts where we want to keep the ctx. syntax

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Contexts

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

This TypeError signals that completing denot encountered a cycle: it asked for denot.info (or similar), so it requires knowing denot already.

This TypeError signals that completing denot encountered a cycle: it asked for denot.info (or similar), so it requires knowing denot already.

Attributes

Companion:
object
Graph
Supertypes
class TypeError
class Exception
class Throwable
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Decorators

This object provides useful implicit decorators for types defined elsewhere

This object provides useful implicit decorators for types defined elsewhere

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

A class defining symbols and types of standard definitions

A class defining symbols and types of standard definitions

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

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.

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

A type comparer that can record traces of subtype operations

A type comparer that can record traces of subtype operations

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
object Flags

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Flags.type

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait GadtConstraint(var myConstraint: Constraint, var mapping: SimpleIdentityMap[Symbol, TypeVar], var reverseMapping: SimpleIdentityMap[TypeParamRef, Symbol], var wasConstrained: Boolean) extends Showable

Represents GADT constraints currently in scope

Represents GADT constraints currently in scope

Attributes

Companion:
object
Graph
Supertypes
trait Showable
class Object
trait Matchable
class Any
Self type
object Hashable

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait Hashable

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Type
class HKLambda
class PolyType
class RecType
class AndOrType
class AndType
class OrType
class ClassInfo
object NoPrefix.type
object NoType.type
object WildcardType.type
class ViewProto
class BoundType
class ParamRef
class RecThis
class ExprType
class MatchType
class NamedType
class TermRef
class TypeRef
class SuperType
class ThisType
class TypeAlias
class TypeVar
object AnySelectionProto.type
trait ProtoType
class FunProto
class PolyProto
object AnyFunctionProto.type
object AssignProto.type
trait TermType
trait ValueType
class FlexType
class ErrorType
object TryDynamicCallType.type
class LazyRef
class TypeProxy
trait TypeType
class LazyType
class NoLoader
object NoCompleter.type
class StubInfo
class Completer
class Completer
class Range

This module defines methods to interpret types of Java symbols, which are implicitly nullable in Java, as Scala types, which are explicitly nullable.

This module defines methods to interpret types of Java symbols, which are implicitly nullable in Java, as Scala types, which are explicitly nullable.

The transformation is (conceptually) a function n that adheres to the following rules: (1) n(T) = T | Null if T is a reference type (2) n(T) = T if T is a value type (3) n(C[T]) = C[T] | Null if C is Java-defined (4) n(C[T]) = C[n(T)] | Null if C is Scala-defined (5) n(A|B) = n(A) | n(B) | Null (6) n(A&B) = n(A) & n(B) (7) n((A1, ..., Am)R) = (n(A1), ..., n(Am))n(R) for a method with arguments (A1, ..., Am) and return type R (8) n(T) = T otherwise

Treatment of generics (rules 3 and 4):

  • if C is Java-defined, then n(C[T]) = C[T] | Null. That is, we don't recurse on the type argument, and only add Null on the outside. This is because C itself will be nullified, and in particular so will be usages of C's type argument within C's body. e.g. calling get on a java.util.List[String] already returns String|Null and not String, so we don't need to write java.util.List[String | Null].
  • if C is Scala-defined, however, then we want n(C[T]) = C[n(T)] | Null. This is because C won't be nullified, so we need to indicate that its type argument is nullable.

Notice that since the transformation is only applied to types attached to Java symbols, it doesn't need to handle the full spectrum of Scala types. Additionally, some kinds of symbols like constructors and enum instances get special treatment.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class MalformedType(pre: Type, denot: Denotation, absMembers: Set[Name]) extends TypeError

Attributes

Graph
Supertypes
class TypeError
class Exception
class Throwable
class Object
trait Matchable
class Any

A utility module to produce match type reduction traces in error messages.

A utility module to produce match type reduction traces in error messages.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class MissingType(pre: Type, name: Name) extends TypeError

Attributes

Graph
Supertypes
class TypeError
class Exception
class Throwable
class Object
trait Matchable
class Any
final case class Mode(bits: Int) extends AnyVal

A collection of mode bits that are part of a context

A collection of mode bits that are part of a context

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
object Mode

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Mode.type
object NameKinds

Defines possible kinds of NameInfo of a derived name

Defines possible kinds of NameInfo of a derived name

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object NameOps

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
NameOps.type
object NameTags extends NameTags

The possible tags of a NameKind

The possible tags of a NameKind

Attributes

Graph
Supertypes
class NameTags
class Object
trait Matchable
class Any
Self type
object NamerOps

Operations that are shared between Namer and TreeUnpickler

Operations that are shared between Namer and TreeUnpickler

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Names

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Names.type
class NoLoader extends SymbolLoader with NoCompleter

A NoCompleter which is also a SymbolLoader.

A NoCompleter which is also a SymbolLoader.

Attributes

Graph
Supertypes
class LazyType
trait Symbol => LazyType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any

Defines operations on nullable types and tree.

Defines operations on nullable types and tree.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class OrderingConstraint(boundsMap: ParamBounds, lowerMap: ParamOrdering, upperMap: ParamOrdering, hardVars: TypeVars) extends Constraint

Constraint over undetermined type parameters that keeps separate maps to reflect parameter orderings.

Constraint over undetermined type parameters that keeps separate maps to reflect parameter orderings.

Attributes

boundsMap

a map from TypeLambda to arrays. Each array contains twice the number of entries as there a type parameters in the TypeLambda. The first half of the array contains the type bounds that constrain the lambda's type parameters. The second half might contain type variables that track the corresponding parameters, or is left empty (filled with nulls). An instantiated type parameter is represented by having its instance type in the corresponding array entry. The dual use of arrays for poly params and typevars is to save space and hopefully gain some speed.

hardVars

a set of type variables that are marked as hard and therefore will not undergo a widenUnion when instantiated to their lower bound.

lowerMap

a map from TypeLambdas to arrays. Each array entry corresponds to a parameter P of the type lambda; it contains all constrained parameters Q that are known to be smaller than P, i.e. Q <: P.

upperMap

a map from TypeLambdas to arrays. Each array entry corresponds to a parameter P of the type lambda; it contains all constrained parameters Q that are known to be greater than P, i.e. P <: Q.

Companion:
object
Graph
Supertypes
trait Showable
class Object
trait Matchable
class Any
Self type
trait ParamInfo

A common super trait of Symbol and LambdaParam. Used to capture the attributes of type parameters which can be implemented as either.

A common super trait of Symbol and LambdaParam. Used to capture the attributes of type parameters which can be implemented as either.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Symbol
object NoSymbol.type
object ParamInfo

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
object Periods

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Periods.type
object Phases

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Phases.type
class RecursionOverflow(val op: String, details: => String, val previous: Throwable, val weight: Int) extends TypeError

Attributes

Graph
Supertypes
class TypeError
class Exception
class Throwable
class Object
trait Matchable
class Any
object Scopes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Scopes.type
case class Signature(paramsSig: List[ParamSig], resSig: TypeName)

The signature of a denotation.

The signature of a denotation.

Same-named denotations with different signatures are considered to be overloads, see SingleDenotation#matches for more details.

A method signature (a value of type Signature, excluding NotAMethod and OverloadedSignature) is composed of a list of parameter signatures, plus a type signature for the final result type.

A parameter signature (a value of type ParamSig) is either an integer, representing the number of type parameters in a type parameter section, or the type signature of a term parameter.

A type signature is the fully qualified name of the type symbol of the type's erasure.

For instance a definition

def f[T, S](x: Int)(y: List[T]): S

would have signature

Signature(
  List(2, "scala.Int".toTypeName, "scala.collection.immutable.List".toTypeName),
  "java.lang.Object".toTypeName)

Note that paramsSig has one entry for a whole type parameter section but one entry for each term parameter (currently, methods in Dotty can only have one type parameter section but this encoding leaves the door open for supporting multiple sections).

The signatures of non-method types are always NotAMethod.

There are three kinds of "missing" parts of signatures:

  • tpnme.EMPTY Result type marker for NotAMethod and OverloadedSignature
  • tpnme.WILDCARD Arises from a Wildcard or error type
  • tpnme.Uninstantiated Arises from an uninstantiated type variable

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
object Signature

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

The language in which the definition being erased was written.

The language in which the definition being erased was written.

Attributes

Companion:
object
Graph
Supertypes
trait Enum
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Companion:
enum
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
class SourcefileLoader(val srcfile: AbstractFile) extends SymbolLoader

Attributes

Graph
Supertypes
class LazyType
trait Symbol => LazyType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object StdNames

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Substitution operations on types. See the corresponding subst and substThis methods on class Type for an explanation.

Substitution operations on types. See the corresponding subst and substThis methods on class Type for an explanation.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class SymbolLoader extends LazyType

A lazy type that completes itself by calling parameter doComplete. Any linked modules/classes or module classes are also initialized.

A lazy type that completes itself by calling parameter doComplete. Any linked modules/classes or module classes are also initialized.

Attributes

Graph
Supertypes
class LazyType
trait Symbol => LazyType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Symbols

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Symbols.type

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class TrackingTypeComparer(initctx: Context) extends TypeComparer

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
final class TypeApplications(val self: Type) extends AnyVal

A decorator that provides methods for modeling type application

A decorator that provides methods for modeling type application

Attributes

Companion:
object
Graph
Supertypes
class AnyVal
trait Matchable
class Any

Provides methods to compare types.

Provides methods to compare types.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Erased types are:

Erased types are:

ErasedValueType TypeRef(prefix is ignored, denot is ClassDenotation) TermRef(prefix is ignored, denot is SymDenotation) JavaArrayType AnnotatedType MethodType ThisType SuperType ClassInfo (NoPrefix, ...) NoType NoPrefix WildcardType ErrorType

only for isInstanceOf, asInstanceOf: PolyType, TypeParamRef, TypeBounds

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class TypeErasure(sourceLanguage: SourceLanguage, semiEraseVCs: Boolean, isConstructor: Boolean, isSymbol: Boolean, wildcardOK: Boolean)

Attributes

isConstructor

Argument forms part of the type of a constructor

isSymbol

If true, the type being erased is the info of a symbol.

semiEraseVCs

If true, value classes are semi-erased to ErasedValueType (they will be fully erased in ElimErasedValueType). If false, they are erased like normal classes.

sourceLanguage

Adapt our erasure rules to mimic what the given language would do.

wildcardOK

Wildcards are acceptable (true when using the erasure for computing a signature name).

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
class TypeError(msg: String) extends Exception

Attributes

Graph
Supertypes
class Exception
class Throwable
class Object
trait Matchable
class Any
Known subtypes
object TypeEval

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object TypeOps

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
TypeOps.type
opaque object TyperState

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class TyperState()

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Types

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Types.type

When calling Constraint#addLess(p1, p2, ...), the caller might end up unifying one parameter with the other, this enum lets addLess know which direction the unification will take.

When calling Constraint#addLess(p1, p2, ...), the caller might end up unifying one parameter with the other, this enum lets addLess know which direction the unification will take.

Attributes

Graph
Supertypes
trait Enum
trait Product
trait Equals
class Object
trait Matchable
class Any
class Uniques extends WeakHashSet[Type]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Uniques

Defines operation unique for hash-consing types. Also defines specialized hash sets for hash consing uniques of a specific type. All sets offer a enterIfNew method which checks whether a type with the given parts exists already and creates a new one if not.

Defines operation unique for hash-consing types. Also defines specialized hash sets for hash consing uniques of a specific type. All sets offer a enterIfNew method which checks whether a type with the given parts exists already and creates a new one if not.

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Uniques.type
object Variances

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Post-process exceptions that might result from StackOverflow to add tracing information while unwalking the stack.

Post-process exceptions that might result from StackOverflow to add tracing information while unwalking the stack.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type