diff options
author | Som Snytt <som.snytt@gmail.com> | 2016-07-08 18:45:11 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2016-07-09 00:50:16 -0700 |
commit | 7548d2265361ec605b67aaae50ef6504937da68c (patch) | |
tree | 4e824347293c917bd02678cba9a4d754db166306 /src/compiler | |
parent | 7d94d553e960322472e274669bad1c47723c2d23 (diff) | |
download | scala-7548d2265361ec605b67aaae50ef6504937da68c.tar.gz scala-7548d2265361ec605b67aaae50ef6504937da68c.tar.bz2 scala-7548d2265361ec605b67aaae50ef6504937da68c.zip |
SI-8829 Let reporter customize retry message
"Re-run with -deprecation" is not always appropriate.
REPL gets to customize the message. The API includes the
setting and its name, because reflect Settings do not
have names. (!)
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/Reporting.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/Reporting.scala b/src/compiler/scala/tools/nsc/Reporting.scala index 01c583bea3..5635e678de 100644 --- a/src/compiler/scala/tools/nsc/Reporting.scala +++ b/src/compiler/scala/tools/nsc/Reporting.scala @@ -43,19 +43,19 @@ trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions w else sinceAndAmount += ((since, 1)) } val deprecationSummary = sinceAndAmount.size > 1 - sinceAndAmount.foreach { case (since, amount) => - val numWarnings = amount + sinceAndAmount.foreach { case (since, numWarnings) => val warningsSince = if (since.nonEmpty) s" (since $since)" else "" val warningVerb = if (numWarnings == 1) "was" else "were" val warningCount = countElementsAsString(numWarnings, s"$what warning") - val rerun = if (deprecationSummary) "" else s"; re-run with ${setting.name} for details" - reporter.warning(NoPosition, s"there $warningVerb $warningCount$warningsSince$rerun") + val rerun = if (deprecationSummary) "" else reporter.rerunWithDetails(setting, setting.name) + reporter.warning(NoPosition, s"there ${warningVerb} ${warningCount}${warningsSince}${rerun}") } if (deprecationSummary) { val numWarnings = warnings.size val warningVerb = if (numWarnings == 1) "was" else "were" val warningCount = countElementsAsString(numWarnings, s"$what warning") - reporter.warning(NoPosition, s"there $warningVerb $warningCount in total; re-run with ${setting.name} for details") + val rerun = reporter.rerunWithDetails(setting, setting.name) + reporter.warning(NoPosition, s"there ${warningVerb} ${warningCount} in total${rerun}") } } } |