Skip to content

Commit

Permalink
SI-8185 Correct grammar for single-warning compilation run
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed Mar 10, 2014
1 parent 6ae842d commit 26e6848
Show file tree
Hide file tree
Showing 52 changed files with 65 additions and 63 deletions.
6 changes: 4 additions & 2 deletions src/compiler/scala/tools/nsc/Global.scala
Expand Up @@ -1168,8 +1168,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>") =
Expand Down
2 changes: 1 addition & 1 deletion test/files/jvm/deprecation.check
@@ -1,3 +1,3 @@
warning: there were 4 deprecation warning(s); re-run with -deprecation for details
warning: there were 4 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.
2 changes: 1 addition & 1 deletion test/files/jvm/future-spec.check
@@ -1 +1 @@
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
4 changes: 2 additions & 2 deletions test/files/jvm/interpreter.check
Expand Up @@ -95,7 +95,7 @@ scala> case class Bar(n: Int)
defined class Bar

scala> implicit def foo2bar(foo: Foo) = Bar(foo.n)
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
foo2bar: (foo: Foo)Bar

scala> val bar: Bar = Foo(3)
Expand Down Expand Up @@ -269,7 +269,7 @@ scala> xs map (x => x)
res6: Array[_] = Array(1, 2)

scala> xs map (x => (x, x))
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
res7: Array[(_$1, _$1)] forSome { type _$1 } = Array((1,1), (2,2))

scala>
Expand Down
2 changes: 1 addition & 1 deletion test/files/jvm/serialization-new.check
@@ -1,4 +1,4 @@
warning: there were 2 deprecation warning(s); re-run with -deprecation for details
warning: there were 2 deprecation warnings; re-run with -deprecation for details
a1 = Array[1,2,3]
_a1 = Array[1,2,3]
arrayEquals(a1, _a1): true
Expand Down
2 changes: 1 addition & 1 deletion test/files/jvm/serialization.check
@@ -1,4 +1,4 @@
warning: there were 2 deprecation warning(s); re-run with -deprecation for details
warning: there were 2 deprecation warnings; re-run with -deprecation for details
a1 = Array[1,2,3]
_a1 = Array[1,2,3]
arrayEquals(a1, _a1): true
Expand Down
2 changes: 1 addition & 1 deletion test/files/neg/t5675.check
@@ -1,2 +1,2 @@
error: there were 1 feature warning(s); re-run with -feature for details
error: there was one feature warning; re-run with -feature for details
one error found
2 changes: 1 addition & 1 deletion test/files/run/collection-stacks.check
@@ -1,4 +1,4 @@
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
3-2-1: true
3-2-1: true
apply
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/colltest.check
@@ -1,4 +1,4 @@
warning: there were 2 deprecation warning(s); re-run with -deprecation for details
warning: there were 2 deprecation warnings; re-run with -deprecation for details
true
false
true
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/colltest1.scala
@@ -1,5 +1,5 @@
/*
* filter: inliner warning\(s\); re-run with -Yinline-warnings for details
* filter: inliner warnings; re-run with -Yinline-warnings for details
*/
import scala.collection._
import scala.language.postfixOps
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/compiler-asSeenFrom.scala
@@ -1,5 +1,5 @@
/*
* filter: inliner warning\(s\); re-run with -Yinline-warnings for details
* filter: inliner warning; re-run with -Yinline-warnings for details
*/
import scala.tools.nsc._
import scala.tools.partest.DirectTest
Expand Down
8 changes: 4 additions & 4 deletions test/files/run/constrained-types.check
Expand Up @@ -71,11 +71,11 @@ scala> var four = "four"
four: String = four

scala> val four2 = m(four) // should have an existential bound
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
four2: String @Annot(x) forSome { val x: String } = four

scala> val four3 = four2 // should have the same type as four2
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
four3: String @Annot(x) forSome { val x: String } = four

scala> val stuff = m("stuff") // should not crash
Expand All @@ -98,7 +98,7 @@ scala> def m = {
val y : String @Annot(x) = x
y
} // x should not escape the local scope with a narrow type
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
m: String @Annot(x) forSome { val x: String }

