Skip to content

Commit 795796d

Browse files
committed
CyclicError messages now go to printer
Have a configurable printer to which cyclic error messages are sent.
1 parent b33f604 commit 795796d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/dotty/tools/dotc/config/Printers.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ object Printers {
2727
val incremental = noPrinter
2828
val config = noPrinter
2929
val transforms = noPrinter
30+
val cyclicErrors = noPrinter
3031
}

src/dotty/tools/dotc/core/Types.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2864,7 +2864,11 @@ object Types {
28642864
object CyclicReference {
28652865
def apply(denot: SymDenotation)(implicit ctx: Context): CyclicReference = {
28662866
val ex = new CyclicReference(denot)
2867-
if (!(ctx.mode is typer.Mode.CheckCyclic)) ex.printStackTrace()
2867+
if (!(ctx.mode is typer.Mode.CheckCyclic)) {
2868+
cyclicErrors.println(ex.getMessage)
2869+
for (elem <- ex.getStackTrace take 40)
2870+
cyclicErrors.println(elem.toString)
2871+
}
28682872
ex
28692873
}
28702874
}

0 commit comments

Comments
 (0)