summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
diff options
context:
space:
mode:
authorSimon Ochsenreither <simon@ochsenreither.de>2016-04-02 13:38:15 +0200
committerSimon Ochsenreither <simon@ochsenreither.de>2016-05-28 21:42:40 +0200
commit673350e08af72454fe9df87ae7f3292893e44d3c (patch)
tree7bff97a5ba4dafd0836f529589e8572175a442e7 /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
parent981e3c51d5040ea808b5f699718db55241ee42cf (diff)
downloadscala-673350e08af72454fe9df87ae7f3292893e44d3c.tar.gz
scala-673350e08af72454fe9df87ae7f3292893e44d3c.tar.bz2
scala-673350e08af72454fe9df87ae7f3292893e44d3c.zip
SI-9084 Add `since` (if available) to deprecation warnings
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index da269168ec..3aea64a1f2 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -548,9 +548,10 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans
def checkOverrideDeprecated() {
if (other.hasDeprecatedOverridingAnnotation && !member.ownerChain.exists(x => x.isDeprecated || x.hasBridgeAnnotation)) {
- val suffix = other.deprecatedOverridingMessage map (": " + _) getOrElse ""
- val msg = s"overriding ${other.fullLocationString} is deprecated$suffix"
- currentRun.reporting.deprecationWarning(member.pos, other, msg)
+ val version = other.deprecatedOverridingVersion map (ver => s" (since $ver)") getOrElse ""
+ val message = other.deprecatedOverridingMessage map (msg => s": $msg") getOrElse ""
+ val report = s"overriding ${other.fullLocationString} is deprecated$version$message"
+ currentRun.reporting.deprecationWarning(member.pos, other, report)
}
}
}