diff --git a/compiler/src/dotty/tools/dotc/report.scala b/compiler/src/dotty/tools/dotc/report.scala index e24e6be38b2b..2eca09380b5d 100644 --- a/compiler/src/dotty/tools/dotc/report.scala +++ b/compiler/src/dotty/tools/dotc/report.scala @@ -165,13 +165,23 @@ object report: "compiler version" -> dotty.tools.dotc.config.Properties.versionString, "settings" -> settings.map(showSetting).mkString(" "), )) + val fileAReportMsg = + if ctx.phase.isInstanceOf[plugins.PluginPhase] + then + s"""| Please file a crash report in the compiler plugin backlog. + | The name of the compiler plugin which caused the crash is "${ctx.phase.megaPhase}". + | For non-enriched exceptions, compile with -Xno-enrich-error-messages. + |""".stripMargin + else + s"""| Please file a crash report here: + | https://github.com/scala/scala3/issues/new/choose + | For non-enriched exceptions, compile with -Xno-enrich-error-messages. + |""".stripMargin s""" | $errorMessage | | An unhandled exception was thrown in the compiler. - | Please file a crash report here: - | https://github.com/scala/scala3/issues/new/choose - | For non-enriched exceptions, compile with -Xno-enrich-error-messages. + |$fileAReportMsg | |$info1 |""".stripMargin