Types

dotty.tools.dotc.core.Types$
object Types

Attributes

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

Members list

Concise view

Type members

Classlikes

abstract class AliasingBounds(val alias: Type) extends TypeBounds

Common supertype of TypeAlias and MatchAlias

Common supertype of TypeAlias and MatchAlias

Attributes

Graph
Supertypes
trait Product
trait Equals
trait TypeType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
abstract class AndOrType extends CachedGroundType with ValueType

Attributes

Graph
Supertypes
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
abstract case class AndType(tp1: Type, tp2: Type) extends AndOrType

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
class AndOrType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object AndType

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
AndType.type
abstract case class AnnotatedType(parent: Type, annot: Annotation) extends CachedProxyType with ValueType

An annotated type tpe @ annot

An annotated type tpe @ annot

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
abstract case class AppliedType(tycon: Type, args: List[Type]) extends CachedProxyType with ValueType

A type application C[T_1, ..., T_n]

A type application C[T_1, ..., T_n]

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class ApproximatingTypeMap(using x$1: Context) extends TypeMap

A type map that approximates TypeBounds types depending on variance.

A type map that approximates TypeBounds types depending on variance.

if variance > 0 : approximate by upper bound variance < 0 : approximate by lower bound variance = 0 : propagate bounds to next outer level

Attributes

Graph
Supertypes
class TypeMap
trait Type => Type
class Object
trait Matchable
class Any
Known subtypes
Self type

Approximate wildcards by their bounds

Approximate wildcards by their bounds

Attributes

Graph
Supertypes
class TypeMap
trait Type => Type
class Object
trait Matchable
class Any
Known subtypes
trait BiTypeMap extends TypeMap

A supertrait for some typemaps that are bijections. Used for capture checking. BiTypeMaps should map capture references to capture references.

A supertrait for some typemaps that are bijections. Used for capture checking. BiTypeMaps should map capture references to capture references.

Attributes

Graph
Supertypes
class TypeMap
trait Type => Type
class Object
trait Matchable
class Any
Known subtypes
Self type
trait BindingType extends Type

A trait for types that bind other types that refer to them. Instances are: LambdaType, RecType.

A trait for types that bind other types that refer to them. Instances are: LambdaType, RecType.

Attributes

Graph
Supertypes
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
abstract class BoundType extends CachedProxyType with ValueType

Attributes

Graph
Supertypes
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
final class CachedAndType(tp1: Type, tp2: Type) extends AndType

Attributes

Graph
Supertypes
class AndType
trait Product
trait Equals
class AndOrType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
class CachedAnnotatedType(parent: Type, annot: Annotation) extends AnnotatedType

Attributes

Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
final class CachedAppliedType(tycon: Type, args: List[Type], hc: Int) extends AppliedType

Attributes

Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
class CachedClassInfo(prefix: Type, cls: ClassSymbol, declaredParents: List[Type], decls: Scope, selfInfo: TypeOrSymbol) extends ClassInfo

Attributes

Graph
Supertypes
class ClassInfo
trait Product
trait Equals
trait TypeType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
final class CachedConstantType(value: Constant) extends ConstantType

Attributes

Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
final class CachedExprType(resultType: Type) extends ExprType

Attributes

Graph
Supertypes
class ExprType
trait Product
trait Equals
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
abstract class CachedGroundType extends Type with CachedType

Instances of this class are cached and are not proxies.

Instances of this class are cached and are not proxies.

Attributes

Graph
Supertypes
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
final class CachedJavaArrayType(elemType: Type) extends JavaArrayType

Attributes

Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
class CachedMatchType(bound: Type, scrutinee: Type, cases: List[Type]) extends MatchType

Attributes

Graph
Supertypes
class MatchType
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
final class CachedMethodType(paramNames: List[TermName])(paramInfosExp: MethodType => List[Type], resultTypeExp: MethodType => Type, val companion: MethodTypeCompanion) extends MethodType

Attributes

