Skip to content

Commit b89e21d

Browse files
committed
Fix CyclicError error message if denotation does not exist
1 parent 8d0c927 commit b89e21d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,8 @@ object messages {
12621262
case class CyclicReferenceInvolving(denot: SymDenotation)(implicit ctx: Context)
12631263
extends Message(CyclicReferenceInvolvingID) {
12641264
val kind: String = "Cyclic"
1265-
val msg: String = em"""Cyclic reference involving $denot"""
1265+
val where = if denot.exists then s" involving $denot" else ""
1266+
val msg: String = em"Cyclic reference $where"
12661267
val explanation: String =
12671268
em"""|$denot is declared as part of a cycle which makes it impossible for the
12681269
|compiler to decide upon ${denot.name}'s type.

0 commit comments

Comments
 (0)