Skip to content

Commit 738a638

Browse files
committed
Nicer deprecation messages
No need to print both `sym` and `sym.showLocated`, the second one is enough.
1 parent 2d3e90e commit 738a638

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/typer/RefChecks.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,8 @@ object RefChecks {
640640
// If symbol is deprecated, and the point of reference is not enclosed
641641
// in either a deprecated member or a scala bridge method, issue a warning.
642642
if (sym.isDeprecated && !ctx.owner.ownersIterator.exists(_.isDeprecated)) {
643-
ctx.deprecationWarning("%s%s is deprecated%s".format(
644-
sym, sym.showLocated, sym.deprecationMessage map (": " + _) getOrElse ""), pos)
643+
ctx.deprecationWarning("%s is deprecated%s".format(
644+
sym.showLocated, sym.deprecationMessage map (": " + _) getOrElse ""), pos)
645645
}
646646
// Similar to deprecation: check if the symbol is marked with @migration
647647
// indicating it has changed semantics between versions.

0 commit comments

Comments
 (0)