dotty.tools.dotc.core

TypeErasure

Related Docs: class TypeErasure | package core

object TypeErasure

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, PolyParam, TypeBounds

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

Type Members

  1. final class CachedErasedValueType extends ErasedValueType

  2. abstract case class ErasedValueType(tycon: TypeRef, erasedUnderlying: Type) extends CachedGroundType with ValueType with Product with Serializable

    A type representing the semi-erasure of a derived value class, see SIP-15 where it's called "C$unboxed" for a class C.

    A type representing the semi-erasure of a derived value class, see SIP-15 where it's called "C$unboxed" for a class C. Derived value classes are erased to this type during Erasure (when semiEraseVCs = true) and subsequently erased to their underlying type during ElimErasedValueType. This type is outside the normal Scala class hierarchy: it is a subtype of no other type and is a supertype only of Nothing. This is because this type is only useful for type adaptation (see Erasure.Boxing#adaptToType).

    tycon

    A TypeRef referring to the value class symbol

    erasedUnderlying

    The erased type of the single field of the value class

Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. object ErasedValueType extends Serializable

  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  9. def erasedGlb(tp1: Type, tp2: Type, isJava: Boolean)(implicit ctx: Context): Type

    The erased greatest lower bound picks one of the two argument types.

    The erased greatest lower bound picks one of the two argument types. It prefers, in this order:

    • arrays over non-arrays
    • subtypes over supertypes, unless isJava is set
    • real classes over traits
  10. def erasedLub(tp1: Type, tp2: Type)(implicit ctx: Context): Type

    The erased least upper bound is computed as follows

    The erased least upper bound is computed as follows

    • if both argument are arrays of objects, an array of the lub of the element types
    • if both arguments are arrays of same primitives, an array of this primitive
    • if one argument is array of primitives and the other is array of objects, Object
    • if one argument is an array, Object
    • otherwise a common superclass or trait S of the argument classes, with the following two properties: S is minimal: no other common superclass or trait derives from S] S is last : in the linearization of the first argument type tp1 there are no minimal common superclasses or traits that come after S. (the reason to pick last is that we prefer classes over traits that way).
  11. def erasedRef(tp: Type)(implicit ctx: Context): Type

    The erasure of a top-level reference.

    The erasure of a top-level reference. Differs from normal erasure in that TermRefs are kept instead of being widened away.

  12. def erasure(tp: Type)(implicit ctx: Context): Type

    The standard erasure of a Scala type.

    The standard erasure of a Scala type. Value classes are erased as normal classes.

    tp

    The type to erase.

  13. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  15. def hasStableErasure(tp: Type)(implicit ctx: Context): Boolean

    Does the (possibly generic) type tp have the same erasure in all its possible instantiations?

  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. def isErasedType(tp: Type)(implicit ctx: Context): Boolean

    A predicate that tests whether a type is a legal erased type.

    A predicate that tests whether a type is a legal erased type. Only asInstanceOf and isInstanceOf may have types that do not satisfy the predicate. ErasedValueType is considered an erased type because it is valid after Erasure (it is eliminated by ElimErasedValueType).

  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. def isUnboundedGeneric(tp: Type)(implicit ctx: Context): Boolean

    Is tp an abstract type or polymorphic type parameter that has Any, AnyVal, or a universal trait as upper bound and that is not Java defined? Arrays of such types are erased to Object instead of Object[].

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

    Definition Classes
    AnyRef
  21. final def notify(): Unit

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

    Definition Classes
    AnyRef
  23. def sigName(tp: Type, isJava: Boolean)(implicit ctx: Context): TypeName

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

    Definition Classes
    AnyRef
  25. def toString(): String

    Definition Classes
    AnyRef → Any
  26. def transformInfo(sym: Symbol, tp: Type)(implicit ctx: Context): Type

    The symbol's erased info.

    The symbol's erased info. This is the type's erasure, except for the following symbols:

    • For $asInstanceOf : [T]T
    • For $isInstanceOf : [T]Boolean
    • For all abstract types : = ?
    • For companion methods : the erasure of their type with semiEraseVCs = false. The signature of these methods are used to keep a link between companions and should not be semi-erased.
    • For Java-defined symbols: : the erasure of their type with isJava = true, semiEraseVCs = false. Semi-erasure never happens in Java.
    • For all other symbols : the semi-erasure of their types, with isJava, isConstructor set according to symbol.
  27. def valueErasure(tp: Type)(implicit ctx: Context): Type

    The value class erasure of a Scala type, where value classes are semi-erased to ErasedValueType (they will be fully erased in ElimErasedValueType).

    The value class erasure of a Scala type, where value classes are semi-erased to ErasedValueType (they will be fully erased in ElimErasedValueType).

    tp

    The type to erase.

  28. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped