The erasure |T| of a type T. This is:
- For a refined type scala.Array+[T]:
- if T is Nothing or Null, Object
- otherwise, if T <: Object, |T|
- otherwise, if T is a type paramter coming from Java, Object
- otherwise, Object
- For a term ref p.x, the type
- For a typeref scala.Any, scala.AnyVal or scala.Singleton: |java.lang.Object|
- For a typeref scala.Unit, |scala.runtime.BoxedUnit|.
- For a typeref scala.FunctionN, where N > MaxImplementedFunctionArity, scala.FunctionXXL
- For a typeref scala.ImplicitFunctionN, | scala.FunctionN |
- For a typeref P.C where C refers to a class,
- For a typeref P.C where C refers to an alias type, the erasure of C's alias.
- For a typeref P.C where C refers to an abstract type, the erasure of C's upper bound.
- For a this-type C.this, the type itself.
- For all other type proxies: The erasure of the underlying type.
- For T1 & T2, the erased glb of |T1| and |T2| (see erasedGlb)
- For T1 | T2, the first base class in the linearization of T which is also a base class of T2
- For => T, ()T
- For a method type (Fs)scala.Unit, (|Fs|)scala.Unit.
- For any other uncurried method type (Fs)T, (|Fs|)|T|.
- For a curried method type (Fs1)(Fs2)T, (|Fs1|,Es2)ET where (Es2)ET = |(Fs2)T|.
- For a polymorphic type TsT, |(Ps)T| _ For a polymorphic type [Ts]T where T is not a method type, ()|T|
- For the class info type of java.lang.Object, the same type without any parents.
- For a class info type of a value class, the same type without any parents.
- For any other class info type with parents Ps, the same type with parents |Ps|, but with duplicate references of Object removed.
- For NoType or NoPrefix, the type itself.
- For any other type, exception.
The erasure of a symbol's info. This is different from
apply in the way
PolyTypes are treated.
eraseInfo maps them them to method types, whereas
apply maps them
to the underlying type.
The erasure of a function result type.
The name of the type as it is used in
Need to ensure correspondence with erasure!