diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-06-27 13:58:27 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-06-27 13:58:27 +0200 |
commit | 44f10291622058d11d75dc8f3ad35b582247799c (patch) | |
tree | c2e29f4ee43b9ef01ace1c96ffb68ecc6cf5872f /src | |
parent | 400f28de89c27618176c6d4c55df6d50b3dcbefa (diff) | |
parent | cb6546e1203218f3e0513fb07a2f7ea55f02a86a (diff) | |
download | scala-44f10291622058d11d75dc8f3ad35b582247799c.tar.gz scala-44f10291622058d11d75dc8f3ad35b582247799c.tar.bz2 scala-44f10291622058d11d75dc8f3ad35b582247799c.zip |
Merge pull request #3749 from huitseeker/issue/DeprecWarning
SI-8185 Correct grammar for single-warning compilation run
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 35eab94333..cb785de4b3 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -1169,8 +1169,10 @@ class Global(var currentSettings: Settings, var reporter: Reporter) if (option) reporter.warning(pos, msg) else if (!(warnings contains pos)) warnings += ((pos, msg)) def summarize() = - if (warnings.nonEmpty && (option.isDefault || settings.fatalWarnings)) - warning("there were %d %s warning(s); re-run with %s for details".format(warnings.size, what, option.name)) + if (warnings.nonEmpty && (option.isDefault || settings.fatalWarnings)){ + val warningEvent = if (warnings.size > 1) s"were ${ warnings.size } $what warnings" else s"was one $what warning" + warning(s"there $warningEvent; re-run with ${ option.name } for details") + } } def newSourceFile(code: String, filename: String = "<console>") = |