Graph
Supertypes
trait Product
trait Equals
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
final class CachedOrType(tp1: Type, tp2: Type, val isSoft: Boolean) extends OrType

Attributes

Graph
Supertypes
class OrType
trait Product
trait Equals
class AndOrType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
abstract class CachedProxyType extends TypeProxy with CachedType

Instances of this class are cached and are proxies.

Instances of this class are cached and are proxies.

Attributes

Graph
Supertypes
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
class CachedRefinedType(parent: Type, refinedName: Name, refinedInfo: Type) extends RefinedType

Attributes

Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
final class CachedSuperType(thistpe: Type, supertpe: Type) extends SuperType

Attributes

Graph
Supertypes
class SuperType
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
final class CachedTermRef(prefix: Type, designator: Designator, hc: Int) extends TermRef

Attributes

Graph
Supertypes
class TermRef
trait Product
trait Equals
class NamedType
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
final class CachedThisType(tref: TypeRef) extends ThisType

Attributes

Graph
Supertypes
class ThisType
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
trait CachedType extends Type

A marker trait for cached types

A marker trait for cached types

Attributes

Graph
Supertypes
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
final class CachedTypeRef(prefix: Type, designator: Designator, hc: Int) extends TypeRef

Attributes

Graph
Supertypes
class TypeRef
trait Product
trait Equals
class NamedType
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
final class CachedWildcardType(optBounds: Type) extends WildcardType

Attributes

Graph
Supertypes
trait Product
trait Equals
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any

A trait for references in CaptureSets. These can be NamedTypes, ThisTypes or ParamRefs

A trait for references in CaptureSets. These can be NamedTypes, ThisTypes or ParamRefs

Attributes

Graph
Supertypes
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
abstract case class ClassInfo(prefix: Type, cls: ClassSymbol, declaredParents: List[Type], decls: Scope, selfInfo: TypeOrSymbol) extends CachedGroundType with TypeType

Roughly: the info of a class during a period.

Roughly: the info of a class during a period.

Attributes

cls

The class symbol.

declaredParents

The parent types of this class. These are all normalized to be TypeRefs by moving any refinements to be member definitions of the class itself. Unlike parents, the types are not seen as seen from prefix.

decls

The symbols defined directly in this class.

prefix

The prefix on which parents, decls, and selfType need to be rebased.

selfInfo

The type of this in this class, if explicitly given, NoType otherwise. If class is compiled from source, can also be a reference to the self symbol containing the type.

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait TypeType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object ClassInfo

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
abstract case class ConstantType(value: Constant) extends CachedProxyType with SingletonType

A constant type with single value.

A constant type with single value.

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes

Attributes

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

Attributes

Graph
Supertypes
Self type

Attributes

Graph
Supertypes
trait (Set[Symbol], Type) => Set[Symbol]
class Object
trait Matchable
class Any
abstract class DeepTypeMap(using x$1: Context) extends TypeMap

A type map that maps also parents and self type of a ClassInfo

A type map that maps also parents and self type of a ClassInfo

Attributes

Graph
Supertypes
class TypeMap
trait Type => Type
class Object
trait Matchable
class Any
Known subtypes

Attributes

Graph
Supertypes
Self type

Attributes

Graph
Supertypes
Self type

Attributes

Graph
Supertypes
Self type
abstract class ErrorType extends FlexType

Attributes

Companion:
object
Graph
Supertypes
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object ErrorType

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class ExistsAccumulator(p: Type => Boolean, val stopAt: StopAt, forceLazy: Boolean)(using x$4: Context) extends TypeAccumulator[Boolean]

Attributes

Graph
Supertypes
trait (Boolean, Type) => Boolean
class Object
trait Matchable
class Any
abstract case class ExprType(resType: Type) extends CachedProxyType with MethodicType

A by-name parameter type of the form => T, or the type of a method with no parameter list.

A by-name parameter type of the form => T, or the type of a method with no parameter list.

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object ExprType

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class FlexType extends UncachedGroundType with ValueType

