Skip to content

Commit e7e3c47

Browse files
authored
Merge pull request #78 from scala/backport-lts-3.3-21887
Backport "Don't point to the compiler backlog when a compiler plugin phase crashes" to 3.3 LTS
2 parents 492aa72 + 9b70f5a commit e7e3c47

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

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

+14-4
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,23 @@ object report:
152152
"compiler version" -> dotty.tools.dotc.config.Properties.versionString,
153153
"settings" -> settings.map(showSetting).mkString(" "),
154154
))
155+
val fileAReportMsg =
156+
if ctx.phase.isInstanceOf[plugins.PluginPhase]
157+
then
158+
s"""| An unhandled exception was thrown in the compiler plugin named "${ctx.phase.megaPhase}".
159+
| Please report the issue to the plugin's maintainers.
160+
| For non-enriched exceptions, compile with -Xno-enrich-error-messages.
161+
|""".stripMargin
162+
else
163+
s"""| An unhandled exception was thrown in the compiler.
164+
| Please file a crash report here:
165+
| https://github.com/scala/scala3/issues/new/choose
166+
| For non-enriched exceptions, compile with -Xno-enrich-error-messages.
167+
|""".stripMargin
155168
s"""
156169
| $errorMessage
157170
|
158-
| An unhandled exception was thrown in the compiler.
159-
| Please file a crash report here:
160-
| https://github.com/lampepfl/dotty/issues/new/choose
161-
| For non-enriched exceptions, compile with -Yno-enrich-error-messages.
171+
|$fileAReportMsg
162172
|
163173
|$info1
164174
|""".stripMargin

0 commit comments

Comments
 (0)