dotty.tools.dotc.core
Members list
Type members
Classlikes
Attributes
- Graph
- 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.
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
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
- Graph
- Supertypes
Attributes
- Graph
- Supertypes
- class SymbolLoaderclass LazyTypeclass UncachedGroundTypeclass Typetrait Showabletrait Hashableclass Objecttrait Matchableclass Any
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
- 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
- Graph
- 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
- Graph
- 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
- Graph
- Supertypes
- Self type
- CyclicReference.type
This object provides useful implicit decorators for types defined elsewhere
This object provides useful implicit decorators for types defined elsewhere
Attributes
- Graph
- Supertypes
- Self type
- Decorators.type
Attributes
- Companion:
- class
- Graph
- Supertypes
- Self type
- Definitions.type
Attributes
- Graph
- 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
- Graph
- 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
Attributes
- Graph
- Supertypes
- class TypeComparertrait PatternTypeConstrainertrait ConstraintHandlingclass Objecttrait Matchableclass Any
Attributes
- Companion:
- trait
- Graph
- Supertypes
- Self type
- GadtConstraint.type
Represents GADT constraints currently in scope
Attributes
- Companion:
- object
- Graph
- 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 NoPrefix.typeobject NoType.typeclass WildcardTypeclass CachedWildcardTypeobject WildcardType.typeclass IgnoredProtoclass CachedIgnoredProtoclass ViewProtoclass CachedViewPrototrait CachedTypeclass CachedProxyTypeclass AnnotatedTypeclass CachedAnnotatedTypeclass AppliedTypeclass CachedAppliedTypeclass BoundTypeclass ParamRefclass TermParamRefclass TypeParamRefclass RecThisclass ConstantTypeclass CachedConstantTypeclass ExprTypeclass CachedExprTypeclass MatchTypeclass CachedMatchTypeclass NamedTypeclass TermRefclass CachedTermRefclass TypeRefclass CachedTypeRefclass RefinedOrRecTypeclass RefinedTypeclass CachedRefinedTypeclass SkolemTypeclass QualSkolemTypeclass SuperTypeclass CachedSuperTypeclass ThisTypeclass CachedThisTypeclass TypeBoundsclass AliasingBoundsclass MatchAliasclass TypeAliasclass RealTypeBoundsclass TypeVarclass SelectionProtoobject AnySelectionProto.typeclass CachedSelectionProtoclass UnapplySelectionPrototrait NarrowCachedtrait ProtoTypetrait ApplyingProtoclass FunProtoclass FunProtoTypedtrait FunOrPolyProtoclass PolyPrototrait MatchAlwaysobject AnyFunctionProto.typeobject AnyTypeConstructorProto.typeobject AssignProto.typetrait TermTypetrait MethodicTypetrait ValueTypeOrPrototrait ValueTypeclass FlexTypeclass ErrorTypeclass PreviousErrorTypeobject UnspecifiedErrorType.typeclass SearchFailureTypeclass AmbiguousImplicitsclass DivergingImplicitclass FailedExtensionclass MismatchedImplicitclass NestedFailureclass NoMatchingImplicitsobject ImplicitSearchTooLarge.typeobject NoMatchingImplicits.typeclass TooUnspecificclass SynthesisFailureobject TryDynamicCallType.typeclass LazyReftrait SingletonTypetrait CaptureRefclass TypeProxyclass UncachedProxyTypetrait TypeTypeclass UncachedGroundTypeclass LazyTypeclass ApplyProxyCompleterclass ModuleCompletertrait NoCompleterclass NoLoaderobject NoCompleter.typeclass StubInfotrait TypeParamsCompleterclass ClassUnpicklerclass TypeDefCompleterclass SymbolLoaderclass ClassfileLoaderclass SourcefileLoaderclass PackageLoaderclass MemberCompleterclass Completerclass LocalUnpicklerobject localMemberUnpickler.typeclass Completerclass ClassCompleterclass SuspendCompleterclass ImportTypeclass Rangeclass TempClassInfoTypeclass TempPolyTypeclass AppliedUniquesclass NamedTypeUniques
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
- Graph
- Supertypes
- Self type
- JavaNullInterop.type
Attributes
- Graph
- Supertypes
- Self type
- MacroClassLoader.type
Attributes
- Graph
- Supertypes
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
- Self type
- MatchTypeTrace.type
Attributes
- Graph
- Supertypes
A collection of mode bits that are part of a context
A NoCompleter which is also a SymbolLoader.
A NoCompleter which is also a SymbolLoader.
Attributes
- Graph
- Supertypes
- trait NoCompleterclass SymbolLoaderclass LazyTypeclass UncachedGroundTypeclass Typetrait Showabletrait Hashableclass Objecttrait Matchableclass Any
Defines operations on nullable types and tree.
Defines operations on nullable types and tree.
Attributes
- Graph
- Supertypes
- Self type
- NullOpsDecorator.type
Attributes
- Companion:
- class
- Graph
- 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.
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
- 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
- Graph
- Supertypes
- Known subtypes
Attributes
- Graph
- Supertypes
- Known subtypes
- Self type
Attributes
- Graph
- Supertypes
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
Attributes
- Companion:
- enum
- Graph
- Supertypes
- Self type
- SourceLanguage.type
Attributes
- Graph
- Supertypes
- class SymbolLoaderclass LazyTypeclass UncachedGroundTypeclass Typetrait Showabletrait Hashableclass Objecttrait Matchableclass Any
Attributes
- Graph
- Supertypes
- Self type
- StagingContext.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
- Self type
- Substituters.type
Attributes
- Graph
- 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
- Graph
- Supertypes
- Self type
- SymbolLoaders.type
Attributes
- Companion:
- class
- Graph
- Supertypes
- Self type
- TrackingTypeComparer.type
Attributes
- Companion:
- object
- Graph
- Supertypes
- class TypeComparertrait PatternTypeConstrainertrait ConstraintHandlingclass Objecttrait Matchableclass Any
Attributes
- Companion:
- class
- Graph
- 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
- Graph
- Supertypes
- class AnyValtrait Matchableclass Any
Provides methods to compare types.
Provides methods to compare types.
Attributes
- Companion:
- object
- Graph
- Supertypes
- Known subtypes
- class ExplainingTypeComparerclass TrackingTypeComparer
Attributes
- Companion:
- class
- Graph
- 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
- Graph
- Supertypes
- Self type
- TypeErasure.type
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
Attributes
- Graph
- Supertypes
- Known subtypes
Attributes
- Companion:
- class
- Graph
- 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
- Graph
- Supertypes
Attributes
- Companion:
- object
- Graph
- Supertypes
- class WeakHashSet[Type]class MutableSet[Type]class ReadOnlySet[Type]class Objecttrait Matchableclass Any
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
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
- Self type
- handleRecursive.type