A common superclass of ErrorType and TryDynamicCallSite. Instances of this class are at the same time subtypes and supertypes of every other type.

A common superclass of ErrorType and TryDynamicCallSite. Instances of this class are at the same time subtypes and supertypes of every other type.

Attributes

Graph
Supertypes
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
class ForeachAccumulator(p: Type => Unit, val stopAt: StopAt)(using x$3: Context) extends TypeAccumulator[Unit]

Attributes

Graph
Supertypes
trait (Unit, Type) => Unit
class Object
trait Matchable
class Any
abstract class HKLambda extends CachedProxyType with LambdaType

Attributes

Graph
Supertypes
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
class HKTypeLambda(val paramNames: List[TypeName], variances: List[Variance])(paramInfosExp: HKTypeLambda => List[TypeBounds], resultTypeExp: HKTypeLambda => Type) extends HKLambda with TypeLambda

A type lambda of the form [X_0 B_0, ..., X_n B_n] => T

A type lambda of the form [X_0 B_0, ..., X_n B_n] => T

Attributes

paramInfosExp

A function that, given the polytype itself, returns the parameter bounds B_1, ..., B_n

paramNames

The names X_0, ..., X_n

resultTypeExp

A function that, given the polytype itself, returns the result type T.

variances

The variances of the type parameters, if the type lambda carries variances, i.e. it is a bound of an abstract type or the rhs of a match alias or opaque alias. The parameter is Nil for all other lambdas. Variances are stored in the typeParams list of the lambda.

Companion:
object
Graph
Supertypes
class HKLambda
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
Self type
object IdentityTypeMap extends TypeMap

Attributes

Graph
Supertypes
class TypeMap
trait Type => Type
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
Self type

A reference to an implicit definition. This can be either a TermRef or a Implicits.RenamedImplicitRef.

A reference to an implicit definition. This can be either a TermRef or a Implicits.RenamedImplicitRef.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class ImportType(expr: Tree) extends UncachedGroundType

The type of an import clause tree

The type of an import clause tree

Attributes

Graph
Supertypes
trait Product
trait Equals
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
abstract case class JavaArrayType(elemType: Type) extends CachedGroundType with ValueType

The type of an erased array

The type of an erased array

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case class LambdaParam(tl: TypeLambda, n: Int) extends ParamInfo with Showable

The parameter of a type lambda

The parameter of a type lambda

Attributes

Graph
Supertypes
trait Product
trait Equals
trait Showable
trait ParamInfo
class Object
trait Matchable
class Any
trait LambdaType extends BindingType with TermType

The lambda type square:

The lambda type square:

LambdaType | TermLambda | TypeLambda -------------+-------------------+------------------ HKLambda | HKTermLambda | HKTypeLambda MethodOrPoly | MethodType | PolyType

Attributes

Graph
Supertypes
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
Self type
abstract class LambdaTypeCompanion[N <: Name, PInfo <: Type, LT <: LambdaType]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class LazyRef(var refFn: Context => Type | Null | Null) extends UncachedProxyType with ValueType

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
object LazyRef

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
LazyRef.type
class MatchAlias(alias: Type) extends AliasingBounds

= T where T is a MatchType

= T where T is a MatchType

Match aliases are treated differently from type aliases. Their sides are mutually subtypes of each other but one side is not generally substitutable for the other. If we assumed full substitutivity, we would have to reject all recursive match aliases (or else take the jump and allow full recursive types).

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait TypeType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
object MatchAlias

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
abstract case class MatchType(bound: Type, scrutinee: Type, cases: List[Type]) extends CachedProxyType with ValueType

scrutinee match { case_1 ... case_n }

scrutinee match { case_1 ... case_n }

where

case_i = [X1, ..., Xn] patternType => resultType

and X_1,...X_n are the type variables bound in patternType

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object MatchType

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
sealed abstract class MethodOrPoly extends UncachedGroundType with LambdaType with MethodicType

The superclass of MethodType and PolyType.

