Skip to content

Commit 9e71741

Browse files
committed
Update doc
1 parent 6e07bcb commit 9e71741

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

compiler/src/dotty/tools/dotc/core/PhantomErasure.scala

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff 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
*/
2016
object PhantomErasure {
2117

compiler/src/dotty/tools/dotc/transform/Memoize.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)