Skip to content

Commit 5f42b6a

Browse files
committed
Revert "Set errorsReported while running isHidden and forcing message"
This reverts commit 6875465.
1 parent f7ae2b7 commit 5f42b6a

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

compiler/src/dotty/tools/dotc/reporting/Reporter.scala

+1-14
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,7 @@ abstract class Reporter extends interfaces.ReporterResult {
154154
val key = w.enablingOption.name
155155
addUnreported(key, 1)
156156
case _ =>
157-
val hide = if !errorsReported && dia.isInstanceOf[Error] then
158-
// We bump up errorCount so errorsReported is true while executing isHidden.
159-
// We use errorsReported as a predicate for broken code.
160-
// So now any code `isHidden` runs won't cause, for instance,
161-
// assertion errors and thus compiler crashes.
162-
// This normally amounts to forcing the message, which might run more code
163-
// to generate useful hints for the user.
164-
try
165-
_errorCount += 1
166-
isHidden(dia)
167-
finally
168-
_errorCount -= 1 // decrease rather than set back to `oldErrorCount` so we only ever decrease by 1
169-
else isHidden(dia)
170-
if !hide then // avoid isHidden test for summarized warnings so that message is not forced
157+
if !isHidden(dia) then // avoid isHidden test for summarized warnings so that message is not forced
171158
markReported(dia)
172159
withMode(Mode.Printing)(doReport(dia))
173160
dia match {

0 commit comments

Comments
 (0)