The superclass of MethodType and PolyType.

Attributes

Graph
Supertypes
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object MethodTpe

A ternary extractor for MethodType

A ternary extractor for MethodType

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
abstract case class MethodType(paramNames: List[TermName])(paramInfosExp: MethodType => List[Type], resultTypeExp: MethodType => Type) extends MethodOrPoly with TermLambda with NarrowCached

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
Self type

Attributes

Companion:
class
Graph
Supertypes
Self type
abstract class MethodTypeCompanion(val prefixString: String) extends TermLambdaCompanion[MethodType]

Attributes

Graph
Supertypes
Known subtypes
Self type
trait MethodicType extends TermType

Attributes

Graph
Supertypes
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
abstract class NameFilter

A name filter selects or discards a member name of a type pre. To enable efficient caching, name filters have to satisfy the following invariant: If keep is a name filter, and pre has class C as a base class, then

A name filter selects or discards a member name of a type pre. To enable efficient caching, name filters have to satisfy the following invariant: If keep is a name filter, and pre has class C as a base class, then

keep(pre, name) implies keep(C.this, name)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object fieldFilter.type
object implicitFilter.type
object takeAllFilter.type
object typeNameFilter.type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
abstract class NamedType extends CachedProxyType with ValueType

Attributes

Companion:
object
Graph
Supertypes
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
Self type
object NamedType

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait NarrowCached extends Type

Implementations of this trait cache the results of narrow.

Implementations of this trait cache the results of narrow.

Attributes

Graph
Supertypes
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
case object NoPrefix extends CachedGroundType

Missing prefix

Missing prefix

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Product
trait Equals
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Self type
case object NoType extends CachedGroundType

Sentinel for "missing type"

Sentinel for "missing type"

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Product
trait Equals
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Self type
NoType.type
object OrNull

An extractor object to pattern match against a nullable union. e.g.

An extractor object to pattern match against a nullable union. e.g.

(tp: Type) match case OrNull(tp1) => // tp had the form tp1 | Null case _ => // tp was not a nullable union

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
OrNull.type
abstract case class OrType(tp1: Type, tp2: Type) extends AndOrType

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
class AndOrType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object OrType

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
OrType.type
abstract class ParamRef extends BoundType

Attributes

Graph
Supertypes
class BoundType
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
class PolyType(val paramNames: List[TypeName])(paramInfosExp: PolyType => List[TypeBounds], resultTypeExp: PolyType => Type) extends MethodOrPoly with TypeLambda

The type of a polymorphic method. It has the same form as HKTypeLambda, except it applies to terms and parameters do not have variances.

The type of a polymorphic method. It has the same form as HKTypeLambda, except it applies to terms and parameters do not have variances.

Attributes

Companion:
object
Graph
Supertypes
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
Self type

Attributes

Graph
Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
trait ProtoType extends Type

A trait for proto-types, used as expected types in typer

A trait for proto-types, used as expected types in typer

Attributes

Graph
Supertypes
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
class QualSkolemType(info: Type) extends SkolemType

A skolem type used to wrap the type of the qualifier of a selection.

A skolem type used to wrap the type of the qualifier of a selection.

When typing a selection e.f, if e is unstable then we unconditionally skolemize it. We use a subclass of SkolemType for this so that TypeOps#asSeenFrom may treat it specially for optimization purposes, see its implementation for more details.

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case class Range(lo: Type, hi: Type) extends UncachedGroundType

A range of possible types between lower bound lo and upper bound hi. Only used internally in ApproximatingTypeMap.

A range of possible types between lower bound lo and upper bound hi. Only used internally in ApproximatingTypeMap.

Attributes

Graph
Supertypes
trait Product
trait Equals
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
class RealTypeBounds(lo: Type, hi: Type) extends TypeBounds

Attributes

Graph
Supertypes
trait Product
trait Equals
trait TypeType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
abstract case class RecThis(binder: RecType) extends BoundType with SingletonType

