Skip to content

Commit 2664204

Browse files
authored
Make -Xprompt work as desired under -Werror (#19765)
2 parents 6daae21 + 6c6f7d8 commit 2664204

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package reporting
44

55
import core.Contexts.*
66
import java.io.{ BufferedReader, PrintWriter }
7-
import Diagnostic.Error
7+
import Diagnostic.*
88

99
/**
1010
* This class implements a Reporter that displays messages on a text console
@@ -18,9 +18,11 @@ class ConsoleReporter(
1818

1919
override def doReport(dia: Diagnostic)(using Context): Unit = {
2020
super.doReport(dia)
21-
dia match
22-
case dia: Error if ctx.settings.Xprompt.value => Reporter.displayPrompt(reader, writer)
23-
case _ =>
21+
if ctx.settings.Xprompt.value then
22+
dia match
23+
case _: Error => Reporter.displayPrompt(reader, writer)
24+
case _: Warning if ctx.settings.XfatalWarnings.value => Reporter.displayPrompt(reader, writer)
25+
case _ =>
2426
}
2527
}
2628

0 commit comments

Comments
 (0)