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

0 commit comments

Comments
 (0)