Skip to content

Issue-7355: Integers in errors and warnings #7527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions compiler/src/dotty/tools/dotc/reporting/Reporter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,7 @@ abstract class Reporter extends interfaces.ReporterResult {
/** Returns a string meaning "n elements". */
protected def countString(n: Int, elements: String): String = n match {
case 0 => s"no ${elements}s"
case 1 => s"one ${elements}"
case 2 => s"two ${elements}s"
case 3 => s"three ${elements}s"
case 4 => s"four ${elements}s"
case 1 => s"1 ${elements}"
case _ => s"$n ${elements}s"
}

Expand Down
2 changes: 1 addition & 1 deletion tests/untried/neg/abstract-explaintypes.check
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ abstract-explaintypes.scala:9: error: type mismatch;
^
A <: A.this.T?
false
two errors found
2 errors found
2 changes: 1 addition & 1 deletion tests/untried/neg/abstract.check
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ abstract.scala:9: error: type mismatch;
required: A.this.T
def foo5: T = baz().baz();
^
two errors found
2 errors found
4 changes: 2 additions & 2 deletions tests/untried/neg/annot-nonconst.check
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ annot-nonconst.scala:6: error: annotation argument needs to be a constant; found
annot-nonconst.scala:7: error: annotation argument cannot be null
@Ann2(null) def bar = "bar"
^
two warnings found
two errors found
2 warnings found
2 errors found
4 changes: 2 additions & 2 deletions tests/untried/neg/case-collision2.check
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ case-collision2.scala:11: warning: Class foo.HyRaX$ differs only in case from fo
object HyRaX
^
error: No warnings can be incurred under -Xfatal-warnings.
three warnings found
one error found
3 warnings found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/cycle-bounds.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cycle-bounds.scala:5: error: illegal cyclic reference involving type T
class NotOk[T <: Comparable[_ <: T]]
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/mixins.check
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ mixins.scala:9: error: illegal inheritance; superclass C
of the mixin trait M
class D extends C with M
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/object-not-a-value.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
object-not-a-value.scala:5: error: object java.util.List is not a value
List(1) map (_ + 1)
^
one error found
1 error found
4 changes: 2 additions & 2 deletions tests/untried/neg/switch.check
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ switch.scala:45: warning: could not emit switch for @switch annotated match
def fail3(c: Char) = (c: @unchecked @switch) match {
^
error: No warnings can be incurred under -Xfatal-warnings.
two warnings found
one error found
2 warnings found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t0351.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t0351.scala:2: error: no by-name parameter type allowed here
def identity[T](x : => T) : (=> T)
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t0503.check
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ val x = new { } with { }
t0503.scala:3: error: expected class or object definition
val y = new { } with A
^
two errors found
2 errors found
2 changes: 1 addition & 1 deletion tests/untried/neg/t1548.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
S.scala:2: error: method defaultMethod overrides nothing
override def defaultMethod = "Boo!"
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t1623.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t1623.scala:11: error: class BImpl cannot be instantiated because it does not conform to its self-type test.BImpl with test.A
val b = new BImpl
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t200.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ t200.scala:7: error: method foo is defined twice
conflicting symbols both originated in file 't200.scala'
def foo: Int;
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t2441.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t2441.scala:12: error: private class Y escapes its defining scope as part of type Some[B.Y]
override def f = Some(new B.Y)
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t2773.check
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ t2773.scala:5: error: value x is not a member of C
t2773.scala:6: error: not found: value x
println(x)
^
two errors found
2 errors found
2 changes: 1 addition & 1 deletion tests/untried/neg/t3453.check
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ t3453.scala:64: error: type mismatch;
required: B
new A
^
four errors found
4 errors found
2 changes: 1 addition & 1 deletion tests/untried/neg/t3649.check
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ object U { class C(val s: String = ""); val C = new C() {} }
t3649.scala:2: error: not enough arguments for constructor C: (s: String)U.C
object U { class C(val s: String = ""); val C = new C() {} }
^
three errors found
3 errors found
2 changes: 1 addition & 1 deletion tests/untried/neg/t3683b.check
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Note: Foo >: Bar (and X <: W[Foo]), but trait W is invariant in type T.
You may wish to define T as -T instead. (SLS 4.5)
case X() => 1
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t3714-neg.check
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ t3714-neg.scala:25: error: value break in class BreakImpl cannot be accessed in
class BreakImpl where target is defined
case b: BreakImpl => b.break
^
two errors found
2 errors found
2 changes: 1 addition & 1 deletion tests/untried/neg/t3873.check
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ t3873.scala:11: error: type mismatch;
required: a.B where val a: A
wrongf(new A)(a.b) // should not compile
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t421.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t421.scala:5: error: star patterns must correspond with varargs parameters
case Bar("foo",_*) => sys.error("huh?");
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t4460b.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t4460b.scala:7: error: called constructor's definition must precede calling constructor's definition
def this() = this() // was binding to Predef.<init> !!
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t4728.check
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ and method f in object Ambiguous of type (x: X)Int
match argument types (Y) and expected result type Any
println(Ambiguous.f(new Y))
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t5578.check
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ t5578.scala:33: error: type mismatch;
(which expands to) NumericOpsExp.this.Exp[T]
def plus[T: Numeric](x: Rep[T], y: Rep[T]): Rep[T] = Plus[T](x,y)
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t562.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t562.scala:10: error: super may be not be used on value y
override val y = super.y;
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t585.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t585.scala:1: error: unclosed comment
/*
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t6558.check
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ t6558.scala:7: error: not found: type typeparam
t6558.scala:10: error: not found: type valueparam
@valueparam x: Any
^
three errors found
3 errors found
2 changes: 1 addition & 1 deletion tests/untried/neg/t6566b.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t6566b.scala:3: error: covariant type T occurs in invariant position in type T of type MyType
type MyType = T
^
one error found
1 error found
4 changes: 2 additions & 2 deletions tests/untried/neg/t6963a.check
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ The behavior of `scanRight` has changed. The previous behavior can be reproduced
List(1,2,3,4,5).scanRight(0)(_+_)
^
error: No warnings can be incurred under -Xfatal-warnings.
one warning found
one error found
1 warning found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t7007.check
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ t7007.scala:5: error: Implementation restriction: <$anon: A => B> requires prema
t7007.scala:5: error: Implementation restriction: <$anon: A => B> requires premature access to class Crash.
def this(a: Seq[A]) = this(a.collect{ case b: B => b}, a.collect{ case b: B => b})
^
two errors found
2 errors found
4 changes: 2 additions & 2 deletions tests/untried/neg/t7110.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ t7110.scala:2: warning: A try without a catch or finally is equivalent to puttin
try { ??? } // warn
^
error: No warnings can be incurred under -Xfatal-warnings.
one warning found
one error found
1 warning found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t7475e.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t7475e.scala:8: error: value priv is not a member of Base.this.TT
(??? : TT).priv
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t7519.check
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ t7519.scala:15: error: type mismatch;
required: String
locally(0 : String) // was: "value conversion is not a member of U"
^
two errors found
2 errors found
2 changes: 1 addition & 1 deletion tests/untried/neg/t7622-missing-required.check
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
error: Missing required plugin: special-plugin
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t765.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t765.scala:3: error: not found: type Bar123
val bar = new Bar123
^
one error found
1 error found
4 changes: 2 additions & 2 deletions tests/untried/neg/t7669.check
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ It would fail on the following input: NotHandled(_)
def exhausto(expr: Expr): Unit = expr match {
^
error: No warnings can be incurred under -Xfatal-warnings.
one warning found
one error found
1 warning found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/t8143a.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ t8143a.scala:2: error: overriding method f in class Foo of type => Int;
method f has weaker access privileges; it should not be private
class Bar extends Foo { private def f = 10 }
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/tcpoly_variance.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ tcpoly_variance.scala:6: error: overriding method str in class A of type => m[Ob
method str has incompatible type
override def str: m[String] = sys.error("foo") // since x in m[x] is invariant, ! m[String] <: m[Object]
^
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/unchecked-abstract.check
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ unchecked-abstract.scala:37: warning: abstract type T in type Invariant[M.this.T
^
error: No warnings can be incurred under -Xfatal-warnings.
8 warnings found
one error found
1 error found
2 changes: 1 addition & 1 deletion tests/untried/neg/varargs.check
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ varargs.scala:19: error: A method without repeated parameters cannot be annotate
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.
@varargs def v2(a: Int, b: String*) = 0
^
three errors found
3 errors found