Skip to content

Commit bc4c565

Browse files
Merge pull request #7527 from BluePat/issue-7355-integers-in-errors
Issue-7355: Integers in errors and warnings
2 parents 0a33ad3 + 5ac37bb commit bc4c565

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+47
-50
lines changed

compiler/src/dotty/tools/dotc/reporting/Reporter.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,7 @@ abstract class Reporter extends interfaces.ReporterResult {
307307
/** Returns a string meaning "n elements". */
308308
protected def countString(n: Int, elements: String): String = n match {
309309
case 0 => s"no ${elements}s"
310-
case 1 => s"one ${elements}"
311-
case 2 => s"two ${elements}s"
312-
case 3 => s"three ${elements}s"
313-
case 4 => s"four ${elements}s"
310+
case 1 => s"1 ${elements}"
314311
case _ => s"$n ${elements}s"
315312
}
316313

tests/untried/neg/abstract-explaintypes.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ abstract-explaintypes.scala:9: error: type mismatch;
1212
^
1313
A <: A.this.T?
1414
false
15-
two errors found
15+
2 errors found

tests/untried/neg/abstract.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ abstract.scala:9: error: type mismatch;
88
required: A.this.T
99
def foo5: T = baz().baz();
1010
^
11-
two errors found
11+
2 errors found

tests/untried/neg/annot-nonconst.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ annot-nonconst.scala:6: error: annotation argument needs to be a constant; found
1414
annot-nonconst.scala:7: error: annotation argument cannot be null
1515
@Ann2(null) def bar = "bar"
1616
^
17-
two warnings found
18-
two errors found
17+
2 warnings found
18+
2 errors found

tests/untried/neg/case-collision2.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ case-collision2.scala:11: warning: Class foo.HyRaX$ differs only in case from fo
88
object HyRaX
99
^
1010
error: No warnings can be incurred under -Xfatal-warnings.
11-
three warnings found
12-
one error found
11+
3 warnings found
12+
1 error found

tests/untried/neg/cycle-bounds.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
cycle-bounds.scala:5: error: illegal cyclic reference involving type T
22
class NotOk[T <: Comparable[_ <: T]]
33
^
4-
one error found
4+
1 error found

tests/untried/neg/mixins.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ mixins.scala:9: error: illegal inheritance; superclass C
33
of the mixin trait M
44
class D extends C with M
55
^
6-
one error found
6+
1 error found
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
object-not-a-value.scala:5: error: object java.util.List is not a value
22
List(1) map (_ + 1)
33
^
4-
one error found
4+
1 error found

tests/untried/neg/switch.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ switch.scala:45: warning: could not emit switch for @switch annotated match
55
def fail3(c: Char) = (c: @unchecked @switch) match {
66
^
77
error: No warnings can be incurred under -Xfatal-warnings.
8-
two warnings found
9-
one error found
8+
2 warnings found
9+
1 error found

tests/untried/neg/t0351.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
t0351.scala:2: error: no by-name parameter type allowed here
22
def identity[T](x : => T) : (=> T)
33
^
4-
one error found
4+
1 error found

tests/untried/neg/t0503.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ val x = new { } with { }
44
t0503.scala:3: error: expected class or object definition
55
val y = new { } with A
66
^
7-
two errors found
7+
2 errors found

tests/untried/neg/t1548.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
S.scala:2: error: method defaultMethod overrides nothing
22
override def defaultMethod = "Boo!"
33
^
4-
one error found
4+
1 error found

tests/untried/neg/t1623.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
t1623.scala:11: error: class BImpl cannot be instantiated because it does not conform to its self-type test.BImpl with test.A
22
val b = new BImpl
33
^
4-
one error found
4+
1 error found

tests/untried/neg/t200.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ t200.scala:7: error: method foo is defined twice
22
conflicting symbols both originated in file 't200.scala'
33
def foo: Int;
44
^
5-
one error found
5+
1 error found

tests/untried/neg/t2441.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
t2441.scala:12: error: private class Y escapes its defining scope as part of type Some[B.Y]
22
override def f = Some(new B.Y)
33
^
4-
one error found
4+
1 error found

tests/untried/neg/t2773.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ t2773.scala:5: error: value x is not a member of C
44
t2773.scala:6: error: not found: value x
55
println(x)
66
^
7-
two errors found
7+
2 errors found

tests/untried/neg/t3453.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ t3453.scala:64: error: type mismatch;
1818
required: B
1919
new A
2020
^
21-
four errors found
21+
4 errors found

tests/untried/neg/t3649.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ object U { class C(val s: String = ""); val C = new C() {} }
77
t3649.scala:2: error: not enough arguments for constructor C: (s: String)U.C
88
object U { class C(val s: String = ""); val C = new C() {} }
99
^
10-
three errors found
10+
3 errors found

tests/untried/neg/t3683b.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Note: Foo >: Bar (and X <: W[Foo]), but trait W is invariant in type T.
55
You may wish to define T as -T instead. (SLS 4.5)
66
case X() => 1
77
^
8-
one error found
8+
1 error found

tests/untried/neg/t3714-neg.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ t3714-neg.scala:25: error: value break in class BreakImpl cannot be accessed in
1010
class BreakImpl where target is defined
1111
case b: BreakImpl => b.break
1212
^
13-
two errors found
13+
2 errors found

tests/untried/neg/t3873.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ t3873.scala:11: error: type mismatch;
33
required: a.B where val a: A
44
wrongf(new A)(a.b) // should not compile
55
^
6-
one error found
6+
1 error found

tests/untried/neg/t421.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
t421.scala:5: error: star patterns must correspond with varargs parameters
22
case Bar("foo",_*) => sys.error("huh?");
33
^
4-
one error found
4+
1 error found

tests/untried/neg/t4460b.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
t4460b.scala:7: error: called constructor's definition must precede calling constructor's definition
22
def this() = this() // was binding to Predef.<init> !!
33
^
4-
one error found
4+
1 error found

tests/untried/neg/t4728.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ and method f in object Ambiguous of type (x: X)Int
44
match argument types (Y) and expected result type Any
55
println(Ambiguous.f(new Y))
66
^
7-
one error found
7+
1 error found

tests/untried/neg/t5578.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ t5578.scala:33: error: type mismatch;
44
(which expands to) NumericOpsExp.this.Exp[T]
55
def plus[T: Numeric](x: Rep[T], y: Rep[T]): Rep[T] = Plus[T](x,y)
66
^
7-
one error found
7+
1 error found

tests/untried/neg/t562.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
t562.scala:10: error: super may be not be used on value y
22
override val y = super.y;
33
^
4-
one error found
4+
1 error found

tests/untried/neg/t585.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
t585.scala:1: error: unclosed comment
22
/*
33
^
4-
one error found
4+
1 error found

tests/untried/neg/t6558.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ t6558.scala:7: error: not found: type typeparam
77
t6558.scala:10: error: not found: type valueparam
88
@valueparam x: Any
99
^
10-
three errors found
10+
3 errors found

tests/untried/neg/t6566b.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
t6566b.scala:3: error: covariant type T occurs in invariant position in type T of type MyType
22
type MyType = T
33
^
4-
one error found
4+
1 error found

tests/untried/neg/t6963a.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ The behavior of `scanRight` has changed. The previous behavior can be reproduced
33
List(1,2,3,4,5).scanRight(0)(_+_)
44
^
55
error: No warnings can be incurred under -Xfatal-warnings.
6-
one warning found
7-
one error found
6+
1 warning found
7+
1 error found

tests/untried/neg/t7007.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ t7007.scala:5: error: Implementation restriction: <$anon: A => B> requires prema
44
t7007.scala:5: error: Implementation restriction: <$anon: A => B> requires premature access to class Crash.
55
def this(a: Seq[A]) = this(a.collect{ case b: B => b}, a.collect{ case b: B => b})
66
^
7-
two errors found
7+
2 errors found

tests/untried/neg/t7110.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ t7110.scala:2: warning: A try without a catch or finally is equivalent to puttin
22
try { ??? } // warn
33
^
44
error: No warnings can be incurred under -Xfatal-warnings.
5-
one warning found
6-
one error found
5+
1 warning found
6+
1 error found

tests/untried/neg/t7475e.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
t7475e.scala:8: error: value priv is not a member of Base.this.TT
22
(??? : TT).priv
33
^
4-
one error found
4+
1 error found

tests/untried/neg/t7519.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ t7519.scala:15: error: type mismatch;
88
required: String
99
locally(0 : String) // was: "value conversion is not a member of U"
1010
^
11-
two errors found
11+
2 errors found
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
error: Missing required plugin: special-plugin
2-
one error found
2+
1 error found

tests/untried/neg/t765.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
t765.scala:3: error: not found: type Bar123
22
val bar = new Bar123
33
^
4-
one error found
4+
1 error found

tests/untried/neg/t7669.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ It would fail on the following input: NotHandled(_)
33
def exhausto(expr: Expr): Unit = expr match {
44
^
55
error: No warnings can be incurred under -Xfatal-warnings.
6-
one warning found
7-
one error found
6+
1 warning found
7+
1 error found

tests/untried/neg/t8143a.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ t8143a.scala:2: error: overriding method f in class Foo of type => Int;
22
method f has weaker access privileges; it should not be private
33
class Bar extends Foo { private def f = 10 }
44
^
5-
one error found
5+
1 error found

tests/untried/neg/tcpoly_variance.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ tcpoly_variance.scala:6: error: overriding method str in class A of type => m[Ob
22
method str has incompatible type
33
override def str: m[String] = sys.error("foo") // since x in m[x] is invariant, ! m[String] <: m[Object]
44
^
5-
one error found
5+
1 error found

tests/untried/neg/unchecked-abstract.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ unchecked-abstract.scala:37: warning: abstract type T in type Invariant[M.this.T
2424
^
2525
error: No warnings can be incurred under -Xfatal-warnings.
2626
8 warnings found
27-
one error found
27+
1 error found

tests/untried/neg/varargs.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ varargs.scala:19: error: A method without repeated parameters cannot be annotate
77
varargs.scala:21: error: A method with a varargs annotation produces a forwarder method with the same signature (a: Int, b: Array[String])Int as an existing method.
88
@varargs def v2(a: Int, b: String*) = 0
99
^
10-
three errors found
10+
3 errors found

0 commit comments

Comments
 (0)