File tree 3 files changed +8
-3
lines changed
compiler/src/dotty/tools/dotc 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,13 @@ object Mode {
81
81
/** Read original positions when unpickling from TASTY */
82
82
val ReadPositions = newMode(16 , " ReadPositions" )
83
83
84
+ /** Don't suppress exceptions thrown during show */
85
+ val PrintShowExceptions = newMode(17 , " PrintShowExceptions" )
86
+
84
87
val PatternOrType = Pattern | Type
85
88
86
89
/** We are elaborating the fully qualified name of a package clause.
87
90
* In this case, identifiers should never be imported.
88
91
*/
89
- val InPackageClauseName = newMode(17 , " InPackageClauseName" )
92
+ val InPackageClauseName = newMode(18 , " InPackageClauseName" )
90
93
}
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ object Formatting {
31
31
case arg : Showable =>
32
32
try arg.show
33
33
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] "
35
36
}
36
37
case _ => arg.toString
37
38
}
Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ class Pickler extends Phase {
79
79
ctx.fresh
80
80
.setPeriod(Period (ctx.runId + 1 , FirstPhaseId ))
81
81
.setReporter(new ThrowingReporter (ctx.reporter))
82
- .addMode(Mode .ReadPositions ))
82
+ .addMode(Mode .ReadPositions )
83
+ .addMode(Mode .PrintShowExceptions ))
83
84
result
84
85
}
85
86
You can’t perform that action at this time.
0 commit comments