scala>
Expand All @@ -112,7 +112,7 @@ scala> def n(y: String) = {
}
m("stuff".stripMargin)
} // x should be existentially bound
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
n: (y: String)String @Annot(x) forSome { val x: String }

scala>
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/delambdafy_t6028.check
Expand Up @@ -54,4 +54,4 @@ package <empty> {
}
}

warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
2 changes: 1 addition & 1 deletion test/files/run/eta-expand-star2.check
@@ -1,2 +1,2 @@
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
hello
2 changes: 1 addition & 1 deletion test/files/run/existentials-in-compiler.scala
@@ -1,5 +1,5 @@
/*
* filter: inliner warning\(s\); re-run with -Yinline-warnings for details
* filter: inliner warnings; re-run with -Yinline-warnings for details
*/
import scala.tools.nsc._
import scala.tools.partest.CompilerTest
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/is-valid-num.scala
@@ -1,5 +1,5 @@
/*
* filter: inliner warning\(s\); re-run with -Yinline-warnings for details
* filter: inliner warnings; re-run with -Yinline-warnings for details
*/
object Test {
def x = BigInt("10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/iterator-from.scala
@@ -1,5 +1,5 @@
/* This file tests iteratorFrom, keysIteratorFrom, and valueIteratorFrom on various sorted sets and maps
* filter: inliner warning\(s\); re-run with -Yinline-warnings for details
* filter: inliner warnings; re-run with -Yinline-warnings for details
*/

import scala.util.{Random => R}
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/literals.check
@@ -1,4 +1,4 @@
warning: there were 5 deprecation warning(s); re-run with -deprecation for details
warning: there were 5 deprecation warnings; re-run with -deprecation for details
test '\u0024' == '$' was successful
test '\u005f' == '_' was successful
test 65.asInstanceOf[Char] == 'A' was successful
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/mapConserve.scala
@@ -1,5 +1,5 @@
/*
* filter: inliner warning\(s\); re-run with -Yinline-warnings for details
* filter: inliner warnings; re-run with -Yinline-warnings for details
*/
import scala.annotation.tailrec
import scala.collection.mutable.ListBuffer
Expand Down
2 changes: 1 addition & 1 deletion 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 warning(s); re-run with -deprecation for details
warning: there were 4 deprecation warnings; re-run with -deprecation for details
1: @
get: $
get: 2
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/pc-conversions.scala
@@ -1,5 +1,5 @@
/*
* filter: inliner warning\(s\); re-run with -Yinline-warnings for details
* filter: inliner warning; re-run with -Yinline-warnings for details
*/

import collection._
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/reflection-magicsymbols-repl.check
Expand Up @@ -21,7 +21,7 @@ scala> def test(n: Int): Unit = {
val x = sig.asInstanceOf[MethodType].params.head
println(x.info)
}
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
test: (n: Int)Unit

scala> for (i <- 1 to 8) test(i)
Expand Down
4 changes: 2 additions & 2 deletions test/files/run/repl-power.check
Expand Up @@ -11,11 +11,11 @@ scala> :power
scala> // guarding against "error: reference to global is ambiguous"

scala> global.emptyValDef // "it is imported twice in the same scope by ..."
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
res0: $r.global.noSelfType.type = private val _ = _

scala> val tp = ArrayClass[scala.util.Random] // magic with tags
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
tp: $r.global.Type = Array[scala.util.Random]

scala> tp.memberType(Array_apply) // evidence
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/richs.check
@@ -1,4 +1,4 @@
warning: there were 2 deprecation warning(s); re-run with -deprecation for details
warning: there were 2 deprecation warnings; re-run with -deprecation for details

RichCharTest1:
true
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/stringinterpolation_macro-run.scala
@@ -1,5 +1,5 @@
/*
* filter: inliner warning\(s\); re-run with -Yinline-warnings for details
* filter: inliner warnings; re-run with -Yinline-warnings for details
*/
object Test extends App {

Expand Down
2 changes: 1 addition & 1 deletion test/files/run/synchronized.check
@@ -1,4 +1,4 @@
warning: there were 14 inliner warning(s); re-run with -Yinline-warnings for details
warning: there were 14 inliner warnings; re-run with -Yinline-warnings for details
.|. c1.f1: OK
.|. c1.fi: OK
.|... c1.fv: OK
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t2212.check
@@ -1,4 +1,4 @@
warning: there were 2 deprecation warning(s); re-run with -deprecation for details
warning: there were 2 deprecation warnings; re-run with -deprecation for details
LinkedList(1)
LinkedList(1)
true
2 changes: 1 addition & 1 deletion test/files/run/t3361.check
@@ -1 +1 @@
warning: there were 16 deprecation warning(s); re-run with -deprecation for details
warning: there were 16 deprecation warnings; re-run with -deprecation for details
2 changes: 1 addition & 1 deletion test/files/run/t3888.check
@@ -1 +1 @@
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
2 changes: 1 addition & 1 deletion test/files/run/t3970.check
@@ -1 +1 @@
warning: there were 5 deprecation warning(s); re-run with -deprecation for details
warning: there were 5 deprecation warnings; re-run with -deprecation for details
2 changes: 1 addition & 1 deletion test/files/run/t3996.check
@@ -1 +1 @@
warning: there were 2 deprecation warning(s); re-run with -deprecation for details
warning: there were 2 deprecation warnings; re-run with -deprecation for details
2 changes: 1 addition & 1 deletion test/files/run/t4080.check
@@ -1,2 +1,2 @@
warning: there were 3 deprecation warning(s); re-run with -deprecation for details
warning: there were 3 deprecation warnings; re-run with -deprecation for details
LinkedList(1, 0, 2, 3)
2 changes: 1 addition & 1 deletion test/files/run/t4172.check
Expand Up @@ -2,7 +2,7 @@ Type in expressions to have them evaluated.
Type :help for more information.

scala> val c = { class C { override def toString = "C" }; ((new C, new C { def f = 2 })) }
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
c: (C, C{def f: Int}) forSome { type C <: AnyRef } = (C,C)

scala>
2 changes: 1 addition & 1 deletion test/files/run/t4461.check
@@ -1,4 +1,4 @@
warning: there were 4 deprecation warning(s); re-run with -deprecation for details
warning: there were 4 deprecation warnings; re-run with -deprecation for details
Include(End,1)
Include(End,2)
Include(End,3)
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t4594-repl-settings.scala
Expand Up @@ -11,7 +11,7 @@ object Test extends SessionTest {
|depp: String
|
|scala> def a = depp
|warning: there were 1 deprecation warning(s); re-run with -deprecation for details
|warning: there was one deprecation warning; re-run with -deprecation for details
|a: String
|
|scala> :settings +deprecation
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t4710.check
Expand Up @@ -2,7 +2,7 @@ Type in expressions to have them evaluated.
Type :help for more information.

scala> def method : String = { implicit def f(s: Symbol) = "" ; 'symbol }
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
method: String

scala>
2 changes: 1 addition & 1 deletion test/files/run/t4813.check
@@ -1 +1 @@
warning: there were 2 deprecation warning(s); re-run with -deprecation for details
warning: there were 2 deprecation warnings; re-run with -deprecation for details
2 changes: 1 addition & 1 deletion test/files/run/t5428.check
@@ -1,2 +1,2 @@
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
Stack(8, 7, 6, 5, 4, 3)
2 changes: 1 addition & 1 deletion test/files/run/t576.check
@@ -1,4 +1,4 @@
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
1
2
3
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t6028.check
Expand Up @@ -81,4 +81,4 @@ package <empty> {
}
}

warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
2 changes: 1 addition & 1 deletion test/files/run/t6292.check
@@ -1 +1 @@
warning: there were 7 deprecation warning(s); re-run with -deprecation for details
warning: there were 7 deprecation warnings; re-run with -deprecation for details
8 changes: 4 additions & 4 deletions test/files/run/t6329_repl.check
Expand Up @@ -5,28 +5,28 @@ scala> import scala.reflect.classTag
import scala.reflect.classTag

scala> classManifest[scala.List[_]]
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
res0: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[<?>]

scala> classTag[scala.List[_]]
res1: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List

scala> classManifest[scala.collection.immutable.List[_]]
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
res2: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[<?>]

scala> classTag[scala.collection.immutable.List[_]]
res3: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List

scala> classManifest[Predef.Set[_]]
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
res4: scala.reflect.ClassTag[scala.collection.immutable.Set[_]] = scala.collection.immutable.Set[<?>]

scala> classTag[Predef.Set[_]]
res5: scala.reflect.ClassTag[scala.collection.immutable.Set[_]] = scala.collection.immutable.Set

scala> classManifest[scala.collection.immutable.Set[_]]
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
res6: scala.reflect.ClassTag[scala.collection.immutable.Set[_]] = scala.collection.immutable.Set[<?>]

scala> classTag[scala.collection.immutable.Set[_]]
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t6329_repl_bug.check
Expand Up @@ -8,7 +8,7 @@ scala> import scala.reflect.runtime._
import scala.reflect.runtime._

scala> classManifest[List[_]]
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
res0: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[<?>]

scala> scala.reflect.classTag[List[_]]
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t6329_vanilla_bug.check
@@ -1,3 +1,3 @@
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
scala.collection.immutable.List[<?>]
scala.collection.immutable.List
2 changes: 1 addition & 1 deletion test/files/run/t6690.check
@@ -1 +1 @@
warning: there were 2 deprecation warning(s); re-run with -deprecation for details
warning: there were 2 deprecation warnings; re-run with -deprecation for details
2 changes: 1 addition & 1 deletion test/files/run/t6863.check
Expand Up @@ -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 warning(s); re-run with -deprecation for details
warning: there were 4 deprecation warnings; re-run with -deprecation for details
2 changes: 1 addition & 1 deletion test/files/run/t6935.check
@@ -1 +1 @@
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details
2 changes: 1 addition & 1 deletion test/files/run/t7096.scala
@@ -1,5 +1,5 @@
/*
* filter: inliner warning\(s\); re-run with -Yinline-warnings for details
* filter: inliner warning; re-run with -Yinline-warnings for details
*/
import scala.tools.partest._
import scala.tools.nsc._
Expand Down
6 changes: 3 additions & 3 deletions test/files/run/t7319.check
Expand Up @@ -5,15 +5,15 @@ scala> class M[A]
defined class M

scala> implicit def ma0[A](a: A): M[A] = null
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
ma0: [A](a: A)M[A]

scala> implicit def ma1[A](a: A): M[A] = null
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
ma1: [A](a: A)M[A]

scala> def convert[F[X <: F[X]]](builder: F[_ <: F[_]]) = 0
warning: there were 1 feature warning(s); re-run with -feature for details
warning: there was one feature warning; re-run with -feature for details
convert: [F[X <: F[X]]](builder: F[_ <: F[_]])Int

scala> convert(Some[Int](0))
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t7582.check
@@ -1,2 +1,2 @@
warning: there were 1 inliner warning(s); re-run with -Yinline-warnings for details
warning: there was one inliner warning; re-run with -Yinline-warnings for details
2
2 changes: 1 addition & 1 deletion test/files/run/t7582b.check
@@ -1,2 +1,2 @@
warning: there were 1 inliner warning(s); re-run with -Yinline-warnings for details
warning: there was one inliner warning; re-run with -Yinline-warnings for details
2
2 changes: 1 addition & 1 deletion test/files/run/unittest_collection.check
@@ -1 +1 @@
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
warning: there was one deprecation warning; re-run with -deprecation for details

1 comment on commit 26e6848

@scala-jenkins
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Job pr-scala failed for 26e6848 Took 87 min. (ping @huitseeker) (results):


To retry exactly this commit, comment "PLS REBUILD/pr-scala@26e68485706982c71ab8249aac56804847a71614" on PR 3419.
NOTE: New commits are rebuilt automatically as they appear. A forced rebuild is only necessary for transient failures.

Please sign in to comment.