a self-reference to an enclosing recursive type. The only creation method is binder.recThis, returning RecThis(binder).

a self-reference to an enclosing recursive type. The only creation method is binder.recThis, returning RecThis(binder).

Attributes

Graph
Supertypes
trait Product
trait Equals
class BoundType
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
class RecType(parentExp: RecType => Type) extends RefinedOrRecType with BindingType

A recursive type. Instances should be constructed via the companion object.

A recursive type. Instances should be constructed via the companion object.

Attributes

parentExp

A function that, given a recursive type R, produces a type that can refer to R via a RecThis(R) node. This is used to "tie the knot". For example, in class C { type T1; type T2 } type C2 = C { type T1; type T2 = T1 } The type of C2 is a recursive type {(x) => C{T1; T2 = x.T1}}, written as RecType( RefinedType( RefinedType( TypeRef(...,class C), T1, TypeBounds(...)), T2, TypeBounds( TypeRef(RecThis(...),T1), TypeRef(RecThis(...),T1)))) Where RecThis(...) points back to the enclosing RecType.

Companion:
object
Graph
Supertypes
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
object RecType

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
RecType.type
abstract class RefinedOrRecType extends CachedProxyType with ValueType

Attributes

Graph
Supertypes
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
abstract case class RefinedType(parent: Type, refinedName: Name, refinedInfo: Type) extends RefinedOrRecType

A refined type parent { refinement }

A refined type parent { refinement }

Attributes

parent

The type being refined

refinedInfo

The info of the refinement declaration

refinedName

The name of the refinement declaration

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes

Attributes

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

An extractor for single abstract method types. A type is a SAM type if it is a reference to a class or trait, which

An extractor for single abstract method types. A type is a SAM type if it is a reference to a class or trait, which

  • has a single abstract method with a method type (ExprType and PolyType not allowed!) whose result type is not an implicit function type and which is not marked inline.
  • can be instantiated without arguments or with just () as argument.

The pattern SAMType(sam) matches a SAM type, where sam is the type of the single abstract method.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
SAMType.type
trait SingletonType extends TypeProxy with ValueType

A marker trait for types that are guaranteed to contain only a single non-null value (they might contain null in addition).

A marker trait for types that are guaranteed to contain only a single non-null value (they might contain null in addition).

Attributes

Graph
Supertypes
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
case class SkolemType(info: Type) extends CachedProxyType with ValueType with SingletonType

A skolem type reference with underlying type info.

A skolem type reference with underlying type info.

For Dotty, a skolem type is a singleton type of some unknown value of type info. Note that care is needed when creating them, since not all types need to be inhabited. A skolem is equal to itself and no other type.

Attributes

Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
enum StopAt

Where a traversal should stop

Where a traversal should stop

Attributes

Graph
Supertypes
trait Enum
trait Product
trait Equals
class Object
trait Matchable
class Any
abstract case class SuperType(thistpe: Type, supertpe: Type) extends CachedProxyType with SingletonType

The type of a super reference cls.super where thistpe is cls.this and supertpe is the type of the value referenced by super.

The type of a super reference cls.super where thistpe is cls.this and supertpe is the type of the value referenced by super.

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object SuperType

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
final class TempClassInfo(prefix: Type, cls: ClassSymbol, decls: Scope, selfInfo: TypeOrSymbol) extends CachedClassInfo

A class for temporary class infos where parents are not yet known

A class for temporary class infos where parents are not yet known

Attributes

Graph
Supertypes
class ClassInfo
trait Product
trait Equals
trait TypeType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
trait TermLambda extends LambdaType

Attributes

Graph
Supertypes
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
Self type
abstract class TermLambdaCompanion[LT <: TermLambda] extends LambdaTypeCompanion[TermName, Type, LT]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
abstract case class TermParamRef(binder: TermLambda, paramNum: Int) extends ParamRef with CaptureRef

Only created in binder.paramRefs. Use binder.paramRefs(paramNum) to refer to TermParamRef(binder, paramNum).

