From 795796dbfb0d5617163bcc2d1db856b912b7043a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 5 Sep 2014 01:24:13 +0200 Subject: CyclicError messages now go to printer Have a configurable printer to which cyclic error messages are sent. --- src/dotty/tools/dotc/config/Printers.scala | 1 + src/dotty/tools/dotc/core/Types.scala | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dotty/tools/dotc/config/Printers.scala b/src/dotty/tools/dotc/config/Printers.scala index 0cbfb6880..3926be59b 100644 --- a/src/dotty/tools/dotc/config/Printers.scala +++ b/src/dotty/tools/dotc/config/Printers.scala @@ -27,4 +27,5 @@ object Printers { val incremental = noPrinter val config = noPrinter val transforms = noPrinter + val cyclicErrors = noPrinter } \ No newline at end of file diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index a2cf734ba..7163c2093 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -2864,7 +2864,11 @@ object Types { object CyclicReference { def apply(denot: SymDenotation)(implicit ctx: Context): CyclicReference = { val ex = new CyclicReference(denot) - if (!(ctx.mode is typer.Mode.CheckCyclic)) ex.printStackTrace() + if (!(ctx.mode is typer.Mode.CheckCyclic)) { + cyclicErrors.println(ex.getMessage) + for (elem <- ex.getStackTrace take 40) + cyclicErrors.println(elem.toString) + } ex } } -- cgit v1.2.3