Skip to content

Commit 7a9ae7c

Browse files
committed
DoubleDeclaration message: support declarations without positions
1 parent caac6b9 commit 7a9ae7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2103,7 +2103,7 @@ object messages {
21032103
case _ /* Signature.FullMatch */ => "\nThe definitions have matching type signatures after erasure."
21042104
}
21052105
} else ""
2106-
hl"${decl.showLocated} is already defined as ${previousDecl.showDcl} at line ${previousDecl.pos.line + 1}." + details
2106+
hl"${decl.showLocated} is already defined as ${previousDecl.showDcl} ${if (previousDecl.pos.exists) s"at line ${previousDecl.pos.line + 1}" else ""}." + details
21072107
}
21082108
val explanation: String = ""
21092109
}

0 commit comments

Comments
 (0)