dotty.tools.dotc.reporting.ThrowingReporter.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala3-compiler_3 Show documentation
Show all versions of scala3-compiler_3 Show documentation
scala3-compiler-bootstrapped
package dotty.tools
package dotc
package reporting
import core.Contexts.*
import Diagnostic.Error
/**
* This class implements a Reporter that throws all errors as UnhandledError exceptions
* and sends warnings and other info to the underlying reporter.
*/
class ThrowingReporter(reportInfo: Reporter) extends Reporter {
def doReport(dia: Diagnostic)(using Context): Unit = dia match {
case dia: Error => throw UnhandledError(dia)
case _ => reportInfo.doReport(dia)
}
}
class UnhandledError(val diagnostic: Error) extends Exception:
override def getMessage = diagnostic.message
© 2015 - 2025 Weber Informatics LLC | Privacy Policy