dotty.tools.dotc.core

TypeApplications

Related Docs: object TypeApplications | package core

final class TypeApplications extends AnyVal

A decorator that provides methods for modeling type application

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TypeApplications
  2. AnyVal
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TypeApplications(self: Type)

Value Members

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

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

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

    Definition Classes
    Any
  4. def EtaExpand(tparams: List[TypeSymbol])(implicit ctx: Context): Type

    Convert a type constructor TC which has type parameters T1, ..., Tn in a context where type parameters U1,...,Un are expected to

    Convert a type constructor TC which has type parameters T1, ..., Tn in a context where type parameters U1,...,Un are expected to

    LambdaXYZ { Apply = TC[hk$0, ..., hk$n] }

    Here, XYZ corresponds to the variances of

    • U1,...,Un if the variances of T1,...,Tn are pairwise compatible with U1,...,Un,
    • T1,...,Tn otherwise. v1 is compatible with v2, if v1 = v2 or v2 is non-variant.
  5. def EtaExpandIfHK(bound: Type)(implicit ctx: Context): Type

    Eta expand if self is a (non-lambda) class reference and bound is a higher-kinded type

  6. def LambdaAbstract(tparams: List[TypeParamInfo])(implicit ctx: Context): Type

    Lambda abstract self with given type parameters.

    Lambda abstract self with given type parameters. Examples:

    type T[X] = U becomes type T = [X] -> U type T[X] >: L <: U becomes type T >: L <: ([X] -> U)

    TODO: Handle parameterized lower bounds

  7. def adaptHkVariances(bound: Type)(implicit ctx: Context): Type

    If argument A and type parameter P are higher-kinded, adapt the variances of A to those of P, ensuring that the variances of the type lambda A agree with the variances of corresponding higher-kinded type parameters of P.

    If argument A and type parameter P are higher-kinded, adapt the variances of A to those of P, ensuring that the variances of the type lambda A agree with the variances of corresponding higher-kinded type parameters of P. Example:

    class GenericCompanion[+CC[X]] GenericCompanion[List]

    with adaptHkVariances, the argument List will expand to

    [X] => List[X]

    instead of

    [+X] => List[X]

    even though List is covariant. This adaptation is necessary to ignore conflicting variances in overriding members that have types of hk-type parameters such as GenericCompanion[GenTraversable] or GenericCompanion[ListBuffer]. When checking overriding, we need to validate the subtype relationship

    GenericCompanion-> ListBuffer[X <: GenericCompanion-> GenTraversable[X

    Without adaptation, this would be false, and hence an overriding error would result. But with adaptation, the rhs argument will be adapted to

    [X] -> GenTraversable[X]

    which makes the subtype test succeed. The crucial point here is that, since GenericCompanion only expects a non-variant CC, the fact that GenTraversable is covariant is irrelevant, so can be ignored.

  8. final def appliedTo(arg1: Type, arg2: Type)(implicit ctx: Context): Type

  9. final def appliedTo(arg: Type)(implicit ctx: Context): Type

  10. final def appliedTo(args: List[Type])(implicit ctx: Context): Type

    The type representing

    The type representing

    T[U1, ..., Un]

    where

    args

    U1,...,Un

  11. final def applyIfParameterized(args: List[Type])(implicit ctx: Context): Type

  12. final def argInfo(implicit ctx: Context): Type

    If this is the image of a type argument; recover the type argument, otherwise NoType.

  13. final def argInfos(implicit ctx: Context): List[Type]

    If this is an encoding of a (partially) applied type, return its arguments, otherwise return Nil.

    If this is an encoding of a (partially) applied type, return its arguments, otherwise return Nil. Existential types in arguments are returned as TypeBounds instances.

  14. def argTypes(implicit ctx: Context): List[Type]

    Argument types where existential types in arguments are disallowed

  15. def argTypesHi(implicit ctx: Context): List[Type]

    Argument types where existential types in arguments are approximated by their upper bound

  16. def argTypesLo(implicit ctx: Context): List[Type]

    Argument types where existential types in arguments are approximated by their lower bound

  17. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  18. final def baseArgInfos(base: Symbol)(implicit ctx: Context): List[Type]

    The type arguments of this type's base type instance wrt.

    The type arguments of this type's base type instance wrt. base. Existential types in arguments are returned as TypeBounds instances.

  19. final def baseArgTypes(base: Symbol)(implicit ctx: Context): List[Type]

    The type arguments of this type's base type instance wrt.base.

    The type arguments of this type's base type instance wrt.base. Existential types in arguments are disallowed.

  20. final def baseArgTypesHi(base: Symbol)(implicit ctx: Context): List[Type]

    The type arguments of this type's base type instance wrt.base.

    The type arguments of this type's base type instance wrt.base. Existential types in arguments are approximated by their upper bound.

  21. final def baseArgTypesLo(base: Symbol)(implicit ctx: Context): List[Type]

    The type arguments of this type's base type instance wrt.base.

    The type arguments of this type's base type instance wrt.base. Existential types in arguments are approximated by their lower bound.

  22. final def baseTypeWithArgs(base: Symbol)(implicit ctx: Context): Type

    The base type including all type arguments and applicable refinements of this type.

    The base type including all type arguments and applicable refinements of this type. Refinements are applicable if they refine a member of the parent type which furthermore is not a name-mangled type parameter. Existential types in arguments are returned as TypeBounds instances.

  23. def dropAlias(implicit ctx: Context): Type

    If this is a type alias, its underlying type, otherwise the type itself

  24. def elemType(implicit ctx: Context): Type

    The element type of a sequence or array

  25. def ensureHK(implicit ctx: Context): Type

    If self is not higher-kinded, eta expand it.

  26. def getClass(): Class[_ <: AnyVal]

    Definition Classes
    AnyVal → Any
  27. final def hkTypeParams(implicit ctx: Context): List[TypeParamInfo]

    If self is a higher-kinded type, its type parameters, otherwise Nil

  28. def isHK(implicit ctx: Context): Boolean

    Is self type higher-kinded (i.e.

    Is self type higher-kinded (i.e. of kind != "*")?

  29. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  30. final def namedTypeParams(implicit ctx: Context): Set[TypeSymbol]

    The named type parameters declared or inherited by this type.

    The named type parameters declared or inherited by this type. These are all uninstantiated named type parameters of this type or one of its base types.

  31. final def safeAppliedTo(args: List[Type])(implicit ctx: Context): Type

    A cycle-safe version of appliedTo where computing type parameters do not force the typeconstructor.

    A cycle-safe version of appliedTo where computing type parameters do not force the typeconstructor. Instead, if the type constructor is completing, we make up hk type parameters matching the arguments. This is needed when unpickling Scala2 files such as scala.collection.generic.Mapfactory.

  32. def safeDealias(implicit ctx: Context): Type

    Dealias type if it can be done without forcing the TypeRef's info

  33. val self: Type

  34. final def toBounds(tparam: TypeParamInfo)(implicit ctx: Context): TypeBounds

    Turn this type, which is used as an argument for type parameter tparam, into a TypeBounds RHS

  35. def toString(): String

    Definition Classes
    Any
  36. def translateParameterized(from: ClassSymbol, to: ClassSymbol)(implicit ctx: Context): Type

    Translate a type of the form From[T] to To[T], keep other types as they are.

    Translate a type of the form From[T] to To[T], keep other types as they are. from and to must be static classes, both with one type parameter, and the same variance. Do the same for by name types => From[T] and => To[T]

  37. final def typeParamSymbols(implicit ctx: Context): List[TypeSymbol]

    If self is a generic class, its type parameter symbols, otherwise Nil

  38. final def typeParams(implicit ctx: Context): List[TypeParamInfo]

    The type parameters of this type are: For a ClassInfo type, the type parameters of its class.

    The type parameters of this type are: For a ClassInfo type, the type parameters of its class. For a typeref referring to a class, the type parameters of the class. For a typeref referring to a Lambda class, the type parameters of its right hand side or upper bound. For a refinement type, the type parameters of its parent, dropping any type parameter that is-rebound by the refinement. "Re-bind" means: The refinement contains a TypeAlias for the type parameter, or it introduces bounds for the type parameter, and we are not in the special case of a type Lambda, where a LambdaTrait gets refined with the bounds on its hk args. See LambdaAbstract, where these types get introduced, and see isBoundedLambda below for the test.

  39. def underlyingIfRepeated(isJava: Boolean)(implicit ctx: Context): Type

    If this is repeated parameter type, its underlying Seq type, or, if isJava is true, Array type, else the type itself.

  40. final def widenToNamedTypeParams(params: Set[TypeSymbol])(implicit ctx: Context): Type

    The smallest supertype of this type that instantiated none of the named type parameters in params.

    The smallest supertype of this type that instantiated none of the named type parameters in params. That is, for each named type parameter p in params, either there is no type field named p in this type, or p is a named type parameter of this type. The first case is important for the recursive case of AndTypes, because some of their operands might be missing the named parameter altogether, but the AndType as a whole can still contain it.

  41. final def withoutArgs(typeArgs: List[Type]): Type

    The core type without any type arguments.

Inherited from AnyVal

Inherited from Any

Ungrouped