Skip to content

Commit aa1c363

Browse files
committed
Print more cyclic reference traces in -Ydebug mode
Previously cyclic references arising from cyclicity checking were not printed. Now we print them as well if -Ydebug is on. This gives us better insight into why a cyclic test fails.
1 parent b579fc5 commit aa1c363

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/core/TypeErrors.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ class CyclicReference private (val denot: SymDenotation) extends TypeError {
154154
object CyclicReference {
155155
def apply(denot: SymDenotation)(implicit ctx: Context): CyclicReference = {
156156
val ex = new CyclicReference(denot)
157-
if (!(ctx.mode is Mode.CheckCyclic)) {
158-
cyclicErrors.println(s"Cyclic reference involving $denot")
157+
if (!(ctx.mode is Mode.CheckCyclic) || ctx.settings.Ydebug.value) {
158+
cyclicErrors.println(s"Cyclic reference involving! $denot")
159159
for (elem <- ex.getStackTrace take 200)
160160
cyclicErrors.println(elem.toString)
161161
}

0 commit comments

Comments
 (0)