dotty.tools.dotc.core

Members list

Type members

Classlikes

object Annotations

Attributes

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.

Value parameters

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.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Realizability status

Realizability status

Attributes

Companion
class
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
Supertypes
class Object
trait Matchable
class Any
class ClassfileLoader(val classfile: AbstractFile) extends SymbolLoader

Attributes

Supertypes
class SymbolLoader
class LazyType
trait Symbol => LazyType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
object Comments

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Comments.type
case class CompilationUnitInfo(associatedFile: AbstractFile, tastyInfo: Option[TastyInfo])

Information about the compilation unit of a class symbol.

Information about the compilation unit of a class symbol.

Value parameters

associatedFile

The source or class file from which this class or the class containing this symbol was generated, null if not applicable.

tastyInfo

Information about the TASTy from which this class was loaded. None if not loaded from TASTy,

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object Constants

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Constants.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

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

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Run
class TASTYRun
Self type
Run
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

Supertypes
class Object
trait Matchable
class Any
Self type
ContextOps.type
object Contexts

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Contexts.type
class CyclicReference(val denot: SymDenotation, val optTrace: Option[Array[TraceElement]])(using x$3: Context) extends TypeError

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
Supertypes
class TypeError
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

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

This object provides useful extension methods for types defined elsewhere

This object provides useful extension methods for types defined elsewhere

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Decorators.type
object Definitions

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class Definitions

A class defining symbols and types of standard definitions

A class defining symbols and types of standard definitions

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
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.

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

Supertypes
class Object
trait Matchable
class Any
Self type
class ExplainingTypeComparer(initctx: Context, short: Boolean) extends TypeComparer

A type comparer that can record traces of subtype operations

A type comparer that can record traces of subtype operations

Value parameters

short

if true print only failing forward traces; never print succesful subtraces; never print backtraces starting with <==.

Attributes

Supertypes
class TypeComparer
class Object
trait Matchable
class Any
Show all
object Flags

Attributes

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

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class GadtConstraint extends Showable

Represents GADT constraints currently in scope

Represents GADT constraints currently in scope

Attributes

Companion
object
Supertypes
trait Showable
class Object
trait Matchable
class Any
object GadtState

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
GadtState.type
sealed trait GadtState

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Self type
object Hashable

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Hashable.type
trait Hashable

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Type
trait BindingType
trait LambdaType
class HKLambda
class HKTypeLambda
class MethodOrPoly
class MethodType
class PolyType
trait TermLambda
trait TypeLambda
class RecType
class AndOrType
class AndType
class OrType
class CachedOrType
class ClassInfo
object NoPrefix
object NoType
class WildcardType
object WildcardType
class IgnoredProto
class ViewProto
trait CachedType
class AppliedType
class BoundType
class ParamRef
class TermParamRef
class TypeParamRef
class RecThis
class ConstantType
class ExprType
class FlexibleType
class MatchType
class NamedType
class TermRef
class TypeRef
class RefinedType
class SkolemType
class SuperType
class ThisType
class TypeBounds
class MatchAlias
class TypeAlias
class TypeVar
trait NarrowCached
trait ProtoType
class FunProto
class PolyProto
trait MatchAlways
object LhsProto
trait TermType
trait MethodicType
trait ValueType
trait CaptureRef
class FlexType
class ErrorType
class LazyRef
class TypeProxy
trait TypeType
class TempPolyType
class LazyType
class Completer
trait NoCompleter
class NoLoader
object NoCompleter
class StubInfo
class SymbolLoader
class TastyLoader
class Completer
class ImportType
class Range
Show all

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

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

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

Attributes

Supertypes
class TypeError
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
object MatchReducer

Attributes

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

A type comparer for reducing match types. TODO: Not sure this needs to be a type comparer. Can we make it a separate class?

A type comparer for reducing match types. TODO: Not sure this needs to be a type comparer. Can we make it a separate class?

Attributes

Companion
object
Supertypes
class TypeComparer
class Object
trait Matchable
class Any
Show all

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

