Skip to content

Commit 99c19a7

Browse files
authored
Fix #20211 (#20220)
2 parents 75f38b5 + bdbf205 commit 99c19a7

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package dotty.tools
22
package dotc
33
package transform
44

5+
import config.Printers.checks as printer
56
import core.Names.Name
67
import core.DenotTransformers.*
78
import core.SymDenotations.*
@@ -445,7 +446,7 @@ object TreeChecker {
445446
res
446447
catch case NonFatal(ex) if !ctx.run.enrichedErrorMessage =>
447448
val treeStr = tree.show(using ctx.withPhase(ctx.phase.prev.megaPhase))
448-
println(ctx.run.enrichErrorMessage(s"exception while retyping $treeStr of class ${tree.className} # ${tree.uniqueId}"))
449+
printer.println(ctx.run.enrichErrorMessage(s"exception while retyping $treeStr of class ${tree.className} # ${tree.uniqueId}"))
449450
throw ex
450451
}
451452

@@ -844,7 +845,7 @@ object TreeChecker {
844845
// We want make sure that transparent inline macros are checked in the same way that
845846
// non transparent macros are, so we try to prepare a context which would make
846847
// the checks behave the same way for both types of macros.
847-
//
848+
//
848849
// E.g. Different instances of skolem types are by definition not able to be a subtype of
849850
// one another, however in practice this is only upheld during typer phase, and we do not want
850851
// it to be upheld during this check.

tests/neg-macros/i19842-a.check

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
|Parents in tree: [trait Serializer]
99
|
1010
| at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
11-
| at dotty.tools.dotc.transform.TreeChecker$.checkParents(TreeChecker.scala:209)
11+
| at dotty.tools.dotc.transform.TreeChecker$.checkParents(TreeChecker.scala:210)
1212
| at scala.quoted.runtime.impl.QuotesImpl$reflect$ClassDef$.module(QuotesImpl.scala:257)
1313
| at scala.quoted.runtime.impl.QuotesImpl$reflect$ClassDef$.module(QuotesImpl.scala:256)
1414
| at Macros$.makeSerializer(Macro.scala:25)

tests/neg-macros/i19842-b.check

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
|Parents in tree: [class Object, trait Serializer, trait Foo]
99
|
1010
| at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
11-
| at dotty.tools.dotc.transform.TreeChecker$.checkParents(TreeChecker.scala:209)
11+
| at dotty.tools.dotc.transform.TreeChecker$.checkParents(TreeChecker.scala:210)
1212
| at scala.quoted.runtime.impl.QuotesImpl$reflect$ClassDef$.module(QuotesImpl.scala:257)
1313
| at scala.quoted.runtime.impl.QuotesImpl$reflect$ClassDef$.module(QuotesImpl.scala:256)
1414
| at Macros$.makeSerializer(Macro.scala:27)

0 commit comments

Comments
 (0)