scala.tools.nsc.symtab

Types

trait Types extends Types

Self Type
SymbolTable
Source
Types.scala
Linear Supertypes
Types, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Types
  2. Types
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Type Members

  1. case class AnnotatedType(annotations: List[AnnotationInfo], underlying: Type, selfsym: Symbol) extends Type with RewrappingTypeProxy with Product with Serializable

    A type carrying some annotations.

  2. case class AntiPolyType(pre: Type, targs: List[Type]) extends Type with Product with Serializable

    A class remembering a type instantiation for some a set of overloaded polymorphic symbols.

  3. class AsSeenFromMap extends TypeMap

    A map to compute the asSeenFrom method

  4. case class BoundedWildcardType(bounds: TypeBounds) extends Type with Product with Serializable

  5. case class ClassInfoType(parents: List[Type], decls: Scope, typeSymbol: Symbol) extends CompoundType with Product with Serializable

    A class representing a class info

  6. abstract class CompoundType extends Type

    A common base class for intersection types and class types

  7. abstract case class ConstantType(value: Constant) extends SingletonType with Product with Serializable

    A class representing a constant type.

  8. class ContainsCollector extends TypeCollector[Boolean]

    A map to implement the contains' method

  9. class ContainsTypeCollector extends TypeCollector[Boolean]

    A map to implement the contains' method

  10. class ContainsVariantExistentialCollector extends TypeCollector[Boolean]

    A collector that tests for existential types appearing at given variance in a type

  11. case class ExistentialType(quantified: List[Symbol], underlying: Type) extends Type with RewrappingTypeProxy with Product with Serializable

    Definition Classes
    Types → Types
  12. class FilterTypeCollector extends TypeCollector[ListBuffer[Type]]

    A map to implement the filter' method

  13. class FindTypeCollector extends TypeCollector[Option[Type]]

    A map to implement the filter' method

  14. class ForEachTypeTraverser extends TypeTraverser

  15. class InstantiateDependentMap extends TypeMap

  16. class JavaMethodType extends MethodType

  17. abstract class LazyType extends Type with AbsLazyType

    A class representing an as-yet unevaluated type.

  18. class MalformedType extends TypeError

    A throwable signalling a malformed type

  19. case class MethodType(params: List[Symbol], resultType: Type) extends Type with Product with Serializable

    A class representing a method type with parameters.

  20. class MissingAliasControl extends Throwable with ControlThrowable

  21. class MissingTypeControl extends Throwable with ControlThrowable

  22. case class NamedType(name: Name, tp: Type) extends Type with Product with Serializable

    A class representing types with a name.

  23. class NoCommonType extends Throwable with ControlThrowable

  24. case class NotNullType(underlying: Type) extends SubType with RewrappingTypeProxy with Product with Serializable

  25. case class NullaryMethodType(resultType: Type) extends Type with Product with Serializable

    Definition Classes
    Types → Types
  26. case class OverloadedType(pre: Type, alternatives: List[Symbol]) extends Type with Product with Serializable

    A class containing the alternatives and type prefix of an overloaded symbol.

  27. class PackageClassInfoType extends ClassInfoType

  28. case class PolyType(typeParams: List[Symbol], resultType: Type) extends Type with Product with Serializable

    A type function or the type of a polymorphic value (and thus of kind *).

  29. case class RefinedType(parents: List[Type], decls: Scope) extends CompoundType with Product with Serializable

    A class representing intersection types with refinements of the form <parents_0> with ... with <parents_n> { decls }' Cannot be created directly; one should always use refinedType' for creation.

  30. final class RefinedType0 extends RefinedType

  31. trait RewrappingTypeProxy extends Type with SimpleTypeProxy

    A proxy for a type (identified by field underlying') that forwards most operations to it. Every operation that is overridden for some kind of types is forwarded here. Some operations are rewrapped again.

  32. trait SimpleTypeProxy extends Type

    A proxy for a type (identified by field underlying') that forwards most operations to it (for exceptions, see WrappingProxy, which forwards even more operations). every operation that is overridden for some kind of types should be forwarded.

  33. abstract case class SingleType(pre: Type, sym: Symbol) extends SingletonType with Product with Serializable

    A class for singleton types of the form <prefix>.

  34. abstract class SingletonType extends SubType with SimpleTypeProxy

    A base class for types that represent a single value (single-types and this-types).

  35. abstract class SubType extends Type

    A base class for types that defer some operations to their immediate supertype.

  36. class SubTypePair extends AnyRef

  37. abstract class SubstMap[T] extends TypeMap

    A base class to compute all substitutions

  38. class SubstSuperMap extends TypeMap

  39. class SubstSymMap extends SubstMap[Symbol]

    A map to implement the substSym' method.

  40. class SubstThisMap extends TypeMap

    A map to implement the substThis' method.

  41. class SubstTypeMap extends SubstMap[Type]

    A map to implement the subst' method.

  42. class SubstWildcardMap extends TypeMap

  43. abstract case class SuperType(thistpe: Type, supertpe: Type) extends SingletonType with Product with Serializable

    Definition Classes
    Types → Types
  44. abstract case class ThisType(sym: Symbol) extends SingletonType with Product with Serializable

    A class for this-types of the form <sym>.

  45. abstract class Type extends AbsType

    The base class for all types

  46. abstract case class TypeBounds(lo: Type, hi: Type) extends SubType with Product with Serializable

    A class for the bounds of abstract types and type parameters

  47. abstract class TypeCollector[T] extends TypeTraverser

  48. class TypeConstraint extends AnyRef

    A class expressing upper and lower bounds constraints of type variables, as well as their instantiations.

  49. class TypeError extends Throwable

    A throwable signalling a type error

  50. abstract class TypeMap extends (Type) ⇒ Type

    A prototype for mapping a function over all possible types

  51. abstract case class TypeRef(pre: Type, sym: Symbol, args: List[Type]) extends Type with Product with Serializable

    A class for named types of the form <prefix>.<sym.name>[args]' Cannot be created directly; one should always use typeRef' for creation.

  52. abstract class TypeTraverser extends TypeMap

  53. class TypeVar extends Type

    A class representing a type variable Not used after phase typer'. A higher-kinded type variable has type arguments (a list of Type's) and type parameters (list of Symbols) A TypeVar whose list of args is non-empty can only be instantiated by a higher-kinded type that can be applied to these args a typevar is much like a typeref, except it has special logic for type equality/subtyping

  54. final class UniqueConstantType extends ConstantType with UniqueType

  55. final class UniqueSingleType extends SingleType with UniqueType

  56. final class UniqueSuperType extends SuperType with UniqueType

  57. final class UniqueThisType extends ThisType with UniqueType

  58. trait UniqueType extends AnyRef

  59. final class UniqueTypeBounds extends TypeBounds with UniqueType

  60. final class UniqueTypeRef extends TypeRef with UniqueType

  61. class VarianceError extends TypeError

    An exception signalling a variance annotation/usage conflict

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object AnnotatedType extends AnnotatedTypeExtractor with Serializable

    Definition Classes
    Types → Types
  7. object ApproximateDependentMap extends TypeMap

  8. object ClassInfoType extends ClassInfoTypeExtractor with Serializable

    Definition Classes
    Types → Types
  9. object ConstantType extends ConstantTypeExtractor with Serializable

    Definition Classes
    Types → Types
  10. object ErroneousCollector extends TypeCollector[Boolean]

    A map to implement the contains' method

  11. object ErrorType extends Type with Product with Serializable

    An object representing an erroneous type

  12. object ExistentialType extends ExistentialTypeExtractor with Serializable

    Definition Classes
    Types → Types
  13. val GlbFailure: Throwable

  14. object IdentityTypeMap extends TypeMap

    A type map that always returns the input type unchanged

  15. object IsDependentCollector extends TypeCollector[Boolean]

  16. def JavaMethodType(params: List[Symbol], resultType: Type): JavaMethodType

    The canonical creator for implicit method types

  17. final val LubGlbMargin: Int(0)

  18. object MethodType extends MethodTypeExtractor with Serializable

    Definition Classes
    Types → Types
  19. object NoPrefix extends Type with Product with Serializable

    An object representing a non-existing prefix

  20. object NoType extends Type with Product with Serializable

    An object representing a non-existing type

  21. object NullaryMethodType extends NullaryMethodTypeExtractor with Serializable

    Definition Classes
    Types → Types
  22. object PolyType extends PolyTypeExtractor with Serializable

    Definition Classes
    Types → Types
  23. object RefinedType extends RefinedTypeExtractor with Serializable

    Definition Classes
    Types → Types
  24. object SingleType extends SingleTypeExtractor with Serializable

    Definition Classes
    Types → Types
  25. object StripAnnotationsMap extends TypeMap

  26. object SuperType extends SuperTypeExtractor with Serializable

    Definition Classes
    Types → Types
  27. object ThisType extends ThisTypeExtractor with Serializable

    Definition Classes
    Types → Types
  28. object TypeBounds extends TypeBoundsExtractor with Serializable

    Definition Classes
    Types → Types
  29. object TypeRef extends TypeRefExtractor with Serializable

    Definition Classes
    Types → Types
  30. object TypeVar extends AnyRef

  31. object WildcardType extends Type with Product with Serializable

    An object representing an unknown type, used during type inference.

  32. object adaptToNewRunMap extends TypeMap

  33. def addMember(thistp: Type, tp: Type, sym: Symbol): Unit

    Make symbol sym' a member of scope tp.

    Make symbol sym' a member of scope tp.decls' where thistp' is the narrowed owner type of the scope.

  34. def appliedType(tycon: Type, args: List[Type]): Type

    A creator for type applications

  35. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  36. def beginsWithTypeVarOrIsRefined(tp: Type): Boolean

    Does this type have a prefix that begins with a type variable, or is it a refinement type? For type prefixes that fulfil this condition, type selections with the same name of equal (wrt) =:= prefixes are considered equal wrt =:=

  37. def checkKindBounds0(tparams: List[Symbol], targs: List[Type], pre: Type, owner: Symbol, explainErrors: Boolean): List[(Type, Symbol, List[(Symbol, Symbol)], List[(Symbol, Symbol)], List[(Symbol, Symbol)])]

    Check well-kindedness of type application (assumes arities are already checked) -- @M

    Check well-kindedness of type application (assumes arities are already checked) -- @M

    This check is also performed when abstract type members become concrete (aka a "type alias") -- then tparams.length==1 (checked one type member at a time -- in that case, prefix is the name of the type alias)

    Type application is just like value application: it's "contravariant" in the sense that the type parameters of the supplied type arguments must conform to the type parameters of the required type parameters:

    • their bounds must be less strict
    • variances must match (here, variances are absolute, the variance of a type parameter does not influence the variance of its higher-order parameters)
    • @M TODO: are these conditions correct,sufficient&necessary?

    e.g. class Iterable[t, m[+x <: t]] --> the application Iterable[Int, List] is okay, since List's type parameter is also covariant and its bounds are weaker than <: Int

  38. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  39. object commonOwnerMap extends TypeMap

    A map to compute the most deeply nested owner that contains all the symbols of thistype or prefixless typerefs/singletype occurrences in given type.

  40. final def compareLengths(xs1: List[_], xs2: List[_]): Int

    Annotations
    @tailrec()
  41. val containsContravariantExistentialCollector: ContainsVariantExistentialCollector

  42. val containsCovariantExistentialCollector: ContainsVariantExistentialCollector

  43. def copyMethodType(tp: Type, params: List[Symbol], restpe: Type): Type

    Create a new MethodType of the same class as tp, i.

    Create a new MethodType of the same class as tp, i.e. keep JavaMethodType

  44. def copyRefinedType(original: RefinedType, parents: List[Type], decls: Scope): Type

  45. def copyTypeRef(tp: Type, pre: Type, sym: Symbol, args: List[Type]): Type

  46. final def corresponds3[A, B, C](xs1: List[A], xs2: List[B], xs3: List[C], f: (A, B, C) ⇒ Boolean): Boolean

    True if all three arguments have the same number of elements and the function is true for all the triples.

    True if all three arguments have the same number of elements and the function is true for all the triples.

    Annotations
    @tailrec()
  47. object deAlias extends TypeMap

    Remove any occurrences of type aliases from this type

  48. def differentOrNone(tp1: Type, tp2: Type): Type

  49. object dropSingletonType extends TypeMap

    Remove any occurrence of type <singleton> from this type and its parents

  50. def elimAnonymousClass(t: Type): Type

  51. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  52. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  53. def existentialAbstraction(tparams: List[Symbol], tpe0: Type): Type

    A creator for existential types.

    A creator for existential types. This generates:

    tpe1 where { tparams }

    where tpe1' is the result of extrapolating tpe' wrt to tparams'. Extrapolating means that type variables in tparams' occurring in covariant positions are replaced by upper bounds, (minus any SingletonClass markers), type variables in tparams' occurring in contravariant positions are replaced by upper bounds, provided the resulting type is legal wrt to stability, and does not contain any type variable in tparams'. The abstraction drops all type parameters that are not directly or indirectly referenced by type tpe1'. If there are no remaining type parameters, simply returns result type tpe'.

  54. def explainTypes(op: (Type, Type) ⇒ Any, found: Type, required: Type): Unit

    If option explaintypes' is set, print a subtype trace for op(found, required)'.

  55. def explainTypes(found: Type, required: Type): Unit

    If option explaintypes' is set, print a subtype trace for found <:< required'.

  56. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  57. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  58. def glb(ts: List[Type]): Type

  59. final def hasLength(xs: List[_], len: Int): Boolean

    Again avoiding calling length, but the lengthCompare interface is clunky.

  60. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  61. def instTypeVar(tp: Type): Type

  62. def instantiatedBounds(pre: Type, owner: Symbol, tparams: List[Symbol], targs: List[Type]): List[TypeBounds]

  63. def intersectionType(tps: List[Type]): Type

    A creator for intersection type where intersections of a single type are replaced by the type itself.

  64. def intersectionType(tps: List[Type], owner: Symbol): Type

    A creator for intersection type where intersections of a single type are replaced by the type itself, and repeated parent classes are merged.

  65. val intersectionWitness: WeakHashMap[List[Type], WeakReference[Type]]

    A map from lists to compound types that have the given list as parents.

    A map from lists to compound types that have the given list as parents. This is used to avoid duplication in the computation of base type sequences and baseClasses. It makes use of the fact that these two operations depend only on the parents, not on the refinement.

  66. def isConstantType(tp: Type): Boolean

  67. def isDifferentType(tp1: Type, tp2: Type): Boolean

  68. def isDifferentTypeConstructor(tp1: Type, tp2: Type): Boolean

  69. def isErrorOrWildcard(tp: Type): Boolean

  70. def isHKSubType0(tp1: Type, tp2: Type, depth: Int): Boolean

  71. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  72. def isNumericSubType(tp1: Type, tp2: Type): Boolean

  73. def isPopulated(tp1: Type, tp2: Type): Boolean

    Is intersection of given types populated? That is, for all types tp1, tp2 in intersection for all common base classes bc of tp1 and tp2 let bt1, bt2 be the base types of tp1, tp2 relative to class bc Then: bt1 and bt2 have the same prefix, and any corresponding non-variant type arguments of bt1 and bt2 are the same

  74. def isRaw(sym: Symbol, args: List[Type]): Boolean

  75. def isRawType(tp: Type): Boolean

    Is type tp a raw type?

  76. def isSameType(tp1: Type, tp2: Type): Boolean

    Do tp1' and tp2' denote equivalent types?

  77. def isSameType2(tp1: Type, tp2: Type): Boolean

  78. def isSameTypes(tps1: List[Type], tps2: List[Type]): Boolean

    Are tps1' and tps2' lists of pairwise equivalent types?

  79. def isSingleType(tp: Type): Boolean

  80. def isSubArg(t1: Type, t2: Type, variance: Int): Boolean

  81. def isSubArgs(tps1: List[Type], tps2: List[Type], tparams: List[Symbol]): Boolean

  82. def isSubType(tp1: Type, tp2: Type, depth: Int): Boolean

  83. def isSubType(tp1: Type, tp2: Type): Boolean

  84. def isSubTypes(tps1: List[Type], tps2: List[Type]): Boolean

    Are tps1' and tps2' lists of equal length such that all elements of tps1' conform to corresponding elements of tps2'?

  85. def isWeakSubType(tp1: Type, tp2: Type): Boolean

  86. def isWithinBounds(pre: Type, owner: Symbol, tparams: List[Symbol], targs: List[Type]): Boolean

    Do type arguments targs' conform to formal parameters tparams'?

    Do type arguments targs' conform to formal parameters tparams'?

    tparams

    ...

    targs

    ...

    returns

    ...

  87. def kindsConform(tparams: List[Symbol], targs: List[Type], pre: Type, owner: Symbol): Boolean

  88. def lub(ts: List[Type], depth: Int): Type

    The least upper bound wrt <:< of a list of types

  89. def lub(ts: List[Type]): Type

  90. def lubDepth(ts: List[Type]): Int

    The maximum allowable depth of lubs or glbs over types ts' This is the maximum depth of all types in the base type sequences of each of the types ts', plus LubGlbMargin

  91. def map2Conserve[A <: AnyRef, B](xs: List[A], ys: List[B])(f: (A, B) ⇒ A): List[A]

    like map2, but returns list xs' itself - instead of a copy - if function f' maps all elements to themselves.

  92. final def matchesType(tp1: Type, tp2: Type, alwaysMatchSimple: Boolean): Boolean

    A function implementing tp1' matches tp2'

  93. final val maxTostringRecursions: Int(50)

    Definition Classes
    Types
  94. def mergePrefixAndArgs(tps: List[Type], variance: Int, depth: Int): Option[Type]

    Compute lub (if variance == 1) or glb (if variance == -1) of given list of types tps'. All types in tps' are typerefs or singletypes with the same symbol.

    Compute lub (if variance == 1) or glb (if variance == -1) of given list of types tps'. All types in tps' are typerefs or singletypes with the same symbol. Return Some(x)' if the computation succeeds with result x'. Return None' if the computation fails.

  95. val missingAliasException: MissingAliasControl

  96. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  97. def needsOuterTest(patType: Type, selType: Type, currentOwner: Symbol): Boolean

    Does a pattern of type patType' need an outer test when executed against selector type selType' in context defined by currentOwner'?

  98. def normalizePlus(tp: Type): Type

  99. final def notify(): Unit

    Definition Classes
    AnyRef
  100. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  101. def numericGlb(ts: List[Type]): Type

  102. def numericLub(ts: List[Type]): Type

  103. def objToAny(tp: Type): Type

  104. def polyType(tparams: List[Symbol], tpe: Type): Type

    A creator for type parameterizations that strips empty type parameter lists.

    A creator for type parameterizations that strips empty type parameter lists. Use this factory method to indicate the type has kind * (it's a polymorphic value) until we start tracking explicit kinds equivalent to typeFun (except that the latter requires tparams nonEmpty)

  105. object rawToExistential extends TypeMap

    The raw to existential map converts a raw type to an existential type. It is necessary because we might have read a raw type of a parameterized Java class from a class file. At the time we read the type the corresponding class file might still not be read, so we do not know what the type parameters of the type are. Therefore the conversion of raw types to existential types might not have taken place in ClassFileparser.sigToType (where it is usually done)

  106. def refinedType(parents: List[Type], owner: Symbol): Type

    The canonical creator for a refined type with an initially empty scope.

    The canonical creator for a refined type with an initially empty scope.

    parents

    ...

    owner

    ...

    returns

    ...

  107. def refinedType(parents: List[Type], owner: Symbol, decls: Scope, pos: Position): Type

    the canonical creator for a refined type with a given scope

  108. final def sameLength(xs1: List[_], xs2: List[_]): Boolean

    True if two lists have the same length.

    True if two lists have the same length. Since calling length on linear sequences is O(n), it is an inadvisable way to test length equality.

  109. val shorthands: Set[String]

  110. def singleType(pre: Type, sym: Symbol): Type

    The canonical creator for single-types

  111. def singletonBounds(hi: Type): TypeBounds

  112. var skolemizationLevel: Int

    The current skolemization level, needed for the algorithms in isSameType, isSubType that do constraint solving under a prefix

  113. def solve(tvars: List[TypeVar], tparams: List[Symbol], variances: List[Int], upper: Boolean, depth: Int): Boolean

  114. def solve(tvars: List[TypeVar], tparams: List[Symbol], variances: List[Int], upper: Boolean): Boolean

    Solve constraint collected in types tvars'.

    Solve constraint collected in types tvars'.

    tvars

    All type variables to be instantiated.

    tparams

    The type parameters corresponding to tvars'

    variances

    The variances of type parameters; need to reverse solution direction for all contravariant variables.

    upper

    When true' search for max solution else min.

  115. def spanningTypes(ts: List[Type]): List[Type]

    A minimal type list which has a given list of types as its base type sequence

  116. def specializesSym(tp: Type, sym: Symbol): Boolean

    Does type tp' implement symbol sym' with same or stronger type? Exact only if sym' is a member of some refinement type, otherwise we might return false negatives.

  117. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  118. def toString(): String

    Definition Classes
    AnyRef → Any
  119. def typeFun(tps: List[Symbol], body: Type): Type

    A creator for a type functions, assuming the type parameters tps already have the right owner

  120. def typeFunAnon(tps: List[Symbol], body: Type): Type

    A creator for anonymous type functions, where the symbol for the type function still needs to be created

    A creator for anonymous type functions, where the symbol for the type function still needs to be created

    TODO: type params of anonymous type functions, which currently can only arise from normalising type aliases, are owned by the type alias of which they are the eta-expansion higher-order subtyping expects eta-expansion of type constructors that arise from a class; here, the type params are owned by that class, but is that the right thing to do?

  121. def typeParamsToExistentials(clazz: Symbol, tparams: List[Symbol]): List[Symbol]

  122. def typeRef(pre: Type, sym: Symbol, args: List[Type]): Type

    The canonical creator for typerefs todo: see how we can clean this up a bit

  123. object typeVarToOriginMap extends TypeMap

    A map to convert every occurrence of a type variable to a wildcard type

  124. object undoLog extends AnyRef

    A log of type variable with their original constraints.

  125. def uniqueTypeCount: Int

  126. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  127. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  128. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  129. def weakGlb(ts: List[Type]): (Type, Boolean)

  130. def weakLub(ts: List[Type]): (Type, Boolean)

  131. object wildcardToTypeVarMap extends TypeMap

    A map to convert every occurrence of a wildcard type to a fresh type variable

  132. def withTypesExplained[A](op: ⇒ A): A

    Execute op' while printing a trace of the operations on types executed.

Inherited from Types

Inherited from AnyRef

Inherited from Any