@@ -38,7 +38,7 @@ import scala.annotation.constructorOnly
38
38
*
39
39
* Type healing consists in transforming a phase inconsistent type `T` into a splice of `${summon[Type[T]]}`.
40
40
*
41
- * As references to types do not necessarely have an assosiated tree it is not always possible to replace the types in place .
41
+ * As references to types do not necessarily have an assosiated tree it is not always possible to replace the types directly .
42
42
* Instead we always generate a type alias for it and palce it at the start of the surounding quote. This also avoids duplication.
43
43
* For example:
44
44
* '{
@@ -80,7 +80,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
80
80
case tree1 => tree1
81
81
82
82
case _ : Ident | _ : This =>
83
- tree.withType(healTermType (tree.sourcePos)(tree.tpe))
83
+ tree.withType(healTypeOfTerm (tree.sourcePos)(tree.tpe))
84
84
85
85
// Remove inline defs in quoted code. Already fully inlined.
86
86
case tree : DefDef if tree.symbol.is(Inline ) && level > 0 =>
@@ -156,7 +156,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
156
156
private def healInfo (tree : Tree , pos : SourcePosition )(using Context ): Unit =
157
157
tree.symbol.info = healType(pos)(tree.symbol.info)
158
158
159
- /** If the refers to a locally defined symbol (either directly, or in a pickled type),
159
+ /** If the type refers to a locally defined symbol (either directly, or in a pickled type),
160
160
* check that its staging level matches the current level.
161
161
* - Static types and term are allowed at any level.
162
162
* - If a type reference is used a higher level, then it is insosistent. Will atempt to heal before failing.
@@ -177,7 +177,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
177
177
case prefix : ThisType if ! tp.symbol.isStatic && level > levelOf(prefix.cls) =>
178
178
tryHeal(tp.symbol, tp, pos)
179
179
case prefix : TermRef if tp.symbol.isSplice =>
180
- // Heal explice type splice in the code
180
+ // Heal explicit type splice in the code
181
181
if level > 0 then getQuoteTypeTags.getTagRef(prefix) else tp
182
182
case prefix : TermRef if ! prefix.symbol.isStatic && level > levelOf(prefix.symbol) =>
183
183
tryHeal(prefix.symbol, tp, pos)
@@ -193,7 +193,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
193
193
}
194
194
195
195
/** Check phase consistency of terms and heal incosistent type references. */
196
- private def healTermType (pos : SourcePosition )(using Context ) = new TypeMap {
196
+ private def healTypeOfTerm (pos : SourcePosition )(using Context ) = new TypeMap {
197
197
def apply (tp : Type ): Type =
198
198
tp match
199
199
case tp @ TypeRef (NoPrefix , _) if level > levelOf(tp.symbol) =>
0 commit comments