Supertypes
class Object
trait Matchable
class Any
Self type
class MissingType(pre: Type, name: Name)(using x$3: Context) extends TypeError

Attributes

Supertypes
class TypeError
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
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.

What's the difference between a boolean setting and a Mode? A setting is usually valid for the entire compilation run, whereas a mode is context specific. Changing a setting in a context creates a new SettingsState in that context, which is a relatively big object. By comparison, a mode is just an Int. But, Mode bits are a scarce resource, so for low priority situations, just reset the state with a setting. Also, a setting is externally settable, while a mode isn't.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object Mode

Attributes

Companion
class
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

Supertypes
class Object
trait Matchable
class Any
Self type
NameKinds.type
object NameOps

Attributes

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

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

Operations that are shared between Namer and TreeUnpickler

Operations that are shared between Namer and TreeUnpickler

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
NamerOps.type
object Names

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Names.type

A NoCompleter which is also a SymbolLoader.

A NoCompleter which is also a SymbolLoader.

Attributes

Supertypes
trait NoCompleter
class SymbolLoader
class LazyType
trait Symbol => LazyType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all

Defines operations on nullable types and tree.

Defines operations on nullable types and tree.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
class
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.

Value parameters

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.

Attributes

Companion
object
Supertypes
class Constraint
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
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Symbol
class ClassSymbol
object NoSymbol
class LambdaParam
object ParamInfo

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
ParamInfo.type

Attributes

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

Attributes

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

Attributes

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

Attributes

Supertypes
class TypeError
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
object Scopes

Attributes

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
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Signature

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Signature.type

The language in which the definition being erased was written.

The language in which the definition being erased was written.

Attributes

Companion
object
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

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

Attributes

Supertypes
class SymbolLoader
class LazyType
trait Symbol => LazyType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
object StdNames

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
StdNames.type
object Substituters

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

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
class SymUtils

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Symbols
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

Supertypes
class LazyType
trait Symbol => LazyType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
Known subtypes
Self type
object SymbolLoaders

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object Symbols extends SymUtils

Attributes

Supertypes
class SymUtils
class Object
trait Matchable
class Any
Self type
Symbols.type
case class TastyInfo(version: TastyVersion, attributes: Attributes)

Information about the TASTy of a class symbol.

Information about the TASTy of a class symbol.

Value parameters

attributes

Attributes of in the TASTy attributes section

version

The TASTy version (major, minor, experimental)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
class TastyLoader(val tastyFile: AbstractFile) extends SymbolLoader

Attributes

Supertypes
class SymbolLoader
class LazyType
trait Symbol => LazyType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
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
Supertypes
class AnyVal
trait Matchable
class Any

Provides methods to compare types.

Provides methods to compare types.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object TypeComparer

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
object TypeErasure

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
Supertypes
class Object
trait Matchable
class Any
Self type
class TypeErasure(sourceLanguage: SourceLanguage, semiEraseVCs: Boolean, isConstructor: Boolean, isSymbol: Boolean, inSigName: Boolean)

Value parameters

inSigName

This eraser is used for TypeErasure.sigName, see TypeErasure#apply for more information.

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.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
abstract class TypeError(using creationContext: Context) extends Exception

Attributes

Companion
object
Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
object TypeError

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
TypeError.type
object TypeEval

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
TypeEval.type
object TypeOps

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
TypeOps.type
class TypeUtils

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Types
opaque object TyperState

Attributes

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

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Types extends TypeUtils

Attributes

Supertypes
class TypeUtils
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

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
class Uniques extends WeakHashSet[Type]

Attributes

Companion
object
Supertypes
class WeakHashSet[Type]
class MutableSet[Type]
class ReadOnlySet[Type]
class Object
trait Matchable
class Any
Show all
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
Supertypes
class Object
trait Matchable
class Any
Self type
Uniques.type
class UnpicklingError(denot: Denotation, where: String, cause: Throwable)(using x$4: Context) extends TypeError

Attributes

Supertypes
class TypeError
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
object Variances

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Variances.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

Supertypes
class Object
trait Matchable
class Any
Self type