diff options
author | James Iry <jamesiry@gmail.com> | 2013-02-08 09:46:57 -0800 |
---|---|---|
committer | James Iry <jamesiry@gmail.com> | 2013-02-08 09:46:57 -0800 |
commit | 6537d79e47def868e028815db6f70e2dc7d49bac (patch) | |
tree | 3031c4cee46718d6999e92877c896db6bc022997 /src/compiler | |
parent | 3b6300b14b8aaac4c6bb7c70b51ef1df3dc3c536 (diff) | |
parent | e0068b908517768e900a3945e483e9c379d728d8 (diff) | |
download | scala-6537d79e47def868e028815db6f70e2dc7d49bac.tar.gz scala-6537d79e47def868e028815db6f70e2dc7d49bac.tar.bz2 scala-6537d79e47def868e028815db6f70e2dc7d49bac.zip |
Merge pull request #2095 from hubertp/ticket/5675
SI-5675 Discard duplicate feature warnings at a position
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 757ac94dbd..116684c161 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -1193,13 +1193,13 @@ class Global(var currentSettings: Settings, var reporter: Reporter) /** Collects for certain classes of warnings during this run. */ class ConditionalWarning(what: String, option: Settings#BooleanSetting) { - val warnings = new mutable.ListBuffer[(Position, String)] + val warnings = mutable.LinkedHashMap[Position, String]() def warn(pos: Position, msg: String) = if (option.value) reporter.warning(pos, msg) - else warnings += ((pos, msg)) + else if (!(warnings contains pos)) warnings += ((pos, msg)) def summarize() = if (option.isDefault && warnings.nonEmpty) - reporter.warning(NoPosition, "there were %d %s warnings; re-run with %s for details".format(warnings.size, what, option.name)) + reporter.warning(NoPosition, "there were %d %s warning(s); re-run with %s for details".format(warnings.size, what, option.name)) } def newUnitParser(code: String) = new syntaxAnalyzer.UnitParser(newCompilationUnit(code)) |