Dotty Documentation

0.4.0-bin-SNAPSHOT

object PhantomErasure

Phantom erasure erases:

  • Parameters/arguments are removed from the function definition/call in PhantomArgLift. If the evaluation of the phantom arguments may produce a side effect, these are evaluated and stored in local vals and then the non phantoms are used in the Apply. Phantom vals are then erased to val ev$i: ErasedPhantom = myPhantom intended to be optimized away by local optimizations. myPhantom could be a reference to a phantom parameter, a call to Phantom assume or a call to a method that returns a phantom.
  • Definitions of def, val, lazy val and var returning a phantom type to return a ErasedPhantom. Where fields with ErasedPhantom type are not memoized (see transform/Memoize.scala).
  • Calls to Phantom.assume become calls to ErasedPhantom.UNIT. Intended to be optimized away by local optimizations.

[-] Constructors

[-] Members

[+] def erasedAssume ( implicit ctx: Context ) : Tree

Returns the default erased tree for a call to Phantom.assume

[+] def erasedParameterRef ( implicit ctx: Context ) : Tree

Returns the default erased tree for a phantom parameter ref

[+] def erasedPhantomType ( implicit ctx: Context ) : Type

Returns the default erased type of a phantom type