File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,11 @@ import dotty.tools.dotc.core.Types.Type
77
88/** Phantom erasure erases (minimal erasure):
99 *
10- * - Parameters/arguments are erased to BoxedUnit . The next step will remove the parameters
10+ * - Parameters/arguments are erased to ErasedPhantom . The next step will remove the parameters
1111 * from the method definitions and calls (implemented in branch implement-phantom-types-part-2).
12- * - Definitions of `def`, `val`, `lazy val` and `var` returning a phantom type to return a BoxedUnit. Where fields
13- * with BoxedUnit type are not memoized (see transform/Memoize.scala).
14- * - Calls to Phantom.assume become calls to BoxedUnit. Intended to be optimized away by local optimizations.
15- *
16- * BoxedUnit is used as it fits perfectly and homogeneously in all locations where phantoms can be found.
17- * Additionally some of the optimizations that can be performed on phantom types can also be directly implemented
18- * on all boxed units.
12+ * - Definitions of `def`, `val`, `lazy val` and `var` returning a phantom type to return a ErasedPhantom. Where fields
13+ * with ErasedPhantom type are not memoized (see transform/Memoize.scala).
14+ * - Calls to Phantom.assume become calls to ErasedPhantom.UNIT. Intended to be optimized away by local optimizations.
1915 */
2016object PhantomErasure {
2117
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ import Decorators._
110110 else if (sym eq defn.BoxedUnitClass ) ref(defn.BoxedUnit_UNIT )
111111 else if (sym eq defn.ErasedPhantomClass ) ref(defn.ErasedPhantom_UNIT )
112112 else {
113- assert(false ) // Not in sync with isErasableBottomField
113+ assert(false , sym + " has no erased bottom tree " )
114114 EmptyTree
115115 }
116116 }
You can’t perform that action at this time.
0 commit comments