summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-07-03 13:40:55 +0200
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-07-04 15:49:08 +0200
commitb384d5070f86e9003e8f1b57cc818520033242ab (patch)
treef511cd45fd3e7783c8b124df3863d1317a8b5af9
parent3066bd4c7b2f574748208b7399c68c6c6493206b (diff)
downloadscala-b384d5070f86e9003e8f1b57cc818520033242ab.tar.gz
scala-b384d5070f86e9003e8f1b57cc818520033242ab.tar.bz2
scala-b384d5070f86e9003e8f1b57cc818520033242ab.zip
Use countElementsAsString for summarized warnings.
-rw-r--r--src/compiler/scala/tools/nsc/Reporting.scala8
-rw-r--r--test/files/jvm/deprecation.check2
-rw-r--r--test/files/jvm/serialization-new.check2
-rw-r--r--test/files/jvm/serialization.check2
-rw-r--r--test/files/neg/checksensible.check2
-rw-r--r--test/files/neg/overloaded-implicit.check2
-rw-r--r--test/files/run/colltest.check2
-rw-r--r--test/files/run/inferred-type-constructors.check2
-rw-r--r--test/files/run/names-defaults.check2
-rw-r--r--test/files/run/richs.check2
-rw-r--r--test/files/run/t2212.check2
-rw-r--r--test/files/run/t3996.check2
-rw-r--r--test/files/run/t4080.check2
-rw-r--r--test/files/run/t4461.check2
-rw-r--r--test/files/run/t4813.check2
-rw-r--r--test/files/run/t6111.check2
-rw-r--r--test/files/run/t6690.check2
-rw-r--r--test/files/run/t6863.check2
-rw-r--r--test/files/run/t8196.check2
-rw-r--r--test/files/run/t8549.check2
20 files changed, 23 insertions, 23 deletions
diff --git a/src/compiler/scala/tools/nsc/Reporting.scala b/src/compiler/scala/tools/nsc/Reporting.scala
index bc27afb0c5..0263586418 100644
--- a/src/compiler/scala/tools/nsc/Reporting.scala
+++ b/src/compiler/scala/tools/nsc/Reporting.scala
@@ -9,6 +9,7 @@ package nsc
import reporters.{ Reporter, ConsoleReporter }
import scala.collection.{ mutable, immutable }
+import scala.reflect.internal.util.StringOps.countElementsAsString
/** Provides delegates to the reporter doing the actual work.
* PerRunReporting implements per-Run stateful info tracking and reporting
@@ -34,11 +35,10 @@ trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions w
def summarize() =
if (warnings.nonEmpty && (option.isDefault || settings.fatalWarnings)) {
val numWarnings = warnings.size
- val warningEvent = // TODO use scala.reflect.internal.util.StringOps.countElementsAsString(numWarnings, s"$what warning")
- if (numWarnings > 1) s"were $numWarnings $what warnings"
- else s"was one $what warning"
+ val warningVerb = if (numWarnings == 1) "was" else "were"
+ val warningCount = countElementsAsString(numWarnings, s"$what warning")
- reporter.warning(NoPosition, s"there $warningEvent; re-run with ${option.name} for details")
+ reporter.warning(NoPosition, s"there $warningVerb $warningCount; re-run with ${option.name} for details")
}
}
diff --git a/test/files/jvm/deprecation.check b/test/files/jvm/deprecation.check
index 3c27d4d082..d57b6b55a5 100644
--- a/test/files/jvm/deprecation.check
+++ b/test/files/jvm/deprecation.check
@@ -1,3 +1,3 @@
-warning: there were 4 deprecation warnings; re-run with -deprecation for details
+warning: there were four deprecation warnings; re-run with -deprecation for details
Note: deprecation/Use_2.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
diff --git a/test/files/jvm/serialization-new.check b/test/files/jvm/serialization-new.check
index 8ec5754ea2..1555135926 100644
--- a/test/files/jvm/serialization-new.check
+++ b/test/files/jvm/serialization-new.check
@@ -1,4 +1,4 @@
-warning: there were 2 deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings; re-run with -deprecation for details
a1 = Array[1,2,3]
_a1 = Array[1,2,3]
arrayEquals(a1, _a1): true
diff --git a/test/files/jvm/serialization.check b/test/files/jvm/serialization.check
index 8ec5754ea2..1555135926 100644
--- a/test/files/jvm/serialization.check
+++ b/test/files/jvm/serialization.check
@@ -1,4 +1,4 @@
-warning: there were 2 deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings; re-run with -deprecation for details
a1 = Array[1,2,3]
_a1 = Array[1,2,3]
arrayEquals(a1, _a1): true
diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check
index 1b53fa5fb9..7de22fef54 100644
--- a/test/files/neg/checksensible.check
+++ b/test/files/neg/checksensible.check
@@ -97,7 +97,7 @@ checksensible.scala:84: warning: comparing values of types EqEqRefTest.this.C3 a
checksensible.scala:95: warning: comparing values of types Unit and Int using `!=' will always yield true
while ((c = in.read) != -1)
^
-warning: there were 3 deprecation warnings; re-run with -deprecation for details
+warning: there were three deprecation warnings; re-run with -deprecation for details
error: No warnings can be incurred under -Xfatal-warnings.
34 warnings found
one error found
diff --git a/test/files/neg/overloaded-implicit.check b/test/files/neg/overloaded-implicit.check
index 5cf6ac528b..0e6617d904 100644
--- a/test/files/neg/overloaded-implicit.check
+++ b/test/files/neg/overloaded-implicit.check
@@ -4,7 +4,7 @@ overloaded-implicit.scala:2: warning: parameterized overloaded implicit methods
overloaded-implicit.scala:3: warning: parameterized overloaded implicit methods are not visible as view bounds
implicit def imp1[T](x: Set[T]): Map[T, T] = Map()
^
-warning: there were 4 feature warnings; re-run with -feature for details
+warning: there were four feature warnings; re-run with -feature for details
error: No warnings can be incurred under -Xfatal-warnings.
three warnings found
one error found
diff --git a/test/files/run/colltest.check b/test/files/run/colltest.check
index 46e4017eb6..9579d781aa 100644
--- a/test/files/run/colltest.check
+++ b/test/files/run/colltest.check
@@ -1,4 +1,4 @@
-warning: there were 2 deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings; re-run with -deprecation for details
true
false
true
diff --git a/test/files/run/inferred-type-constructors.check b/test/files/run/inferred-type-constructors.check
index 67075a59a9..4a63853bd9 100644
--- a/test/files/run/inferred-type-constructors.check
+++ b/test/files/run/inferred-type-constructors.check
@@ -1,4 +1,4 @@
-warning: there were 2 feature warnings; re-run with -feature for details
+warning: there were two feature warnings; re-run with -feature for details
p.Iterable[Int]
p.Set[Int]
p.Seq[Int]
diff --git a/test/files/run/names-defaults.check b/test/files/run/names-defaults.check
index 97cfa4e520..25999c488a 100644
--- a/test/files/run/names-defaults.check
+++ b/test/files/run/names-defaults.check
@@ -1,7 +1,7 @@
names-defaults.scala:269: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
spawn(b = { val ttt = 1; ttt }, a = 0)
^
-warning: there were 4 deprecation warnings; re-run with -deprecation for details
+warning: there were four deprecation warnings; re-run with -deprecation for details
1: @
get: $
get: 2
diff --git a/test/files/run/richs.check b/test/files/run/richs.check
index bcaf8bdb8d..cf265ae007 100644
--- a/test/files/run/richs.check
+++ b/test/files/run/richs.check
@@ -1,4 +1,4 @@
-warning: there were 2 deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings; re-run with -deprecation for details
RichCharTest1:
true
diff --git a/test/files/run/t2212.check b/test/files/run/t2212.check
index f7e80439c7..1465f1341a 100644
--- a/test/files/run/t2212.check
+++ b/test/files/run/t2212.check
@@ -1,4 +1,4 @@
-warning: there were 2 deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings; re-run with -deprecation for details
LinkedList(1)
LinkedList(1)
true
diff --git a/test/files/run/t3996.check b/test/files/run/t3996.check
index 2e8e558f88..a9ecc29fea 100644
--- a/test/files/run/t3996.check
+++ b/test/files/run/t3996.check
@@ -1 +1 @@
-warning: there were 2 deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings; re-run with -deprecation for details
diff --git a/test/files/run/t4080.check b/test/files/run/t4080.check
index c642cc67da..462e925b76 100644
--- a/test/files/run/t4080.check
+++ b/test/files/run/t4080.check
@@ -1,2 +1,2 @@
-warning: there were 3 deprecation warnings; re-run with -deprecation for details
+warning: there were three deprecation warnings; re-run with -deprecation for details
LinkedList(1, 0, 2, 3)
diff --git a/test/files/run/t4461.check b/test/files/run/t4461.check
index c44b0fc077..346993af6f 100644
--- a/test/files/run/t4461.check
+++ b/test/files/run/t4461.check
@@ -1,4 +1,4 @@
-warning: there were 4 deprecation warnings; re-run with -deprecation for details
+warning: there were four deprecation warnings; re-run with -deprecation for details
Include(End,1)
Include(End,2)
Include(End,3)
diff --git a/test/files/run/t4813.check b/test/files/run/t4813.check
index 2e8e558f88..a9ecc29fea 100644
--- a/test/files/run/t4813.check
+++ b/test/files/run/t4813.check
@@ -1 +1 @@
-warning: there were 2 deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings; re-run with -deprecation for details
diff --git a/test/files/run/t6111.check b/test/files/run/t6111.check
index 21a5b19ea0..5880658001 100644
--- a/test/files/run/t6111.check
+++ b/test/files/run/t6111.check
@@ -1,3 +1,3 @@
-warning: there were 2 deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings; re-run with -deprecation for details
(8,8)
(x,x)
diff --git a/test/files/run/t6690.check b/test/files/run/t6690.check
index 2e8e558f88..a9ecc29fea 100644
--- a/test/files/run/t6690.check
+++ b/test/files/run/t6690.check
@@ -1 +1 @@
-warning: there were 2 deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings; re-run with -deprecation for details
diff --git a/test/files/run/t6863.check b/test/files/run/t6863.check
index 37de2e6e51..d4df5f7a74 100644
--- a/test/files/run/t6863.check
+++ b/test/files/run/t6863.check
@@ -10,4 +10,4 @@ t6863.scala:46: warning: comparing values of types Unit and Unit using `==' will
t6863.scala:59: warning: comparing values of types Unit and Unit using `==' will always yield true
assert({ () => x }.apply == ())
^
-warning: there were 4 deprecation warnings; re-run with -deprecation for details
+warning: there were four deprecation warnings; re-run with -deprecation for details
diff --git a/test/files/run/t8196.check b/test/files/run/t8196.check
index f021a3619f..d11dc27e68 100644
--- a/test/files/run/t8196.check
+++ b/test/files/run/t8196.check
@@ -1,7 +1,7 @@
t8196.scala:26: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
form2.g1 // comment this line in order to make the test pass
^
-warning: there were 2 feature warnings; re-run with -feature for details
+warning: there were two feature warnings; re-run with -feature for details
Scope{
final private val f1: Int
}
diff --git a/test/files/run/t8549.check b/test/files/run/t8549.check
index 2e8e558f88..a9ecc29fea 100644
--- a/test/files/run/t8549.check
+++ b/test/files/run/t8549.check
@@ -1 +1 @@
-warning: there were 2 deprecation warnings; re-run with -deprecation for details
+warning: there were two deprecation warnings; re-run with -deprecation for details