Skip to content

Commit 7f47867

Browse files
Don't point to the compiler backlog when a compiler plugin phase crashes (#21887)
closes #21783
1 parent fa43ab8 commit 7f47867

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Diff for: compiler/src/dotty/tools/dotc/report.scala

+14-4
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,23 @@ object report:
165165
"compiler version" -> dotty.tools.dotc.config.Properties.versionString,
166166
"settings" -> settings.map(showSetting).mkString(" "),
167167
))
168+
val fileAReportMsg =
169+
if ctx.phase.isInstanceOf[plugins.PluginPhase]
170+
then
171+
s"""| An unhandled exception was thrown in the compiler plugin named "${ctx.phase.megaPhase}".
172+
| Please report the issue to the plugin's maintainers.
173+
| For non-enriched exceptions, compile with -Xno-enrich-error-messages.
174+
|""".stripMargin
175+
else
176+
s"""| An unhandled exception was thrown in the compiler.
177+
| Please file a crash report here:
178+
| https://github.com/scala/scala3/issues/new/choose
179+
| For non-enriched exceptions, compile with -Xno-enrich-error-messages.
180+
|""".stripMargin
168181
s"""
169182
| $errorMessage
170183
|
171-
| An unhandled exception was thrown in the compiler.
172-
| Please file a crash report here:
173-
| https://github.com/scala/scala3/issues/new/choose
174-
| For non-enriched exceptions, compile with -Xno-enrich-error-messages.
184+
|$fileAReportMsg
175185
|
176186
|$info1
177187
|""".stripMargin

0 commit comments

Comments
 (0)