-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change options line for tests/neg folder
[Cherry-picked 1db2afb]
- Loading branch information
1 parent
830ed0f
commit 2f81430
Showing
8 changed files
with
46 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// scalac: -Xlint:private-shadow | ||
//> using options -Xfatal-warnings -Xlint:private-shadow | ||
|
||
object i17612b: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters