dotty.tools.dotc.reporting.HideNonSensicalMessages.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.*
/**
* This trait implements `isHidden` so that we avoid reporting non-sensical messages.
*/
trait HideNonSensicalMessages extends Reporter {
/** Hides non-sensical messages, unless we haven't reported any error yet or
* `-Yshow-suppressed-errors` is set.
*/
override def isHidden(dia: Diagnostic)(using Context): Boolean =
super.isHidden(dia) || {
hasErrors // if there are no errors yet, report even if diagnostic is non-sensical
&& dia.msg.isNonSensical // defer forcing the message by calling hasErrors first
&& !ctx.settings.YshowSuppressedErrors.value
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy