@@ -28,7 +28,7 @@ import scala.annotation.constructorOnly
28
28
29
29
/** Checks that the Phase Consistency Principle (PCP) holds and heals types.
30
30
*
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]]`.
32
32
*/
33
33
class PCPCheckAndHeal (@ constructorOnly ictx : Context ) extends TreeMapWithStages (ictx) {
34
34
import tpd ._
@@ -65,16 +65,16 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
65
65
}
66
66
else { // level 0 inside an inline definition
67
67
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." ,
69
69
splice.sourcePos)
70
70
splice
71
71
}
72
72
}
73
73
}
74
74
75
75
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] }
78
78
*/
79
79
protected def addSpliceCast (tree : Tree )(implicit ctx : Context ): Tree = {
80
80
val tp = checkType(tree.sourcePos).apply(tree.tpe.widenTermRefExpr)
@@ -86,7 +86,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
86
86
* that are phase-incorrect can still be healed as follows:
87
87
*
88
88
* 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]]} `.
90
90
*/
91
91
protected def checkLevel (tree : Tree )(implicit ctx : Context ): Tree = {
92
92
def checkTp (tp : Type ): Type = checkType(tree.sourcePos).apply(tp)
@@ -144,7 +144,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
144
144
* by which we refer to `sym`. If it is an inconsistent type try construct a healed type for it.
145
145
*
146
146
* @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]]} `
148
148
*/
149
149
private def checkSymLevel (sym : Symbol , tp : Type , pos : SourcePosition )(implicit ctx : Context ): Option [Tree ] = {
150
150
val isThis = tp.isInstanceOf [ThisType ]
0 commit comments