File tree 3 files changed +6
-5
lines changed
compiler/src/dotty/tools/dotc
3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,7 @@ object report:
158
158
| An unhandled exception was thrown in the compiler.
159
159
| Please file a crash report here:
160
160
| https://github.com/lampepfl/dotty/issues/new/choose
161
+ | For non-enriched exceptions, compile with -Yno-enrich-error-messages.
161
162
|
162
163
| $info1
163
164
| """ .stripMargin
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ trait HideNonSensicalMessages extends Reporter {
13
13
*/
14
14
override def isHidden (dia : Diagnostic )(using Context ): Boolean =
15
15
super .isHidden(dia) || {
16
- dia.msg.isNonSensical &&
17
- hasErrors && // if there are no errors yet, report even if diagnostic is non-sensical
18
- ! ctx.settings.YshowSuppressedErrors .value
16
+ hasErrors // if there are no errors yet, report even if diagnostic is non-sensical
17
+ && dia.msg.isNonSensical // defer forcing the message by calling hasErrors first
18
+ && ! ctx.settings.YshowSuppressedErrors .value
19
19
}
20
20
}
Original file line number Diff line number Diff line change @@ -155,8 +155,6 @@ abstract class Reporter extends interfaces.ReporterResult {
155
155
addUnreported(key, 1 )
156
156
case _ =>
157
157
if ! isHidden(dia) then // avoid isHidden test for summarized warnings so that message is not forced
158
- markReported(dia)
159
- withMode(Mode .Printing )(doReport(dia))
160
158
dia match {
161
159
case w : Warning =>
162
160
warnings = w :: warnings
@@ -169,6 +167,8 @@ abstract class Reporter extends interfaces.ReporterResult {
169
167
case _ : Info => // nothing to do here
170
168
// match error if d is something else
171
169
}
170
+ markReported(dia)
171
+ withMode(Mode .Printing )(doReport(dia))
172
172
end issueUnconfigured
173
173
174
174
def issueIfNotSuppressed (dia : Diagnostic )(using Context ): Unit =
You can’t perform that action at this time.
0 commit comments