diff --git a/tests/neg/i17612a.check b/tests/neg/i17612a.check index fad897b7c5f8..04a5b07b6e33 100644 --- a/tests/neg/i17612a.check +++ b/tests/neg/i17612a.check @@ -1,32 +1,32 @@ --- Error: tests/neg-custom-args/fatal-warnings/i17612a.scala:18:15 ----------------------------------------------------- +-- Error: tests/neg/i17612a.scala:18:15 -------------------------------------------------------------------------------- 18 | class Derived(x : Int, y: Int, z2: Int) extends Base(x, y + 1, z2): // error // error / for x, y translated to private[this] x field & shadowing var Base.x, Base.y | ^ | value x in class Derived shadows field x inherited from class Base --- Error: tests/neg-custom-args/fatal-warnings/i17612a.scala:18:24 ----------------------------------------------------- +-- Error: tests/neg/i17612a.scala:18:24 -------------------------------------------------------------------------------- 18 | class Derived(x : Int, y: Int, z2: Int) extends Base(x, y + 1, z2): // error // error / for x, y translated to private[this] x field & shadowing var Base.x, Base.y | ^ | value y in class Derived shadows field y inherited from class Base --- Error: tests/neg-custom-args/fatal-warnings/i17612a.scala:20:2 ------------------------------------------------------ +-- Error: tests/neg/i17612a.scala:20:2 --------------------------------------------------------------------------------- 20 | private val shadowed2 = 2 + 2 // error (In Scala 2 we cannot do that got the warning) | ^ | value shadowed2 in class Derived shadows field shadowed2 inherited from class Base --- Error: tests/neg-custom-args/fatal-warnings/i17612a.scala:21:2 ------------------------------------------------------ +-- Error: tests/neg/i17612a.scala:21:2 --------------------------------------------------------------------------------- 21 | private[this] val shadowed3 = 3 + 3 // error | ^ | value shadowed3 in class Derived shadows field shadowed3 inherited from class Base --- Error: tests/neg-custom-args/fatal-warnings/i17612a.scala:23:2 ------------------------------------------------------ +-- Error: tests/neg/i17612a.scala:23:2 --------------------------------------------------------------------------------- 23 | private val shadowed5 = 5 + 5 // error | ^ | value shadowed5 in class Derived shadows field shadowed5 inherited from class Base --- Error: tests/neg-custom-args/fatal-warnings/i17612a.scala:34:20 ----------------------------------------------------- +-- Error: tests/neg/i17612a.scala:34:20 -------------------------------------------------------------------------------- 34 | class UnderDerived(x: Int, y: Int, z: Int) extends Derived(x, y, z) // error // error // error | ^ | value x in class UnderDerived shadows field x inherited from class Base --- Error: tests/neg-custom-args/fatal-warnings/i17612a.scala:34:28 ----------------------------------------------------- +-- Error: tests/neg/i17612a.scala:34:28 -------------------------------------------------------------------------------- 34 | class UnderDerived(x: Int, y: Int, z: Int) extends Derived(x, y, z) // error // error // error | ^ | value y in class UnderDerived shadows field y inherited from class Base --- Error: tests/neg-custom-args/fatal-warnings/i17612a.scala:34:36 ----------------------------------------------------- +-- Error: tests/neg/i17612a.scala:34:36 -------------------------------------------------------------------------------- 34 | class UnderDerived(x: Int, y: Int, z: Int) extends Derived(x, y, z) // error // error // error | ^ | value z in class UnderDerived shadows field z inherited from class Base diff --git a/tests/neg/i17612a.scala b/tests/neg/i17612a.scala index 0fb6306b96cb..1145cd76edc0 100644 --- a/tests/neg/i17612a.scala +++ b/tests/neg/i17612a.scala @@ -1,4 +1,4 @@ -// scalac: -Xlint:private-shadow +//> using options -Xfatal-warnings -Xlint:private-shadow object i17612a: class Base(var x: Int, val y: Int, var z: Int): diff --git a/tests/neg/i17612b.check b/tests/neg/i17612b.check index 4d7215758fe0..75e8b7312833 100644 --- a/tests/neg/i17612b.check +++ b/tests/neg/i17612b.check @@ -1,32 +1,32 @@ --- Error: tests/neg-custom-args/fatal-warnings/i17612b/i17612b.scala:21:15 --------------------------------------------- +-- Error: tests/neg/i17612b/i17612b.scala:21:15 ------------------------------------------------------------------------ 21 | class Derived(x : Int, x3: Int, y: Int, z2: Int) extends BaseB, BaseC(x3), Base(x, y + 1, z2): // error // error / for x, y translated to private[this] x field & shadowing var Base.x, Base.y | ^ | value x in class Derived shadows field x inherited from trait Base --- Error: tests/neg-custom-args/fatal-warnings/i17612b/i17612b.scala:21:33 --------------------------------------------- +-- Error: tests/neg/i17612b/i17612b.scala:21:33 ------------------------------------------------------------------------ 21 | class Derived(x : Int, x3: Int, y: Int, z2: Int) extends BaseB, BaseC(x3), Base(x, y + 1, z2): // error // error / for x, y translated to private[this] x field & shadowing var Base.x, Base.y | ^ | value y in class Derived shadows field y inherited from trait Base --- Error: tests/neg-custom-args/fatal-warnings/i17612b/i17612b.scala:23:2 ---------------------------------------------- +-- Error: tests/neg/i17612b/i17612b.scala:23:2 ------------------------------------------------------------------------- 23 | private val shadowed2 = 2 + 2 // error (In Scala 2 we cannot do that got the warning) | ^ | value shadowed2 in class Derived shadows field shadowed2 inherited from trait Base --- Error: tests/neg-custom-args/fatal-warnings/i17612b/i17612b.scala:24:2 ---------------------------------------------- +-- Error: tests/neg/i17612b/i17612b.scala:24:2 ------------------------------------------------------------------------- 24 | private[this] val shadowed3 = 3 + 3 // error | ^ | value shadowed3 in class Derived shadows field shadowed3 inherited from trait Base --- Error: tests/neg-custom-args/fatal-warnings/i17612b/i17612b.scala:26:2 ---------------------------------------------- +-- Error: tests/neg/i17612b/i17612b.scala:26:2 ------------------------------------------------------------------------- 26 | private val shadowed5 = 5 + 5 // error | ^ | value shadowed5 in class Derived shadows field shadowed5 inherited from trait Base --- Error: tests/neg-custom-args/fatal-warnings/i17612b/i17612b.scala:41:20 --------------------------------------------- +-- Error: tests/neg/i17612b/i17612b.scala:41:20 ------------------------------------------------------------------------ 41 | class UnderDerived(x: Int, y: Int, z: Int) extends Derived(x, 1, y, z) // error // error // error | ^ | value x in class UnderDerived shadows field x inherited from trait Base --- Error: tests/neg-custom-args/fatal-warnings/i17612b/i17612b.scala:41:28 --------------------------------------------- +-- Error: tests/neg/i17612b/i17612b.scala:41:28 ------------------------------------------------------------------------ 41 | class UnderDerived(x: Int, y: Int, z: Int) extends Derived(x, 1, y, z) // error // error // error | ^ | value y in class UnderDerived shadows field y inherited from trait Base --- Error: tests/neg-custom-args/fatal-warnings/i17612b/i17612b.scala:41:36 --------------------------------------------- +-- Error: tests/neg/i17612b/i17612b.scala:41:36 ------------------------------------------------------------------------ 41 | class UnderDerived(x: Int, y: Int, z: Int) extends Derived(x, 1, y, z) // error // error // error | ^ | value z in class UnderDerived shadows field z inherited from trait Base diff --git a/tests/neg/i17612b/i17612b.scala b/tests/neg/i17612b/i17612b.scala index 95964edbb197..b59352f562d0 100644 --- a/tests/neg/i17612b/i17612b.scala +++ b/tests/neg/i17612b/i17612b.scala @@ -1,4 +1,4 @@ -// scalac: -Xlint:private-shadow +//> using options -Xfatal-warnings -Xlint:private-shadow object i17612b: diff --git a/tests/neg/i17613a.check b/tests/neg/i17613a.check index b0aeb85101a1..4721b786c82d 100644 --- a/tests/neg/i17613a.check +++ b/tests/neg/i17613a.check @@ -1,28 +1,28 @@ --- Error: tests/neg-custom-args/fatal-warnings/i17613a.scala:8:13 ------------------------------------------------------ +-- Error: tests/neg/i17613a.scala:8:13 --------------------------------------------------------------------------------- 8 | def foobar[D](in: D) = in.toString // error method parameter shadows some other type | ^ | Type parameter D for method foobar shadows the type defined by trait D in class B --- Error: tests/neg-custom-args/fatal-warnings/i17613a.scala:9:13 ------------------------------------------------------ +-- Error: tests/neg/i17613a.scala:9:13 --------------------------------------------------------------------------------- 9 | type MySeq[D] = Seq[D] // error type member's parameter shadows some other type | ^ | Type parameter D for type MySeq shadows the type defined by trait D in class B --- Error: tests/neg-custom-args/fatal-warnings/i17613a.scala:11:12 ----------------------------------------------------- +-- Error: tests/neg/i17613a.scala:11:12 -------------------------------------------------------------------------------- 11 | class Foo[T](t: T): // error class parameter shadows some other type | ^ | Type parameter T for class Foo shadows the type defined by type T in class B --- Error: tests/neg-custom-args/fatal-warnings/i17613a.scala:12:11 ----------------------------------------------------- +-- Error: tests/neg/i17613a.scala:12:11 -------------------------------------------------------------------------------- 12 | def bar[T](w: T) = w.toString // error a type parameter shadows another type parameter | ^ | Type parameter T for method bar shadows the type defined by type T in class Foo --- Error: tests/neg-custom-args/fatal-warnings/i17613a.scala:15:12 ----------------------------------------------------- +-- Error: tests/neg/i17613a.scala:15:12 -------------------------------------------------------------------------------- 15 | class C[M[List[_]]] // error | ^^^^^^^ | Type parameter List for class C shadows the type defined by type List in package scala --- Error: tests/neg-custom-args/fatal-warnings/i17613a.scala:16:11 ----------------------------------------------------- +-- Error: tests/neg/i17613a.scala:16:11 -------------------------------------------------------------------------------- 16 | type E[M[List[_]]] = Int // error | ^^^^^^^ | Type parameter List for type E shadows the type defined by type List in package scala --- Error: tests/neg-custom-args/fatal-warnings/i17613a.scala:17:14 ----------------------------------------------------- +-- Error: tests/neg/i17613a.scala:17:14 -------------------------------------------------------------------------------- 17 | def foo[N[M[List[_]]]] = ??? // error | ^^^^^^^ | Type parameter List for method foo shadows the type defined by type List in package scala diff --git a/tests/neg/i17613a.scala b/tests/neg/i17613a.scala index 4639bd4b5053..d0e413098cec 100644 --- a/tests/neg/i17613a.scala +++ b/tests/neg/i17613a.scala @@ -1,23 +1,23 @@ -// scalac: -Xlint:type-parameter-shadow +//> using options -Xfatal-warnings -Xlint:type-parameter-shadow object i17613a: class B: type T = Int trait D - + def foobar[D](in: D) = in.toString // error method parameter shadows some other type type MySeq[D] = Seq[D] // error type member's parameter shadows some other type - + class Foo[T](t: T): // error class parameter shadows some other type def bar[T](w: T) = w.toString // error a type parameter shadows another type parameter - + // even deeply nested... class C[M[List[_]]] // error type E[M[List[_]]] = Int // error def foo[N[M[List[_]]]] = ??? // error // ...but not between type parameters in the same list - class F[A, M[N[A]]] + class F[A, M[N[A]]] type G[A, M[L[A]]] = Int def bar[A, N[M[L[A]]]] = ??? def main(args: Array[String]) = println("Test for type parameter shadow") diff --git a/tests/neg/i17613b.check b/tests/neg/i17613b.check index 2bde162ac51e..d8cf8618fb27 100644 --- a/tests/neg/i17613b.check +++ b/tests/neg/i17613b.check @@ -1,56 +1,56 @@ --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:9:13 ---------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:9:13 ------------------------------------------------------------------------- 9 | def foobar[ImTrait](in: D) = in.toString // error | ^^^^^^^ | Type parameter ImTrait for method foobar shadows the type defined by trait ImTrait in object importTry --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:10:13 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:10:13 ------------------------------------------------------------------------ 10 | type MySeq[ImTrait] = Seq[D] // error | ^^^^^^^ | Type parameter ImTrait for type MySeq shadows the type defined by trait ImTrait in object importTry --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:12:14 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:12:14 ------------------------------------------------------------------------ 12 | def foobar2[ImClass](in: D) = in.toString // error | ^^^^^^^ | Type parameter ImClass for method foobar2 shadows the type defined by class ImClass in object importTry --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:13:14 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:13:14 ------------------------------------------------------------------------ 13 | type MySeq2[ImClass] = Seq[D] // error | ^^^^^^^ | Type parameter ImClass for type MySeq2 shadows the type defined by class ImClass in object importTry --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:16:24 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:16:24 ------------------------------------------------------------------------ 16 | type TypeLambda[A] = [ImTrait] =>> Map[ImTrait, B] // error | ^^^^^^^ | Type parameter ImTrait for type TypeLambda shadows the type defined by trait ImTrait in object importTry --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:17:21 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:17:21 ------------------------------------------------------------------------ 17 | type PolyFun[A] = [ImTrait] => ImTrait => B // error | ^^^^^^^ | Type parameter ImTrait for type PolyFun shadows the type defined by trait ImTrait in object importTry --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:23:12 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:23:12 ------------------------------------------------------------------------ 23 | class Foo[T](t: T): // error class parameter shadows some other type | ^ | Type parameter T for class Foo shadows the type defined by type T in class B --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:27:15 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:27:15 ------------------------------------------------------------------------ 27 | def intType[List1](x: T) = x.toString() // error | ^^^^^ | Type parameter List1 for method intType shadows an explicitly renamed type : List1 --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:32:10 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:32:10 ------------------------------------------------------------------------ 32 | given [Int]: Ordering[Int]() // error | ^^^ | Type parameter Int for method given_Ordering_Int shadows the type defined by class Int in package scala --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:34:12 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:34:12 ------------------------------------------------------------------------ 34 | class C[M[List[_]]] // error List not renamed here | ^^^^^^^ | Type parameter List for class C shadows the type defined by type List in package scala --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:35:11 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:35:11 ------------------------------------------------------------------------ 35 | type E[M[Int[_]]] = Int // error | ^^^^^^ | Type parameter Int for type E shadows the type defined by class Int in package scala --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:37:14 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:37:14 ------------------------------------------------------------------------ 37 | def foo[N[M[List[_]]]] = // error | ^^^^^^^ | Type parameter List for method foo shadows the type defined by type List in package scala --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:40:11 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:40:11 ------------------------------------------------------------------------ 40 | type Z[ImClassR] = Int // error | ^^^^^^^^ | Type parameter ImClassR for type Z shadows an explicitly renamed type : ImClassR --- Error: tests/neg-custom-args/fatal-warnings/i17613b/i17613b.scala:41:18 --------------------------------------------- +-- Error: tests/neg/i17613b/i17613b.scala:41:18 ------------------------------------------------------------------------ 41 | class InnerCl[ImClassR] // error | ^^^^^^^^ | Type parameter ImClassR for class InnerCl shadows an explicitly renamed type : ImClassR diff --git a/tests/neg/i17613b/i17613b.scala b/tests/neg/i17613b/i17613b.scala index 9eeef7c29997..b0c4f11b949c 100644 --- a/tests/neg/i17613b/i17613b.scala +++ b/tests/neg/i17613b/i17613b.scala @@ -1,4 +1,4 @@ -// scalac: -Xlint:type-parameter-shadow +//> using options -Xfatal-warnings -Xlint:type-parameter-shadow object i17613b: import importTry._ @@ -41,4 +41,4 @@ object i17613b: class InnerCl[ImClassR] // error 5 - def main(args: Array[String]) = println("Test for type parameter shadow") + def main(args: Array[String]) = println("Test for type parameter shadow") \ No newline at end of file