File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,13 @@ object Mode {
8181 /** Read original positions when unpickling from TASTY */
8282 val ReadPositions = newMode(16 , " ReadPositions" )
8383
84+ /** Don't suppress exceptions thrown during show */
85+ val PrintShowExceptions = newMode(17 , " PrintShowExceptions" )
86+
8487 val PatternOrType = Pattern | Type
8588
8689 /** We are elaborating the fully qualified name of a package clause.
8790 * In this case, identifiers should never be imported.
8891 */
89- val InPackageClauseName = newMode(17 , " InPackageClauseName" )
92+ val InPackageClauseName = newMode(18 , " InPackageClauseName" )
9093}
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ object Formatting {
3131 case arg : Showable =>
3232 try arg.show
3333 catch {
34- case NonFatal (ex) => s " [cannot display due to $ex, raw string = $toString] "
34+ case NonFatal (ex) if ! ctx.mode.is(Mode .PrintShowExceptions ) =>
35+ s " [cannot display due to $ex, raw string = $toString] "
3536 }
3637 case _ => arg.toString
3738 }
Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ class Pickler extends Phase {
7979 ctx.fresh
8080 .setPeriod(Period (ctx.runId + 1 , FirstPhaseId ))
8181 .setReporter(new ThrowingReporter (ctx.reporter))
82- .addMode(Mode .ReadPositions ))
82+ .addMode(Mode .ReadPositions )
83+ .addMode(Mode .PrintShowExceptions ))
8384 result
8485 }
8586
You can’t perform that action at this time.
0 commit comments