From 8f85719eb95c2cd54edbc9c05fad4316f166158e Mon Sep 17 00:00:00 2001 From: Kacper Korban Date: Tue, 5 Nov 2024 22:18:15 +0100 Subject: [PATCH 1/2] Don't point to the compiler backlog when a compiler plugin phase crashes (#21887) closes #21783 --- compiler/src/dotty/tools/dotc/report.scala | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/report.scala b/compiler/src/dotty/tools/dotc/report.scala index 0565210b21d4..5517bd005077 100644 --- a/compiler/src/dotty/tools/dotc/report.scala +++ b/compiler/src/dotty/tools/dotc/report.scala @@ -152,13 +152,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"""| An unhandled exception was thrown in the compiler plugin named "${ctx.phase.megaPhase}". + | Please report the issue to the plugin's maintainers. + | For non-enriched exceptions, compile with -Xno-enrich-error-messages. + |""".stripMargin + else + s"""| 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. + |""".stripMargin s""" | $errorMessage | - | An unhandled exception was thrown in the compiler. - | Please file a crash report here: - | https://github.com/lampepfl/dotty/issues/new/choose - | For non-enriched exceptions, compile with -Yno-enrich-error-messages. + |$fileAReportMsg | |$info1 |""".stripMargin From 9b70f5a678ec4c65e72d3731c28ed8ff7ce3c06f Mon Sep 17 00:00:00 2001 From: Tomasz Godzik Date: Fri, 14 Feb 2025 17:58:16 +0100 Subject: [PATCH 2/2] Don't point to the compiler backlog when a compiler plugin phase crashes (#21887) closes #21783 [Cherry-picked 7f47867a824f3fd38aed63eaedfa4f4d339cbd99][modified]