dotty.tools.dotc.core
Members list
Type members
Classlikes
Attributes
- Supertypes
- Self type
-
Annotations.type
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 Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Realizability status
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
Attributes
- Supertypes
-
class SymbolLoaderclass LazyTypeclass UncachedGroundTypeclass Typetrait Showabletrait Hashableclass Objecttrait Matchableclass AnyShow all
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
Attributes
- Companion
- class
- Supertypes
- Self type
-
CompilationUnitInfo.type
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
- Known subtypes
-
class OrderingConstraint
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
- Known subtypes
Extension methods for contexts where we want to keep the ctx.
Extension methods for contexts where we want to keep the ctx.
Attributes
- Supertypes
- Self type
-
ContextOps.type
This TypeError signals that completing denot encountered a cycle: it asked for denot.info (or similar), so it requires knowing denot already.
Attributes
- Companion
- class
- Supertypes
- Self type
-
CyclicReference.type
This object provides useful extension methods for types defined elsewhere
This object provides useful extension methods for types defined elsewhere
Attributes
- Supertypes
- Self type
-
Decorators.type
Attributes
- Companion
- class
- Supertypes
- Self type
-
Definitions.type
Attributes
- Supertypes
- Self type
-
DenotTransformers.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
- Supertypes
- Self type
-
Denotations.type
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 TypeComparertrait PatternTypeConstrainertrait ConstraintHandlingclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
- Self type
-
GadtConstraint.type
Attributes
- Companion
- object
- Supertypes
- Self type
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
class Typetrait BindingTypetrait LambdaTypeclass HKLambdaclass HKTypeLambdaclass MethodOrPolyclass MethodTypeclass CachedMethodTypeclass PolyTypetrait TermLambdatrait TypeLambdaclass RecTypeclass CachedGroundTypeclass ErasedValueTypeclass CachedErasedValueTypeclass AndOrTypeclass AndTypeclass CachedAndTypeclass OrTypeclass CachedOrTypeclass ClassInfoclass CachedClassInfoclass TempClassInfoclass JavaArrayTypeclass CachedJavaArrayTypeobject NoPrefixobject NoTypeclass WildcardTypeclass CachedWildcardTypeobject WildcardTypeclass IgnoredProtoclass CachedIgnoredProtoclass ViewProtoclass CachedViewPrototrait CachedTypeclass CachedProxyTypeclass AnnotatedTypeclass CachedAnnotatedTypeclass AppliedTypeclass CachedAppliedTypeclass BoundTypeclass ParamRefclass TermParamRefclass TypeParamRefclass RecThisclass ConstantTypeclass CachedConstantTypeclass ExprTypeclass CachedExprTypeclass FlexibleTypeclass MatchTypeclass CachedMatchTypeclass NamedTypeclass TermRefclass CachedTermRefclass TypeRefclass CachedTypeRefclass RefinedOrRecTypeclass RefinedTypeclass CachedRefinedTypeclass SkolemTypeclass QualSkolemTypeclass SuperTypeclass CachedSuperTypeclass ThisTypeclass CachedThisTypeclass TypeBoundsclass AliasingBoundsclass MatchAliasclass TypeAliasclass RealTypeBoundsclass TypeVarclass SelectionProtoobject AnySelectionProtoclass CachedSelectionProtoobject SingletonTypeProtoclass UnapplySelectionPrototrait NarrowCachedtrait ProtoTypetrait ApplyingProtoclass FunProtoclass FunProtoTypedtrait FunOrPolyProtoclass PolyPrototrait MatchAlwaysobject AnyFunctionProtoobject AnyTypeConstructorProtoobject LhsPrototrait TermTypetrait MethodicTypetrait ValueTypeOrPrototrait ValueTypetrait CaptureReftrait SingletonCaptureRefclass FlexTypeclass ErrorTypeclass PreviousErrorTypeobject UnspecifiedErrorTypeclass SearchFailureTypeclass AmbiguousImplicitsclass DivergingImplicitclass FailedExtensionclass MacroErrorsFailureclass MismatchedImplicitclass NestedFailureclass NoMatchingImplicitsobject ImplicitSearchTooLargeobject NoMatchingImplicitsclass TooUnspecificclass SynthesisFailureobject TryDynamicCallTypeclass LazyReftrait SingletonTypeclass TypeProxyclass UncachedProxyTypetrait TypeTypeclass UncachedGroundTypeclass TempClassInfoTypeclass TempPolyTypeclass LazyTypeclass MemberCompleterclass Completerclass LocalUnpicklerclass ClassUnpicklerobject localMemberUnpicklerclass ApplyProxyCompleterclass ModuleCompletertrait NoCompleterclass NoLoaderobject NoCompleterclass StubInfotrait TypeParamsCompleterclass TypeDefCompleterclass SymbolLoaderclass ClassfileLoaderclass SourcefileLoaderclass PackageLoaderclass TastyLoaderclass Completerclass ClassCompleterclass SuspendCompleterclass ImportTypeclass Rangeclass AppliedUniquesclass NamedTypeUniquesShow 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, thenn(C[T]) = C[T] | Null
. That is, we don't recurse on the type argument, and only add Null on the outside. This is becauseC
itself will be nullified, and in particular so will be usages ofC
's type argument within C's body. e.g. callingget
on ajava.util.List[String]
already returnsString|Null
and notString
, so we don't need to writejava.util.List[String | Null]
. - if
C
is Scala-defined, however, then we wantn(C[T]) = C[n(T)] | Null
. This is becauseC
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
- Self type
-
JavaNullInterop.type
Attributes
- Supertypes
- Self type
-
MacroClassLoader.type
Attributes
- Supertypes
-
class TypeErrorclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
- Self type
-
MatchReducer.type
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 TypeComparertrait PatternTypeConstrainertrait ConstraintHandlingclass Objecttrait Matchableclass AnyShow 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
- Self type
-
MatchTypeTrace.type
Attributes
- Supertypes
-
class TypeErrorclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
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
A NoCompleter which is also a SymbolLoader.
A NoCompleter which is also a SymbolLoader.
Attributes
- Supertypes
-
trait NoCompleterclass SymbolLoaderclass LazyTypeclass UncachedGroundTypeclass Typetrait Showabletrait Hashableclass Objecttrait Matchableclass AnyShow all
Defines operations on nullable types and tree.
Defines operations on nullable types and tree.
Attributes
- Supertypes
- Self type
-
NullOpsDecorator.type
Attributes
- Companion
- class
- Supertypes
- Self type
-
OrderingConstraint.type
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
- Self type
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
- Known subtypes
Attributes
- Supertypes
- Known subtypes
- Self type
Attributes
- Supertypes
-
class TypeErrorclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
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
Attributes
- Companion
- enum
- Supertypes
- Self type
-
SourceLanguage.type
Attributes
- Supertypes
-
class SymbolLoaderclass LazyTypeclass UncachedGroundTypeclass Typetrait Showabletrait Hashableclass Objecttrait Matchableclass AnyShow all
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
- Self type
-
Substituters.type
Attributes
- Supertypes
- Self type
-
SymDenotations.type
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
Attributes
- Supertypes
- Self type
-
SymbolLoaders.type
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
Attributes
- Supertypes
-
class SymbolLoaderclass LazyTypeclass UncachedGroundTypeclass Typetrait Showabletrait Hashableclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
- Self type
-
TypeApplications.type
A decorator that provides methods for modeling type application
A decorator that provides methods for modeling type application
Attributes
- Companion
- object
- Supertypes
-
class AnyValtrait Matchableclass Any
Provides methods to compare types.
Provides methods to compare types.
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
class ExplainingTypeComparerclass MatchReducer
Attributes
- Companion
- class
- Supertypes
- Self type
-
TypeComparer.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
- Supertypes
- Self type
-
TypeErasure.type
Value parameters
- inSigName
-
This eraser is used for
TypeErasure.sigName
, seeTypeErasure#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
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
class CyclicReferenceclass StaleSymbolTypeErrorclass MalformedTypeclass MissingTypeclass RecursionOverflowclass UnpicklingErrorShow all
Attributes
- Companion
- class
- Supertypes
- Self type
-
TyperState.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 Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- object
- Supertypes
-
class WeakHashSet[Type]class MutableSet[Type]class ReadOnlySet[Type]class Objecttrait Matchableclass AnyShow all
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
Attributes
- Supertypes
-
class TypeErrorclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
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
- Self type
-
handleRecursive.type