File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -206,8 +206,8 @@ class CrossStageSafety extends TreeMapWithStages {
206206 * The tag is generated by an instance of `QuoteTypeTags` directly if the splice is explicit
207207 * or indirectly by `tryHeal`.
208208 */
209- protected def healType (pos : SrcPos )(using Context ) =
210- new HealType (pos)
209+ protected def healType (pos : SrcPos )(tpe : Type )( using Context ) =
210+ new HealType (pos).apply(tpe)
211211
212212 /** Check level consistency of terms references */
213213 private def checkLevelConsistency (tree : Ident | This )(using Context ): Unit =
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ class HealType(pos: SrcPos)(using Context) extends TypeMap {
5151 if level == 0 then tp else getQuoteTypeTags.getTagRef(prefix)
5252 case _ : NamedType | _ : ThisType | NoPrefix =>
5353 if levelInconsistentRootOfPath(tp).exists then
54- tryHeal(tp.symbol, tp, pos )
54+ tryHeal(tp)
5555 else
5656 tp
5757 case _ =>
@@ -82,7 +82,7 @@ class HealType(pos: SrcPos)(using Context) extends TypeMap {
8282 * reference to a type alias containing the equivalent of `${summon[quoted.Type[T]]}`.
8383 * Emits an error if `T` cannot be healed and returns `T`.
8484 */
85- protected def tryHeal (sym : Symbol , tp : TypeRef , pos : SrcPos ): Type = {
85+ protected def tryHeal (tp : TypeRef ): Type = {
8686 val reqType = defn.QuotedTypeClass .typeRef.appliedTo(tp)
8787 val tag = ctx.typer.inferImplicitArg(reqType, pos.span)
8888 tag.tpe match
Original file line number Diff line number Diff line change @@ -36,8 +36,9 @@ class Staging extends MacroTransform {
3636 tree match {
3737 case PackageDef (pid, _) if tree.symbol.owner == defn.RootClass =>
3838 val checker = new CrossStageSafety {
39- override protected def healType (pos : SrcPos )(using Context ) = new HealType (pos) {
40- override protected def tryHeal (sym : Symbol , tp : TypeRef , pos : SrcPos ): TypeRef = {
39+ override protected def healType (pos : SrcPos )(tpe : Type )(using Context ) = new HealType (pos) {
40+ override protected def tryHeal (tp : TypeRef ): TypeRef = {
41+ val sym = tp.symbol
4142 def symStr =
4243 if (sym.is(ModuleClass )) sym.sourceModule.show
4344 else i " ${sym.name}.this "
@@ -51,7 +52,7 @@ class Staging extends MacroTransform {
5152
5253 tp
5354 }
54- }
55+ }.apply(tpe)
5556 }
5657 checker.transform(tree)
5758 case _ =>
You can’t perform that action at this time.
0 commit comments