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
Members list
Type members
Classlikes
Attributes
- Graph
- Supertypes
- class ErasedValueTypetrait Serializabletrait Producttrait Equalstrait ValueTypetrait ValueTypeOrPrototrait TermTypeclass CachedGroundTypetrait CachedTypeclass Typetrait Showabletrait Hashableclass Objecttrait Matchableclass Any
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).
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).
Attributes
- erasedUnderlying
The erased type of the single field of the value class
- tycon
A TypeRef referring to the value class symbol
- Companion:
- object
- Graph
- Supertypes
- trait Serializabletrait Producttrait Equalstrait ValueTypetrait ValueTypeOrPrototrait TermTypeclass CachedGroundTypetrait CachedTypeclass Typetrait Showabletrait Hashableclass Objecttrait Matchableclass Any
- Known subtypes
- class CachedErasedValueType
Attributes
- Companion:
- class
- Graph
- Supertypes
- Self type
- ErasedValueType.type
Value members
Concrete methods
The erasure of PolyFunction { def apply: $applyInfo }
The erasure of PolyFunction { def apply: $applyInfo }
Attributes
The erased greatest lower bound of two erased type picks one of the two argument types.
The erased greatest lower bound of two erased type picks one of the two argument types.
This operation has the following the properties:
- Associativity and commutativity, because this method acts as the minimum
of the total order induced by
compareErasedGlb
.
Attributes
Overload of erasedGlb
to compare more than two types at once.
Overload of erasedGlb
to compare more than two types at once.
Attributes
The erased least upper bound of two erased types is computed as follows
The erased least upper bound of two erased types is computed as follows
- if both argument are arrays of objects, an array of the erased 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, which leads to more predictable bytecode and (?) faster dynamic dispatch.
Attributes
The erasure of a top-level reference. Differs from normal erasure in that TermRefs are kept instead of being widened away.
The erasure of a top-level reference. Differs from normal erasure in that TermRefs are kept instead of being widened away.
Attributes
The standard erasure of a Scala type. Value classes are erased as normal classes.
The standard erasure of a Scala type. Value classes are erased as normal classes.
Attributes
- tp
The type to erase.
Like value class erasure, but value classes erase to their underlying type erasure
Like value class erasure, but value classes erase to their underlying type erasure
Attributes
Does the (possibly generic) type tp
have the same erasure in all its
possible instantiations?
Does the (possibly generic) type tp
have the same erasure in all its
possible instantiations?
Attributes
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).
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).
Attributes
Is tp
an abstract type or polymorphic type parameter, or another unbounded generic type?
Is tp
an abstract type or polymorphic type parameter, or another unbounded generic type?
Attributes
Is Array[tp]
a generic Array that needs to be erased to Object
?
This is true if among the subtypes of Array[tp]
there is either:
Is Array[tp]
a generic Array that needs to be erased to Object
?
This is true if among the subtypes of Array[tp]
there is either:
- both a reference array type and a primitive array type
(e.g.
Array[_ <: Int | String]
,Array[_ <: Any]
) - or two different primitive array types (e.g.
Array[_ <: Int | Double]
) In both cases the erased lub of those array types on the JVM isObject
.
In addition, if isScala2
is true, we mimic the Scala 2 erasure rules and
also return true for element types upper-bounded by a non-reference type
such as in Array[_ <: Int]
or Array[_ <: UniversalTrait]
.
Attributes
The current context with a phase no later than erasure
The current context with a phase no later than erasure
Attributes
The erasure that Scala 2 would use for this type.
The erasure that Scala 2 would use for this type.
Attributes
The symbol's erased info. This is the type's erasure, except for the following symbols:
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 : = ?
sourceLanguage
, isConstructor
and semiEraseVCs
are set based on the symbol.
Attributes
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).
Attributes
- tp
The type to erase.