Only created in binder.paramRefs. Use binder.paramRefs(paramNum) to refer to TermParamRef(binder, paramNum).

Attributes

Graph
Supertypes
trait Product
trait Equals
class ParamRef
class BoundType
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
abstract case class TermRef(prefix: Type, var myDesignator: Designator) extends NamedType with ImplicitRef with CaptureRef

The singleton type for path prefix#myDesignator.

The singleton type for path prefix#myDesignator.

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
class NamedType
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object TermRef

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
TermRef.type
trait TermType extends Type

A marker trait for types that apply only to term symbols or that represent higher-kinded types.

A marker trait for types that apply only to term symbols or that represent higher-kinded types.

Attributes

Graph
Supertypes
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
class HKLambda
class PolyType
class ExprType
trait ValueType
class AndOrType
class AndType
class OrType
class BoundType
class ParamRef
class RecThis
class FlexType
class ErrorType
object TryDynamicCallType.type
class LazyRef
class MatchType
class NamedType
class TermRef
class TypeRef
class RecType
class ThisType
class SuperType
class TypeVar
object AnySelectionProto.type
object WildcardType.type
abstract case class ThisType(tref: TypeRef) extends CachedProxyType with CaptureRef

The type cls.this

The type cls.this

Attributes

tref

A type ref which indicates the class cls. Note: we do not pass a class symbol directly, because symbols do not survive runs whereas typerefs do.

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object ThisType

Attributes

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

Attributes

Graph
Supertypes
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Self type
abstract class Type extends Hashable with Showable

Main class representing types.

Main class representing types.

The principal subclasses and sub-objects are as follows:

Type -+- ProxyType --+- NamedType ----+--- TypeRef
      |              |                 \
      |              +- SingletonType-+-+- TermRef
      |              |                |
      |              |                +--- ThisType
      |              |                +--- SuperType
      |              |                +--- ConstantType
      |              |                +--- TermParamRef
      |              |                +----RecThis
      |              |                +--- SkolemType
      |              +- TypeParamRef
      |              +- RefinedOrRecType -+-- RefinedType
      |              |                    +-- RecType
      |              +- AppliedType
      |              +- TypeBounds
      |              +- ExprType
      |              +- AnnotatedType
      |              +- TypeVar
      |              +- HKTypeLambda
      |              +- MatchType
      |
      +- GroundType -+- AndType
                     +- OrType
                     +- MethodOrPoly ---+-- PolyType
                     |                  +-- MethodType
                     +- ClassInfo
                     |
                     +- NoType
                     +- NoPrefix
                     +- ErrorType
                     +- WildcardType

Note: please keep in sync with copy in docs/docs/internals/type-system.md.

Attributes

Graph
Supertypes
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
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
abstract class TypeAccumulator[T](implicit val accCtx: Context) extends VariantTraversal with (T, Type) => T

Attributes

Graph
Supertypes
trait (T, Type) => T
class Object
trait Matchable
class Any
Known subtypes
class TypeAlias(alias: Type) extends AliasingBounds

= T

= T

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait TypeType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
object TypeAlias

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
abstract case class TypeBounds(lo: Type, hi: Type) extends CachedProxyType with TypeType

Type bounds >: lo <: hi

Type bounds >: lo <: hi

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait TypeType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object TypeBounds

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait TypeLambda extends LambdaType

Attributes

Graph
Supertypes
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object HKTypeLambda.type
object PolyType.type
abstract class TypeMap(implicit var mapCtx: Context) extends VariantTraversal with Type => Type

Attributes

Graph
Supertypes
trait Type => Type
class Object
trait Matchable
class Any
Known subtypes
Self type
abstract case class TypeParamRef(binder: TypeLambda, paramNum: Int) extends ParamRef

Only created in binder.paramRefs. Use binder.paramRefs(paramNum) to refer to TypeParamRef(binder, paramNum).

Only created in binder.paramRefs. Use binder.paramRefs(paramNum) to refer to TypeParamRef(binder, paramNum).

