diff options
author | Martin Odersky <odersky@gmail.com> | 2016-08-13 13:28:33 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-08-16 17:34:42 +0200 |
commit | 4a0858fab5547c896870d269968aff9674ab2ee6 (patch) | |
tree | d6681f6172335a276d5a34b15fc48abbcd1253a5 /src/dotty/tools/dotc/printing | |
parent | b3d4fd94f24b961715dce15d7d46fcdd32f7dd69 (diff) | |
download | dotty-4a0858fab5547c896870d269968aff9674ab2ee6.tar.gz dotty-4a0858fab5547c896870d269968aff9674ab2ee6.tar.bz2 dotty-4a0858fab5547c896870d269968aff9674ab2ee6.zip |
Catch exceptions only in i-interpolator.
Normal show will propagate the excpetions. Previously, exceptions were filtered
in both cases, which was redundant. Also, it's good to have a way to show things that
does not mask exceptions, if only to debug problems in show itself.
Diffstat (limited to 'src/dotty/tools/dotc/printing')
-rw-r--r-- | src/dotty/tools/dotc/printing/Formatting.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/printing/Showable.scala | 6 |
2 files changed, 2 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/printing/Formatting.scala b/src/dotty/tools/dotc/printing/Formatting.scala index 174d801d1..8d7136839 100644 --- a/src/dotty/tools/dotc/printing/Formatting.scala +++ b/src/dotty/tools/dotc/printing/Formatting.scala @@ -28,7 +28,7 @@ object Formatting { case arg: Showable => try arg.show(ctx.addMode(Mode.FutureDefsOK)) catch { - case NonFatal(ex) => s"(missing due to $ex)" + case NonFatal(ex) => s"[cannot display due to $ex, raw string = $toString]" } case _ => arg.toString } diff --git a/src/dotty/tools/dotc/printing/Showable.scala b/src/dotty/tools/dotc/printing/Showable.scala index 37de053cb..efddb26f7 100644 --- a/src/dotty/tools/dotc/printing/Showable.scala +++ b/src/dotty/tools/dotc/printing/Showable.scala @@ -21,11 +21,7 @@ trait Showable extends Any { def fallbackToText(printer: Printer): Text = toString /** The string representation of this showable element. */ - def show(implicit ctx: Context): String = - try toText(ctx.printer).show - catch { - case NonFatal(ex) => s"[cannot display due to $ex, raw string = $toString]" - } + def show(implicit ctx: Context): String = toText(ctx.printer).show /** The summarized string representation of this showable element. * Recursion depth is limited to some smallish value. Default is |