summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/Global.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala6
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))