Skip to content

Commit 00fbf27

Browse files
committed
Fix printing of errors
1 parent 5f9f364 commit 00fbf27

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/printing/Formatting.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ object Formatting {
3131
case NonFatal(ex)
3232
if !ctx.mode.is(Mode.PrintShowExceptions) &&
3333
!ctx.settings.YshowPrintErrors.value =>
34-
s"[cannot display due to $ex, raw string = ${arg.toString}]"
34+
val msg = ex match { case te: TypeError => te.toMessage case _ => ex.getMessage }
35+
s"[cannot display due to $msg, raw string = ${arg.toString}]"
3536
}
3637
case _ => arg.toString
3738
}

0 commit comments

Comments
 (0)