From 08d07bb658c06c8b6c11a17f659f9096e12ce304 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Sat, 6 Jul 2024 12:16:46 +0200 Subject: [PATCH] Specialize the printer in TreeChecker [Cherry-picked bdbf2058fd13ecf538d480bdbea68df37722db92][modified] --- compiler/src/dotty/tools/dotc/transform/TreeChecker.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala index b10ed64e6d5a..d18ffcd252d5 100644 --- a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala +++ b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala @@ -1,6 +1,7 @@ package dotty.tools.dotc package transform +import config.Printers.checks as printer import core.Names.Name import core.DenotTransformers.* import core.SymDenotations.* @@ -415,7 +416,7 @@ object TreeChecker { res catch case NonFatal(ex) if !ctx.run.enrichedErrorMessage => val treeStr = tree.show(using ctx.withPhase(ctx.phase.prev.megaPhase)) - println(ctx.run.enrichErrorMessage(s"exception while retyping $treeStr of class ${tree.className} # ${tree.uniqueId}")) + printer.println(ctx.run.enrichErrorMessage(s"exception while retyping $treeStr of class ${tree.className} # ${tree.uniqueId}")) throw ex } @@ -782,7 +783,7 @@ object TreeChecker { // We want make sure that transparent inline macros are checked in the same way that // non transparent macros are, so we try to prepare a context which would make // the checks behave the same way for both types of macros. - // + // // E.g. Different instances of skolem types are by definition not able to be a subtype of // one another, however in practice this is only upheld during typer phase, and we do not want // it to be upheld during this check.