Skip to content

Commit 50ccf30

Browse files
committed
Don't point to the compiler backlog when a compiler plugin phase crashes
1 parent 71b0aea commit 50ccf30

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

compiler/src/dotty/tools/dotc/report.scala

Lines changed: 13 additions & 3 deletions
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"""| Please file a crash report in the compiler plugin backlog.
172+
| The name of the compiler plugin which caused the crash is "${ctx.phase.megaPhase}".
173+
| For non-enriched exceptions, compile with -Xno-enrich-error-messages.
174+
|""".stripMargin
175+
else
176+
s"""| Please file a crash report here:
177+
| https://github.com/scala/scala3/issues/new/choose
178+
| For non-enriched exceptions, compile with -Xno-enrich-error-messages.
179+
|""".stripMargin
168180
s"""
169181
| $errorMessage
170182
|
171183
| 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)