Skip to content

Commit e1d31ec

Browse files
committed
Fix outdated comments
1 parent 26e5e0f commit e1d31ec

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import scala.annotation.constructorOnly
2828

2929
/** Checks that the Phase Consistency Principle (PCP) holds and heals types.
3030
*
31-
* Type healing consists in transforming a phase inconsistent type `T` into `implicitly[Type[T]].unary_~`.
31+
* Type healing consists in transforming a phase inconsistent type `T` into a splice of `implicitly[Type[T]]`.
3232
*/
3333
class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(ictx) {
3434
import tpd._
@@ -65,16 +65,16 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
6565
}
6666
else { // level 0 inside an inline definition
6767
ctx.error(
68-
"Malformed macro call. The contents of the $ must call a static method and arguments must be quoted or inline.",
68+
"Malformed macro call. The contents of the splice ${...} must call a static method and arguments must be quoted or inline.",
6969
splice.sourcePos)
7070
splice
7171
}
7272
}
7373
}
7474

7575

76-
/** Add cast to force boundaries where T and ~t (an alias of T) are used to ensure PCP.
77-
* '{ ~(...: T) } --> '{ ~(...: T).asInstanceOf[T] } --> '{ ~(...: T).asInstanceOf[~t] }
76+
/** Add cast to force boundaries where T and $t (an alias of T) are used to ensure PCP.
77+
* '{ ${...: T} } --> '{ ${...: T}.asInstanceOf[T] } --> '{ ${...: T}.asInstanceOf[$t] }
7878
*/
7979
protected def addSpliceCast(tree: Tree)(implicit ctx: Context): Tree = {
8080
val tp = checkType(tree.sourcePos).apply(tree.tpe.widenTermRefExpr)
@@ -86,7 +86,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
8686
* that are phase-incorrect can still be healed as follows:
8787
*
8888
* If `T` is a reference to a type at the wrong level, try to heal it by replacing it with
89-
* `~implicitly[quoted.Type[T]]`.
89+
* `${implicitly[quoted.Type[T]]}`.
9090
*/
9191
protected def checkLevel(tree: Tree)(implicit ctx: Context): Tree = {
9292
def checkTp(tp: Type): Type = checkType(tree.sourcePos).apply(tp)
@@ -144,7 +144,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
144144
* by which we refer to `sym`. If it is an inconsistent type try construct a healed type for it.
145145
*
146146
* @return `None` if the phase is correct or cannot be healed
147-
* `Some(tree)` with the `tree` of the healed type tree for `~implicitly[quoted.Type[T]]`
147+
* `Some(tree)` with the `tree` of the healed type tree for `${implicitly[quoted.Type[T]]}`
148148
*/
149149
private def checkSymLevel(sym: Symbol, tp: Type, pos: SourcePosition)(implicit ctx: Context): Option[Tree] = {
150150
val isThis = tp.isInstanceOf[ThisType]

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ object Splicer {
313313
protected final def interpretTree(tree: Tree)(implicit env: Env): Result = tree match {
314314
case Apply(TypeApply(fn, _), quoted :: Nil) if fn.symbol == defn.QuotedExpr_apply =>
315315
val quoted1 = quoted match {
316-
case quoted: Ident if quoted.symbol.is(InlineProxy) && quoted.symbol.is(MethodFlag) => // inline proxy for by-name parameter
316+
case quoted: Ident if quoted.symbol.is(InlineProxy) && quoted.symbol.is(MethodFlag) =>
317+
// inline proxy for by-name parameter
317318
quoted.symbol.defTree.asInstanceOf[DefDef].rhs
318319
case Inlined(EmptyTree, _, quoted) => quoted
319320
case _ => quoted

0 commit comments

Comments
 (0)