Attributes

Graph
Supertypes
trait Product
trait Equals
class ParamRef
class BoundType
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
abstract class TypeProxy extends Type

A marker trait for type proxies. Each implementation is expected to redefine the underlying method.

A marker trait for type proxies. Each implementation is expected to redefine the underlying method.

Attributes

Graph
Supertypes
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
abstract case class TypeRef(prefix: Type, var myDesignator: Designator) extends NamedType

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
class NamedType
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object TypeRef

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
TypeRef.type
class TypeSizeAccumulator(using x$1: Context) extends TypeAccumulator[Int]

Attributes

Graph
Supertypes
trait (Int, Type) => Int
class Object
trait Matchable
class Any
abstract class TypeTraverser(using x$1: Context) extends TypeAccumulator[Unit]

Attributes

Graph
Supertypes
trait (Unit, Type) => Unit
class Object
trait Matchable
class Any
trait TypeType extends Type

A marker trait for types that apply only to type symbols

A marker trait for types that apply only to type symbols

Attributes

Graph
Supertypes
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
final class TypeVar extends CachedProxyType with ValueType

In a TypeApply tree, a TypeVar is created for each argument type to be inferred. Every type variable is referred to by exactly one inferred type parameter of some TypeApply tree.

In a TypeApply tree, a TypeVar is created for each argument type to be inferred. Every type variable is referred to by exactly one inferred type parameter of some TypeApply tree.

A type variable is essentially a switch that models some part of a substitution. It is first linked to origin, a poly param that's in the current constraint set. It can then be (once) instantiated to some other type. The instantiation is recorded in the type variable itself, or else, if the current type state is different from the variable's creation state (meaning unrolls are possible) in the current typer state.

Attributes

creatorState

the typer state in which the variable was created.

initNestingLevel

the initial nesting level of the type variable. (c.f. nestingLevel)

origin

the parameter that's tracked by the type variable.

Companion:
object
Graph
Supertypes
trait ValueType
trait TermType
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
object TypeVar

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
TypeVar.type
abstract class UncachedGroundType extends Type

Instances of this class are uncached and are not proxies.

Instances of this class are uncached and are not proxies.

Attributes

Graph
Supertypes
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
abstract class UncachedProxyType extends TypeProxy

Instances of this class are uncached and are proxies.

Instances of this class are uncached and are proxies.

Attributes

Graph
Supertypes
class TypeProxy
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
class LazyRef

Attributes

Graph
Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Self type

A marker trait for types that can be types of values or that are higher-kinded

A marker trait for types that can be types of values or that are higher-kinded

Attributes

Graph
Supertypes
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes

A marker trait for types that can be types of values or prototypes of value types

A marker trait for types that can be types of values or prototypes of value types

Attributes

Graph
Supertypes
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
abstract class VariantTraversal

Common base class of TypeMap and TypeAccumulator

Common base class of TypeMap and TypeAccumulator

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
abstract case class WildcardType(optBounds: Type) extends CachedGroundType with TermType

Wildcard type, possibly with bounds

Wildcard type, possibly with bounds

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Known subtypes
object WildcardType extends WildcardType

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Equals
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Self type

A filter for names of deferred term definitions of a given type

A filter for names of deferred term definitions of a given type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

A filter for names of abstract types of a given type

A filter for names of abstract types of a given type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object fieldFilter extends NameFilter

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object implicitFilter extends NameFilter

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
trait (Boolean, Type) => Boolean
class Object
trait Matchable
class Any

A filter for names of abstract types of a given type

A filter for names of abstract types of a given type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object takeAllFilter extends NameFilter

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

A filter for names of type aliases of a given type

A filter for names of type aliases of a given type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object typeNameFilter extends NameFilter

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def isWatched(tp: Type)(using Context): Boolean

Concrete fields

Extensions

Extensions

extension (tps1: List[Type])

Implicits

Implicits

implicit def eqType: CanEqual[Type, Type]