From a9a67d5abdd89a876661e7d04fd074c183acb037 Mon Sep 17 00:00:00 2001 From: Szymon Rodziewicz Date: Fri, 3 Nov 2023 14:42:23 +0100 Subject: [PATCH] Move warn tests to warn --- tests/neg-deep-subtype/i3324.scala | 8 -------- tests/neg/i10994.scala | 6 ------ tests/neg/i11963a.scala | 5 ----- tests/neg/i11963b.scala | 5 ----- tests/neg/i11963c.scala | 10 ---------- tests/neg/i14705.scala | 7 ------- tests/neg/i2673.scala | 8 -------- tests/neg/i2673b.scala | 8 -------- tests/neg/i2673c.scala | 10 ---------- tests/neg/i4936b.scala | 5 ----- tests/neg/i6190b.scala | 7 ------- tests/neg/i9266.scala | 7 ------- tests/neg/i9751.scala | 12 ------------ tests/neg/manifest-summoning-b.scala | 5 ----- tests/neg/old-syntax.scala | 6 ------ tests/neg/ovlazy.scala | 10 ---------- tests/{neg => warn}/14034b.scala | 5 ++--- tests/{neg-deep-subtype => warn}/1828.scala | 4 +--- tests/{neg-deep-subtype => warn}/3324b.scala | 5 ++--- tests/{neg-deep-subtype => warn}/3324f.scala | 5 ++--- tests/{neg-deep-subtype => warn}/3324g.scala | 5 ++--- tests/{neg => warn}/IsInstanceOfClassTag2.scala | 3 +-- .../{neg-deep-subtype => warn}/JavaSeqLiteral.scala | 4 +--- tests/{neg => warn}/avoid-warn-deprecation.scala | 5 ++--- .../conditionalWarnings.scala | 5 ++--- tests/{neg => warn}/convertible.scala | 5 ++--- tests/{neg => warn}/deprecated-override.scala | 5 ++--- tests/{neg => warn}/feature-shadowing.scala | 3 +-- tests/{neg => warn}/gadt-contradictory-pattern.scala | 5 ++--- tests/{neg-deep-subtype => warn}/gadt.scala | 4 +--- tests/{neg-deep-subtype => warn}/html.scala | 4 +--- tests/{neg => warn}/i10247.scala | 5 ++--- tests/{neg => warn}/i10930.scala | 5 ++--- tests/warn/i10994.scala | 5 +++++ tests/{neg => warn}/i11022.scala | 5 ++--- tests/{neg => warn}/i11097.scala | 5 ++--- tests/{neg => warn}/i11225b.scala | 3 +-- tests/{neg => warn}/i11333.scala | 5 ++--- tests/{neg => warn}/i11344.scala | 3 +-- tests/warn/i11963a.scala | 4 ++++ tests/warn/i11963b.scala | 4 ++++ tests/warn/i11963c.scala | 8 ++++++++ tests/{neg => warn}/i12253.scala | 4 +--- tests/{neg => warn}/i12597.scala | 3 +-- tests/{neg => warn}/i13011.scala | 5 ++--- tests/{neg => warn}/i13440.scala | 5 ++--- tests/{neg => warn}/i13542.scala | 5 ++--- tests/warn/i14705.scala | 6 ++++++ tests/{neg => warn}/i14721.scala | 3 +-- tests/{neg => warn}/i15474.scala | 5 ++--- tests/{neg => warn}/i15479.scala | 4 +--- tests/{neg => warn}/i15503a.scala | 5 ++--- tests/{neg => warn}/i15503b.scala | 5 ++--- tests/{neg => warn}/i15503c.scala | 5 ++--- tests/{neg => warn}/i15503d.scala | 5 ++--- tests/{neg => warn}/i15503e.scala | 5 ++--- tests/{neg => warn}/i15503f.scala | 4 +--- tests/{neg => warn}/i15503g.scala | 5 ++--- tests/{neg => warn}/i15503h.scala | 5 ++--- tests/{neg => warn}/i15503j.scala | 5 ++--- tests/{neg => warn}/i15662.scala | 4 +--- tests/{neg => warn}/i16639a.scala | 5 ++--- tests/{neg => warn}/i16649-refutable.scala | 3 +-- tests/{neg => warn}/i16728.scala | 4 +--- tests/{neg => warn}/i16930.scala | 5 ++--- tests/{neg => warn}/i17314b.scala | 3 +-- tests/{neg => warn}/i17612a.scala | 5 ++--- tests/{neg => warn}/i17613a.scala | 5 ++--- tests/{neg => warn}/i2333.scala | 5 ++--- tests/warn/i2673.scala | 6 ++++++ tests/warn/i2673b.scala | 7 +++++++ tests/warn/i2673c.scala | 9 +++++++++ tests/warn/i3324.scala | 6 ++++++ tests/{neg => warn}/i3561.scala | 5 ++--- tests/{neg => warn}/i4008.scala | 5 ++--- tests/{neg-deep-subtype => warn}/i4297.scala | 5 ++--- tests/{neg => warn}/i4364.scala | 4 +--- tests/warn/i4936b.scala | 3 +++ tests/{neg => warn}/i4986b.scala | 5 ++--- tests/{neg => warn}/i5013.scala | 5 ++--- tests/{neg => warn}/i5013b.scala | 3 +-- tests/warn/i6190b.scala | 6 ++++++ tests/{neg => warn}/i7314.scala | 4 +--- tests/{neg => warn}/i7821.scala | 3 +-- tests/{neg => warn}/i7821b.scala | 5 ++--- tests/{neg => warn}/i8427.scala | 3 +-- tests/{neg => warn}/i8781b.scala | 3 +-- tests/{neg => warn}/i8922b.scala | 4 +--- tests/{neg => warn}/i9166.scala | 3 +-- tests/{neg => warn}/i9241.scala | 5 ++--- tests/warn/i9266.scala | 6 ++++++ tests/{neg => warn}/i9408a.scala | 5 ++--- tests/{neg => warn}/i9740.scala | 5 ++--- tests/{neg => warn}/i9740b.scala | 5 ++--- tests/{neg => warn}/i9740c.scala | 3 +-- tests/{neg => warn}/i9740d.scala | 3 +-- tests/warn/i9751.scala | 11 +++++++++++ tests/{neg => warn}/i9776.scala | 5 ++--- tests/{neg => warn}/i9880.scala | 5 ++--- tests/{neg => warn}/implicit-conversions-old.scala | 5 ++--- tests/{neg => warn}/implicit-conversions.scala | 5 ++--- tests/{neg => warn}/infix.scala | 5 ++--- tests/{neg => warn}/inline-givens.scala | 5 ++--- tests/{neg => warn}/main-functions-nameclash.scala | 4 +--- tests/warn/manifest-summoning-b.scala | 4 ++++ tests/{neg => warn}/matchable.scala | 5 ++--- tests/{neg => warn}/newline-braces.scala | 3 +-- tests/{neg => warn}/nonunit-statement.scala | 5 ++--- tests/warn/old-syntax.scala | 5 +++++ tests/{neg => warn}/opaque-match.scala | 5 ++--- tests/{neg-deep-subtype => warn}/or-type-trees.scala | 5 ++--- tests/warn/ovlazy.scala | 9 +++++++++ tests/{neg => warn}/quote-simple-hole.scala | 5 ++--- tests/{neg-deep-subtype => warn}/refined-types.scala | 5 ++--- tests/{neg => warn}/refinements-this.scala | 3 +-- .../{neg => warn}/strict-pattern-bindings-3.2.scala | 5 ++--- tests/{neg => warn}/supertraits-b.scala | 5 ++--- tests/{neg => warn}/switches.scala | 5 ++--- tests/{neg => warn}/symbolic-packages.scala | 5 ++--- tests/{neg-deep-subtype => warn}/t2755.scala | 5 ++--- tests/{neg => warn}/t3235-minimal.scala | 5 ++--- tests/{neg => warn}/t5830.scala | 4 +--- tests/{neg-deep-subtype => warn}/type-lambda.scala | 4 +--- tests/{neg => warn}/type-test-paths-2.scala | 5 ++--- tests/{neg => warn}/type-test-paths.scala | 4 +--- tests/{neg => warn}/type-test-syntesize-b.scala | 5 ++--- tests/{neg => warn}/xfatalWarnings.scala | 3 +-- 127 files changed, 255 insertions(+), 386 deletions(-) delete mode 100644 tests/neg-deep-subtype/i3324.scala delete mode 100644 tests/neg/i10994.scala delete mode 100644 tests/neg/i11963a.scala delete mode 100644 tests/neg/i11963b.scala delete mode 100644 tests/neg/i11963c.scala delete mode 100644 tests/neg/i14705.scala delete mode 100644 tests/neg/i2673.scala delete mode 100644 tests/neg/i2673b.scala delete mode 100644 tests/neg/i2673c.scala delete mode 100644 tests/neg/i4936b.scala delete mode 100644 tests/neg/i6190b.scala delete mode 100644 tests/neg/i9266.scala delete mode 100644 tests/neg/i9751.scala delete mode 100644 tests/neg/manifest-summoning-b.scala delete mode 100644 tests/neg/old-syntax.scala delete mode 100644 tests/neg/ovlazy.scala rename tests/{neg => warn}/14034b.scala (66%) rename tests/{neg-deep-subtype => warn}/1828.scala (69%) rename tests/{neg-deep-subtype => warn}/3324b.scala (74%) rename tests/{neg-deep-subtype => warn}/3324f.scala (59%) rename tests/{neg-deep-subtype => warn}/3324g.scala (77%) rename tests/{neg => warn}/IsInstanceOfClassTag2.scala (82%) rename tests/{neg-deep-subtype => warn}/JavaSeqLiteral.scala (83%) rename tests/{neg => warn}/avoid-warn-deprecation.scala (58%) rename tests/{neg-deep-subtype => warn}/conditionalWarnings.scala (74%) rename tests/{neg => warn}/convertible.scala (85%) rename tests/{neg => warn}/deprecated-override.scala (52%) rename tests/{neg => warn}/feature-shadowing.scala (74%) rename tests/{neg => warn}/gadt-contradictory-pattern.scala (73%) rename tests/{neg-deep-subtype => warn}/gadt.scala (65%) rename tests/{neg-deep-subtype => warn}/html.scala (84%) rename tests/{neg => warn}/i10247.scala (84%) rename tests/{neg => warn}/i10930.scala (72%) create mode 100644 tests/warn/i10994.scala rename tests/{neg => warn}/i11022.scala (71%) rename tests/{neg => warn}/i11097.scala (83%) rename tests/{neg => warn}/i11225b.scala (63%) rename tests/{neg => warn}/i11333.scala (71%) rename tests/{neg => warn}/i11344.scala (60%) create mode 100644 tests/warn/i11963a.scala create mode 100644 tests/warn/i11963b.scala create mode 100644 tests/warn/i11963c.scala rename tests/{neg => warn}/i12253.scala (91%) rename tests/{neg => warn}/i12597.scala (54%) rename tests/{neg => warn}/i13011.scala (86%) rename tests/{neg => warn}/i13440.scala (57%) rename tests/{neg => warn}/i13542.scala (89%) create mode 100644 tests/warn/i14705.scala rename tests/{neg => warn}/i14721.scala (65%) rename tests/{neg => warn}/i15474.scala (81%) rename tests/{neg => warn}/i15479.scala (69%) rename tests/{neg => warn}/i15503a.scala (97%) rename tests/{neg => warn}/i15503b.scala (94%) rename tests/{neg => warn}/i15503c.scala (90%) rename tests/{neg => warn}/i15503d.scala (83%) rename tests/{neg => warn}/i15503e.scala (92%) rename tests/{neg => warn}/i15503f.scala (79%) rename tests/{neg => warn}/i15503g.scala (85%) rename tests/{neg => warn}/i15503h.scala (74%) rename tests/{neg => warn}/i15503j.scala (88%) rename tests/{neg => warn}/i15662.scala (78%) rename tests/{neg => warn}/i16639a.scala (97%) rename tests/{neg => warn}/i16649-refutable.scala (63%) rename tests/{neg => warn}/i16728.scala (85%) rename tests/{neg => warn}/i16930.scala (79%) rename tests/{neg => warn}/i17314b.scala (65%) rename tests/{neg => warn}/i17612a.scala (91%) rename tests/{neg => warn}/i17613a.scala (84%) rename tests/{neg => warn}/i2333.scala (60%) create mode 100644 tests/warn/i2673.scala create mode 100644 tests/warn/i2673b.scala create mode 100644 tests/warn/i2673c.scala create mode 100644 tests/warn/i3324.scala rename tests/{neg => warn}/i3561.scala (80%) rename tests/{neg => warn}/i4008.scala (93%) rename tests/{neg-deep-subtype => warn}/i4297.scala (88%) rename tests/{neg => warn}/i4364.scala (75%) create mode 100644 tests/warn/i4936b.scala rename tests/{neg => warn}/i4986b.scala (89%) rename tests/{neg => warn}/i5013.scala (73%) rename tests/{neg => warn}/i5013b.scala (75%) create mode 100644 tests/warn/i6190b.scala rename tests/{neg => warn}/i7314.scala (69%) rename tests/{neg => warn}/i7821.scala (83%) rename tests/{neg => warn}/i7821b.scala (80%) rename tests/{neg => warn}/i8427.scala (60%) rename tests/{neg => warn}/i8781b.scala (54%) rename tests/{neg => warn}/i8922b.scala (97%) rename tests/{neg => warn}/i9166.scala (53%) rename tests/{neg => warn}/i9241.scala (90%) create mode 100644 tests/warn/i9266.scala rename tests/{neg => warn}/i9408a.scala (94%) rename tests/{neg => warn}/i9740.scala (81%) rename tests/{neg => warn}/i9740b.scala (79%) rename tests/{neg => warn}/i9740c.scala (76%) rename tests/{neg => warn}/i9740d.scala (71%) create mode 100644 tests/warn/i9751.scala rename tests/{neg => warn}/i9776.scala (93%) rename tests/{neg => warn}/i9880.scala (85%) rename tests/{neg => warn}/implicit-conversions-old.scala (81%) rename tests/{neg => warn}/implicit-conversions.scala (81%) rename tests/{neg => warn}/infix.scala (92%) rename tests/{neg => warn}/inline-givens.scala (67%) rename tests/{neg => warn}/main-functions-nameclash.scala (56%) create mode 100644 tests/warn/manifest-summoning-b.scala rename tests/{neg => warn}/matchable.scala (84%) rename tests/{neg => warn}/newline-braces.scala (55%) rename tests/{neg => warn}/nonunit-statement.scala (97%) create mode 100644 tests/warn/old-syntax.scala rename tests/{neg => warn}/opaque-match.scala (75%) rename tests/{neg-deep-subtype => warn}/or-type-trees.scala (90%) create mode 100644 tests/warn/ovlazy.scala rename tests/{neg => warn}/quote-simple-hole.scala (77%) rename tests/{neg-deep-subtype => warn}/refined-types.scala (90%) rename tests/{neg => warn}/refinements-this.scala (52%) rename tests/{neg => warn}/strict-pattern-bindings-3.2.scala (90%) rename tests/{neg => warn}/supertraits-b.scala (84%) rename tests/{neg => warn}/switches.scala (97%) rename tests/{neg => warn}/symbolic-packages.scala (59%) rename tests/{neg-deep-subtype => warn}/t2755.scala (95%) rename tests/{neg => warn}/t3235-minimal.scala (74%) rename tests/{neg => warn}/t5830.scala (69%) rename tests/{neg-deep-subtype => warn}/type-lambda.scala (74%) rename tests/{neg => warn}/type-test-paths-2.scala (91%) rename tests/{neg => warn}/type-test-paths.scala (87%) rename tests/{neg => warn}/type-test-syntesize-b.scala (82%) rename tests/{neg => warn}/xfatalWarnings.scala (74%) diff --git a/tests/neg-deep-subtype/i3324.scala b/tests/neg-deep-subtype/i3324.scala deleted file mode 100644 index 154f0e5eb64d..000000000000 --- a/tests/neg-deep-subtype/i3324.scala +++ /dev/null @@ -1,8 +0,0 @@ -//> using options -Xfatal-warnings - -class Foo { - def foo(x: Any): Boolean = - x.isInstanceOf[List[String]] // warn -} - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/i10994.scala b/tests/neg/i10994.scala deleted file mode 100644 index ce553c77c5ae..000000000000 --- a/tests/neg/i10994.scala +++ /dev/null @@ -1,6 +0,0 @@ -//> using options -Xfatal-warnings - -def foo = true match - case (b: Boolean): Boolean => () // warn - -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i11963a.scala b/tests/neg/i11963a.scala deleted file mode 100644 index 5212a51826c4..000000000000 --- a/tests/neg/i11963a.scala +++ /dev/null @@ -1,5 +0,0 @@ -//> using options -Xfatal-warnings - -open trait Foo // warn - -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i11963b.scala b/tests/neg/i11963b.scala deleted file mode 100644 index e549488b79b7..000000000000 --- a/tests/neg/i11963b.scala +++ /dev/null @@ -1,5 +0,0 @@ -//> using options -Xfatal-warnings - -open abstract class Foo // warn - -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i11963c.scala b/tests/neg/i11963c.scala deleted file mode 100644 index 8e91632f0bc2..000000000000 --- a/tests/neg/i11963c.scala +++ /dev/null @@ -1,10 +0,0 @@ -//> using options -Xfatal-warnings - -object Test { - def foo: Any = { - open class Bar // warn - new Bar - } -} - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/i14705.scala b/tests/neg/i14705.scala deleted file mode 100644 index 36646130a8a8..000000000000 --- a/tests/neg/i14705.scala +++ /dev/null @@ -1,7 +0,0 @@ -//> using options -Xfatal-warnings - -val n = Nil -val b = n.head.isInstanceOf[String] // warn - -// nopos-error: No warnings can be incurred under -Werror. - diff --git a/tests/neg/i2673.scala b/tests/neg/i2673.scala deleted file mode 100644 index 77abe1a06d16..000000000000 --- a/tests/neg/i2673.scala +++ /dev/null @@ -1,8 +0,0 @@ -//> using options -Xfatal-warnings - -package Foos - -class Foo // warn -class foo - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/i2673b.scala b/tests/neg/i2673b.scala deleted file mode 100644 index 6481ab469943..000000000000 --- a/tests/neg/i2673b.scala +++ /dev/null @@ -1,8 +0,0 @@ -//> using options -Xfatal-warnings - -package Foos - -class Bar // warn -object bar - -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i2673c.scala b/tests/neg/i2673c.scala deleted file mode 100644 index 46e8ff828c18..000000000000 --- a/tests/neg/i2673c.scala +++ /dev/null @@ -1,10 +0,0 @@ -//> using options -Xfatal-warnings - -package Foos - -object Outer { - case class X() // warn - object x -} - -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i4936b.scala b/tests/neg/i4936b.scala deleted file mode 100644 index 80d9de8aeb7d..000000000000 --- a/tests/neg/i4936b.scala +++ /dev/null @@ -1,5 +0,0 @@ -//> using options -Xfatal-warnings - -final object Foo // warn - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/i6190b.scala b/tests/neg/i6190b.scala deleted file mode 100644 index 2f81d0a5a759..000000000000 --- a/tests/neg/i6190b.scala +++ /dev/null @@ -1,7 +0,0 @@ -//> using options -Xfatal-warnings - -case class Rule(name: String) - -def foo = List("1", "2").map(Rule) // warn - -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i9266.scala b/tests/neg/i9266.scala deleted file mode 100644 index 168f1fa1b551..000000000000 --- a/tests/neg/i9266.scala +++ /dev/null @@ -1,7 +0,0 @@ -//> using options -Xfatal-warnings - -import language.`future-migration` - -def test = { implicit x: Int => x + x } // warn - -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i9751.scala b/tests/neg/i9751.scala deleted file mode 100644 index 1b3fa1a01656..000000000000 --- a/tests/neg/i9751.scala +++ /dev/null @@ -1,12 +0,0 @@ -//> using options -Xfatal-warnings - -def f(): Unit = { - () // warn - () -} - -inline def g(): Unit = { - () // warn - () -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/manifest-summoning-b.scala b/tests/neg/manifest-summoning-b.scala deleted file mode 100644 index 83e8b69ead00..000000000000 --- a/tests/neg/manifest-summoning-b.scala +++ /dev/null @@ -1,5 +0,0 @@ -//> using options -Xfatal-warnings -deprecation - -val foo = manifest[List[? <: Int]] // warn -val bar = optManifest[Array[? <: String]] // warn -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/old-syntax.scala b/tests/neg/old-syntax.scala deleted file mode 100644 index 4f031c96c4c4..000000000000 --- a/tests/neg/old-syntax.scala +++ /dev/null @@ -1,6 +0,0 @@ -//> using options -Xfatal-warnings -deprecation - -val f = (x: Int) ⇒ x + 1 // warn - -val list = for (n ← List(42)) yield n + 1 // warn -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/ovlazy.scala b/tests/neg/ovlazy.scala deleted file mode 100644 index 1331589c5d3b..000000000000 --- a/tests/neg/ovlazy.scala +++ /dev/null @@ -1,10 +0,0 @@ -//> using options -source 3.0-migration -Xfatal-warnings - -class A { - val x: Int = 1 -} -class B extends A { - override lazy val x: Int = 2 // warn -} - -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/14034b.scala b/tests/warn/14034b.scala similarity index 66% rename from tests/neg/14034b.scala rename to tests/warn/14034b.scala index 7f9f4e8f1cac..fdef353f7aca 100644 --- a/tests/neg/14034b.scala +++ b/tests/warn/14034b.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -deprecation +//> using options -deprecation @deprecated trait Exp @deprecated val exp = 1 @@ -12,5 +12,4 @@ type Bar = Option[exp.type] // warn type Baz = Exp | Int // warn type Quux = [X] =>> X match case Exp => Int // warn -type Quuz[A <: Exp] = Int // warn -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +type Quuz[A <: Exp] = Int // warn \ No newline at end of file diff --git a/tests/neg-deep-subtype/1828.scala b/tests/warn/1828.scala similarity index 69% rename from tests/neg-deep-subtype/1828.scala rename to tests/warn/1828.scala index 9cab8e76e832..2231967a53e0 100644 --- a/tests/neg-deep-subtype/1828.scala +++ b/tests/warn/1828.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class Test { def remove[S](a: S | Int, f: Int => S):S = a match { @@ -9,5 +9,3 @@ class Test { val t: Int | String = 5 val t1 = remove[String](t, _.toString) } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg-deep-subtype/3324b.scala b/tests/warn/3324b.scala similarity index 74% rename from tests/neg-deep-subtype/3324b.scala rename to tests/warn/3324b.scala index 71ffde73fbdc..9a2011d18012 100644 --- a/tests/neg-deep-subtype/3324b.scala +++ b/tests/warn/3324b.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class C[T] { val x: Any = ??? @@ -8,5 +8,4 @@ class C[T] { case x: List[String] => // warn: unchecked case x: T => // warn: unchecked } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg-deep-subtype/3324f.scala b/tests/warn/3324f.scala similarity index 59% rename from tests/neg-deep-subtype/3324f.scala rename to tests/warn/3324f.scala index e73bd0d05eed..86af918b0d5a 100644 --- a/tests/neg-deep-subtype/3324f.scala +++ b/tests/warn/3324f.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + trait C[T] class D[T] @@ -8,5 +8,4 @@ class Test { case _: D[T] => // warn case _: C[Int] => // warn } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg-deep-subtype/3324g.scala b/tests/warn/3324g.scala similarity index 77% rename from tests/neg-deep-subtype/3324g.scala rename to tests/warn/3324g.scala index cd1fc660bed8..23ff4b3d23f9 100644 --- a/tests/neg-deep-subtype/3324g.scala +++ b/tests/warn/3324g.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class Test { trait A[+T] @@ -18,5 +18,4 @@ class Test { } quux(new C[Int]) -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/IsInstanceOfClassTag2.scala b/tests/warn/IsInstanceOfClassTag2.scala similarity index 82% rename from tests/neg/IsInstanceOfClassTag2.scala rename to tests/warn/IsInstanceOfClassTag2.scala index a2a7194d4e39..c41a94d86c6d 100644 --- a/tests/neg/IsInstanceOfClassTag2.scala +++ b/tests/warn/IsInstanceOfClassTag2.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import scala.reflect.TypeTest @@ -23,4 +23,3 @@ object IsInstanceOfClassTag { } } -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg-deep-subtype/JavaSeqLiteral.scala b/tests/warn/JavaSeqLiteral.scala similarity index 83% rename from tests/neg-deep-subtype/JavaSeqLiteral.scala rename to tests/warn/JavaSeqLiteral.scala index 863b4f436f89..9652a9fa502c 100644 --- a/tests/neg-deep-subtype/JavaSeqLiteral.scala +++ b/tests/warn/JavaSeqLiteral.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + object Test1 { trait Tree[-T] @@ -29,5 +29,3 @@ object Test2 { foo1(new DummyTree) } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/avoid-warn-deprecation.scala b/tests/warn/avoid-warn-deprecation.scala similarity index 58% rename from tests/neg/avoid-warn-deprecation.scala rename to tests/warn/avoid-warn-deprecation.scala index f14ebd30a98f..364added5e8a 100644 --- a/tests/neg/avoid-warn-deprecation.scala +++ b/tests/warn/avoid-warn-deprecation.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -feature +//> using options -feature object A { @deprecated("use bar instead of this one", "0.2.3") @@ -8,5 +8,4 @@ object A { object B { A.foo } -// nopos-warn there was 1 deprecation warning; re-run with -deprecation for details -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +// nopos-warn there was 1 deprecation warning; re-run with -deprecation for details \ No newline at end of file diff --git a/tests/neg-deep-subtype/conditionalWarnings.scala b/tests/warn/conditionalWarnings.scala similarity index 74% rename from tests/neg-deep-subtype/conditionalWarnings.scala rename to tests/warn/conditionalWarnings.scala index c818b70b8ee5..5ab63c263abf 100644 --- a/tests/neg-deep-subtype/conditionalWarnings.scala +++ b/tests/warn/conditionalWarnings.scala @@ -1,4 +1,4 @@ -//> using options -deprecation -Xfatal-warnings +//> using options -deprecation object Test { @deprecated def foo = ??? @@ -12,5 +12,4 @@ object Test { // The program compiles with final line // there was 1 feature warning; re-run with -feature for details // nopos-warn -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/convertible.scala b/tests/warn/convertible.scala similarity index 85% rename from tests/neg/convertible.scala rename to tests/warn/convertible.scala index 9ddc75a982a7..c98006ecdc9b 100644 --- a/tests/neg/convertible.scala +++ b/tests/warn/convertible.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -feature +//> using options -feature import language.experimental.into @@ -27,5 +27,4 @@ object Test: def h(x: into Text) = val y = h1(x) - y("abc") // warn, inference through type variable does not propagate -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + y("abc") // warn, inference through type variable does not propagate \ No newline at end of file diff --git a/tests/neg/deprecated-override.scala b/tests/warn/deprecated-override.scala similarity index 52% rename from tests/neg/deprecated-override.scala rename to tests/warn/deprecated-override.scala index c167dd720666..2d0b0ceb4aea 100644 --- a/tests/neg/deprecated-override.scala +++ b/tests/warn/deprecated-override.scala @@ -1,4 +1,4 @@ -//> using options -source future -deprecation -Xfatal-warnings +//> using options -source future -deprecation trait A: def f: Int @@ -12,5 +12,4 @@ class C extends B: trait D extends A: override def f = 3 -object E extends B, D // warn -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +object E extends B, D // warn \ No newline at end of file diff --git a/tests/neg/feature-shadowing.scala b/tests/warn/feature-shadowing.scala similarity index 74% rename from tests/neg/feature-shadowing.scala rename to tests/warn/feature-shadowing.scala index 891d8735aa41..301f24b241f7 100644 --- a/tests/neg/feature-shadowing.scala +++ b/tests/warn/feature-shadowing.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -feature +//> using options -feature import language.implicitConversions given Conversion[Int, String] = _.toString @@ -13,4 +13,3 @@ object a: object c: import language.implicitConversions val s: String = 3 // OK again -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/gadt-contradictory-pattern.scala b/tests/warn/gadt-contradictory-pattern.scala similarity index 73% rename from tests/neg/gadt-contradictory-pattern.scala rename to tests/warn/gadt-contradictory-pattern.scala index ed8b343c9545..b9c004efbe34 100644 --- a/tests/neg/gadt-contradictory-pattern.scala +++ b/tests/warn/gadt-contradictory-pattern.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wimplausible-patterns +//> using options -Wimplausible-patterns object Test { sealed abstract class Foo[T] case object Bar1 extends Foo[Int] @@ -11,5 +11,4 @@ object Test { case (Bar3, _) => () } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg-deep-subtype/gadt.scala b/tests/warn/gadt.scala similarity index 65% rename from tests/neg-deep-subtype/gadt.scala rename to tests/warn/gadt.scala index ec59ca53572c..9d7b81220284 100644 --- a/tests/neg-deep-subtype/gadt.scala +++ b/tests/warn/gadt.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class Test { trait A[+T] @@ -13,5 +13,3 @@ class Test { quux(new B[D]) } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg-deep-subtype/html.scala b/tests/warn/html.scala similarity index 84% rename from tests/neg-deep-subtype/html.scala rename to tests/warn/html.scala index 4257859e7156..98189c1bf2cb 100644 --- a/tests/neg-deep-subtype/html.scala +++ b/tests/warn/html.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + object HTML: type AttrArg = AppliedAttr | Seq[AppliedAttr] @@ -18,5 +18,3 @@ object HTML: } sb } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/i10247.scala b/tests/warn/i10247.scala similarity index 84% rename from tests/neg/i10247.scala rename to tests/warn/i10247.scala index e98b2dc6e9c2..aa344362cac2 100644 --- a/tests/neg/i10247.scala +++ b/tests/warn/i10247.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -deprecation +//> using options -deprecation def usered = Color.Red // warn: value Red is deprecated @@ -25,5 +25,4 @@ enum Color { object Color { def useFoo2 = DeprecatedContainer.foo // warn // check that only enum cases are avoided -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i10930.scala b/tests/warn/i10930.scala similarity index 72% rename from tests/neg/i10930.scala rename to tests/warn/i10930.scala index fe9009a52292..5d88235d0951 100644 --- a/tests/neg/i10930.scala +++ b/tests/warn/i10930.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import language.future @main def Test = @@ -12,5 +12,4 @@ import language.future case x: String => x.charAt(0) // warn case x: Array[t] => leafElem(x(1)) // warn case x: Iterable[t] => leafElem(x.head) // warn - case x: AnyVal => x // warn -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + case x: AnyVal => x // warn \ No newline at end of file diff --git a/tests/warn/i10994.scala b/tests/warn/i10994.scala new file mode 100644 index 000000000000..74fe3bba3778 --- /dev/null +++ b/tests/warn/i10994.scala @@ -0,0 +1,5 @@ + + +def foo = true match + case (b: Boolean): Boolean => () // warn + diff --git a/tests/neg/i11022.scala b/tests/warn/i11022.scala similarity index 71% rename from tests/neg/i11022.scala rename to tests/warn/i11022.scala index 475f65695251..8e2de9d8f519 100644 --- a/tests/neg/i11022.scala +++ b/tests/warn/i11022.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -deprecation +//> using options -deprecation @deprecated("no CaseClass") case class CaseClass(rgb: Int): @@ -10,5 +10,4 @@ object CaseClass: val a: CaseClass = CaseClass(42) // warn: deprecated type // warn: deprecated apply method val b: CaseClass = new CaseClass(42) // warn: deprecated type // warn: deprecated class val c: Unit = CaseClass(42).magic() // warn: deprecated apply method -val d: Unit = CaseClass.notDeprecated() // compiles -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +val d: Unit = CaseClass.notDeprecated() // compiles \ No newline at end of file diff --git a/tests/neg/i11097.scala b/tests/warn/i11097.scala similarity index 83% rename from tests/neg/i11097.scala rename to tests/warn/i11097.scala index b1f0b0bfd300..51c02a627a15 100644 --- a/tests/neg/i11097.scala +++ b/tests/warn/i11097.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + @main def test: Unit = { class C { type T1; type T2 } @@ -12,5 +12,4 @@ // ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String val x = pmatch(new C { type T1 = String; type T2 = String }) -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i11225b.scala b/tests/warn/i11225b.scala similarity index 63% rename from tests/neg/i11225b.scala rename to tests/warn/i11225b.scala index b66cd3865f49..ad4e747fdc86 100644 --- a/tests/neg/i11225b.scala +++ b/tests/warn/i11225b.scala @@ -1,4 +1,4 @@ -//> using options -source future -deprecation -Xfatal-warnings +//> using options -source future -deprecation import compiletime.uninitialized @@ -11,4 +11,3 @@ class Memo[A](x: => A): cached = x cached -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i11333.scala b/tests/warn/i11333.scala similarity index 71% rename from tests/neg/i11333.scala rename to tests/warn/i11333.scala index 5149a99e7063..210916b30aaf 100644 --- a/tests/neg/i11333.scala +++ b/tests/warn/i11333.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class C: val f1: Float = 123456789 // warn @@ -11,5 +11,4 @@ class C: val f1_b: Float = i1 // warn val d1_b: Double = l1 // warn - val f2_b: Float = l2 // warn -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + val f2_b: Float = l2 // warn \ No newline at end of file diff --git a/tests/neg/i11344.scala b/tests/warn/i11344.scala similarity index 60% rename from tests/neg/i11344.scala rename to tests/warn/i11344.scala index 04c1b6f7f2d3..f8af81369162 100644 --- a/tests/neg/i11344.scala +++ b/tests/warn/i11344.scala @@ -1,10 +1,9 @@ -//> using options -Xfatal-warnings -deprecation +//> using options -deprecation trait Pet(val name: String, rest: Int): def f(suffix: String) = s"$name$suffix$rest" class Birdie(override val name: String) extends Pet("huh", 1) // warn -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/warn/i11963a.scala b/tests/warn/i11963a.scala new file mode 100644 index 000000000000..b6743d92a4ac --- /dev/null +++ b/tests/warn/i11963a.scala @@ -0,0 +1,4 @@ + + +open trait Foo // warn + diff --git a/tests/warn/i11963b.scala b/tests/warn/i11963b.scala new file mode 100644 index 000000000000..5868e6979214 --- /dev/null +++ b/tests/warn/i11963b.scala @@ -0,0 +1,4 @@ + + +open abstract class Foo // warn + diff --git a/tests/warn/i11963c.scala b/tests/warn/i11963c.scala new file mode 100644 index 000000000000..245b436ee1e9 --- /dev/null +++ b/tests/warn/i11963c.scala @@ -0,0 +1,8 @@ + + +object Test { + def foo: Any = { + open class Bar // warn + new Bar + } +} diff --git a/tests/neg/i12253.scala b/tests/warn/i12253.scala similarity index 91% rename from tests/neg/i12253.scala rename to tests/warn/i12253.scala index 51677c10b5f0..313ef4584098 100644 --- a/tests/neg/i12253.scala +++ b/tests/warn/i12253.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import scala.quoted.{given, *} import deriving.*, compiletime.* @@ -27,5 +27,3 @@ object MacroUtils: end Extractors end MacroUtils - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/i12597.scala b/tests/warn/i12597.scala similarity index 54% rename from tests/neg/i12597.scala rename to tests/warn/i12597.scala index 241e1b09e2a9..57546a69b173 100644 --- a/tests/neg/i12597.scala +++ b/tests/warn/i12597.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -deprecation +//> using options -deprecation @main def Test = val a: IArray[Int] = IArray(2) @@ -6,4 +6,3 @@ val c = b.toArray // warn: deprecated c(0) = "" -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i13011.scala b/tests/warn/i13011.scala similarity index 86% rename from tests/neg/i13011.scala rename to tests/warn/i13011.scala index fca3fcf7dded..0675ec936d0c 100644 --- a/tests/neg/i13011.scala +++ b/tests/warn/i13011.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class i13011 { lazy implicit val simple1: String = simple1 // warn @@ -20,5 +20,4 @@ class i13011 { } lazy val simple7: Function0[Any] = () => this.simple7 // Ok -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i13440.scala b/tests/warn/i13440.scala similarity index 57% rename from tests/neg/i13440.scala rename to tests/warn/i13440.scala index 6b8bf99e08d3..4f1337391d61 100644 --- a/tests/neg/i13440.scala +++ b/tests/warn/i13440.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import language.`3.0-migration` @@ -6,5 +6,4 @@ def given = 42 // warn case class C(enum: List[Int] = Nil) { // warn val s = s"$enum" // warn -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i13542.scala b/tests/warn/i13542.scala similarity index 89% rename from tests/neg/i13542.scala rename to tests/warn/i13542.scala index 404ddc0af2e5..f573aafadc7a 100644 --- a/tests/neg/i13542.scala +++ b/tests/warn/i13542.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import scala.language.implicitConversions @@ -44,5 +44,4 @@ val x6 = implicit def barToFoo4(bar: Bar): Foo = lazy val y = bar.toFoo if false then y else ??? - val foo: Foo = Bar(1) -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + val foo: Foo = Bar(1) \ No newline at end of file diff --git a/tests/warn/i14705.scala b/tests/warn/i14705.scala new file mode 100644 index 000000000000..a6c56ed8b927 --- /dev/null +++ b/tests/warn/i14705.scala @@ -0,0 +1,6 @@ + + +val n = Nil +val b = n.head.isInstanceOf[String] // warn + + diff --git a/tests/neg/i14721.scala b/tests/warn/i14721.scala similarity index 65% rename from tests/neg/i14721.scala rename to tests/warn/i14721.scala index 46b9c4bb5b2a..9739bab5801b 100644 --- a/tests/neg/i14721.scala +++ b/tests/warn/i14721.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class C: def op: Unit = println("op") @@ -8,4 +8,3 @@ class C: catch case _: NullPointerException => handler // warn -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i15474.scala b/tests/warn/i15474.scala similarity index 81% rename from tests/neg/i15474.scala rename to tests/warn/i15474.scala index ff4fd7b641ef..20c203fe6e27 100644 --- a/tests/neg/i15474.scala +++ b/tests/warn/i15474.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import scala.language.implicitConversions @@ -15,5 +15,4 @@ object Prices { object Price{ given Ordering[Price] = summon[Ordering[BigDecimal]] // warn } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i15479.scala b/tests/warn/i15479.scala similarity index 69% rename from tests/neg/i15479.scala rename to tests/warn/i15479.scala index 0da30ab749e2..b69296ae23e4 100644 --- a/tests/neg/i15479.scala +++ b/tests/warn/i15479.scala @@ -1,4 +1,4 @@ -//> using options -source future -deprecation -Xfatal-warnings +//> using options -source future -deprecation package deptest { @deprecated("Not used any more", since="7") @@ -16,5 +16,3 @@ package depuser { } } } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/i15503a.scala b/tests/warn/i15503a.scala similarity index 97% rename from tests/neg/i15503a.scala rename to tests/warn/i15503a.scala index b4655a37db33..df8691c21a13 100644 --- a/tests/neg/i15503a.scala +++ b/tests/warn/i15503a.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wunused:imports +//> using options -Wunused:imports object FooUnused: @@ -265,5 +265,4 @@ package foo.test.typeapply.hklamdba.i16680: import foo.IO // OK def f[F[_]]: String = "hello" - def go = f[IO] -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + def go = f[IO] \ No newline at end of file diff --git a/tests/neg/i15503b.scala b/tests/warn/i15503b.scala similarity index 94% rename from tests/neg/i15503b.scala rename to tests/warn/i15503b.scala index f828812dfe5b..7ab86026ff00 100644 --- a/tests/neg/i15503b.scala +++ b/tests/warn/i15503b.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wunused:locals +//> using options -Wunused:locals val a = 1 // OK @@ -141,5 +141,4 @@ package test.foo.twisted.i16682: } isInt - def f = myPackage("42") -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + def f = myPackage("42") \ No newline at end of file diff --git a/tests/neg/i15503c.scala b/tests/warn/i15503c.scala similarity index 90% rename from tests/neg/i15503c.scala rename to tests/warn/i15503c.scala index 6475302e2f1d..7ca7fecd1f8d 100644 --- a/tests/neg/i15503c.scala +++ b/tests/warn/i15503c.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wunused:privates +//> using options -Wunused:privates trait C class A: self: C => // OK @@ -54,5 +54,4 @@ package test.foo.i16682: case _ => println("NaN") } - def f = myPackage.isInt("42") -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + def f = myPackage.isInt("42") \ No newline at end of file diff --git a/tests/neg/i15503d.scala b/tests/warn/i15503d.scala similarity index 83% rename from tests/neg/i15503d.scala rename to tests/warn/i15503d.scala index 82e94e60ba75..5cda54fc5c42 100644 --- a/tests/neg/i15503d.scala +++ b/tests/warn/i15503d.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wunused:unsafe-warn-patvars +//> using options -Wunused:unsafe-warn-patvars // todo : change to :patvars sealed trait Calc @@ -27,5 +27,4 @@ val a = Sum(S(S(Z)),Z) match { // todo : This should *NOT* pass in the future // val c = for { // case Some(x) <- Option(Option(1)) -// } println(s"hello world") -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +// } println(s"hello world") \ No newline at end of file diff --git a/tests/neg/i15503e.scala b/tests/warn/i15503e.scala similarity index 92% rename from tests/neg/i15503e.scala rename to tests/warn/i15503e.scala index 84c5066dff57..46d73a4945cd 100644 --- a/tests/neg/i15503e.scala +++ b/tests/warn/i15503e.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wunused:explicits +//> using options -Wunused:explicits object Foo { /* This goes around the "trivial method" detection */ @@ -67,5 +67,4 @@ package foo.test.i16865: def fn(a: Int, b: Int): Int = b + 3 // OK object Ex2 extends Bar: - override def fn(a: Int, b: Int): Int = b + 3 // OK -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + override def fn(a: Int, b: Int): Int = b + 3 // OK \ No newline at end of file diff --git a/tests/neg/i15503f.scala b/tests/warn/i15503f.scala similarity index 79% rename from tests/neg/i15503f.scala rename to tests/warn/i15503f.scala index bea7cdf2a408..ccf0b7e74065 100644 --- a/tests/neg/i15503f.scala +++ b/tests/warn/i15503f.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wunused:implicits +//> using options -Wunused:implicits /* This goes around the "trivial method" detection */ val default_int = 1 @@ -12,5 +12,3 @@ object Xd { private def f7(a: Int)(using Int) = summon[Int] + a // OK private def f8(a: Int)(using foo: Int) = a // warn } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/i15503g.scala b/tests/warn/i15503g.scala similarity index 85% rename from tests/neg/i15503g.scala rename to tests/warn/i15503g.scala index 2f74c48cdbcc..fbd9f3c1352c 100644 --- a/tests/neg/i15503g.scala +++ b/tests/warn/i15503g.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wunused:params +//> using options -Wunused:params /* This goes around the "trivial method" detection */ object Foo { @@ -20,5 +20,4 @@ package foo.test.i17101: extension[A] (x: Test[A]) { // OK def value: A = x def causesIssue: Unit = println("oh no") - } -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + } \ No newline at end of file diff --git a/tests/neg/i15503h.scala b/tests/warn/i15503h.scala similarity index 74% rename from tests/neg/i15503h.scala rename to tests/warn/i15503h.scala index a384df26b5f9..854693981488 100644 --- a/tests/neg/i15503h.scala +++ b/tests/warn/i15503h.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wunused:linted +//> using options -Wunused:linted import collection.mutable.Set // warn @@ -17,5 +17,4 @@ class A { def g(x: Int): Int = x match case x:1 => 0 // OK case _ => 1 -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i15503j.scala b/tests/warn/i15503j.scala similarity index 88% rename from tests/neg/i15503j.scala rename to tests/warn/i15503j.scala index 2d40b5b49d24..f5e15bb79f79 100644 --- a/tests/neg/i15503j.scala +++ b/tests/warn/i15503j.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wunused:strict-no-implicit-warn +//> using options -Wunused:strict-no-implicit-warn package foo.unused.strict.test: package a: @@ -56,5 +56,4 @@ package foo.unused.summon.inlines: new {} val b: B = summon[B] - val c: C = summon[C] -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + val c: C = summon[C] \ No newline at end of file diff --git a/tests/neg/i15662.scala b/tests/warn/i15662.scala similarity index 78% rename from tests/neg/i15662.scala rename to tests/warn/i15662.scala index 366661c7bae4..72962e67a251 100644 --- a/tests/neg/i15662.scala +++ b/tests/warn/i15662.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + case class Composite[T](v: T) @@ -14,5 +14,3 @@ def m2(composite: Composite[_]): Unit = @main def Test = m(Composite("This is String")) - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/i16639a.scala b/tests/warn/i16639a.scala similarity index 97% rename from tests/neg/i16639a.scala rename to tests/warn/i16639a.scala index 907fed7f0765..71812e23f636 100644 --- a/tests/neg/i16639a.scala +++ b/tests/warn/i16639a.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wunused:all +//> using options -Wunused:all // class Bippy(a: Int, b: Int) { private def this(c: Int) = this(c, c) // warn /Dotty:NoWarn @@ -203,5 +203,4 @@ trait `short comings` { val x = 42 // warn /Dotty only triggers in dotty 17 } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i16649-refutable.scala b/tests/warn/i16649-refutable.scala similarity index 63% rename from tests/neg/i16649-refutable.scala rename to tests/warn/i16649-refutable.scala index 62336caf87df..5ff18b5a3633 100644 --- a/tests/neg/i16649-refutable.scala +++ b/tests/warn/i16649-refutable.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import quoted.* @@ -8,4 +8,3 @@ def foo(using Quotes)(x: Expr[Int]) = val '{ $b: Any } = x val '{ $c } = x -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i16728.scala b/tests/warn/i16728.scala similarity index 85% rename from tests/neg/i16728.scala rename to tests/warn/i16728.scala index 8d00b4fbea3b..4d28b07c51a3 100644 --- a/tests/neg/i16728.scala +++ b/tests/warn/i16728.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class A[T] { class X { @@ -32,5 +32,3 @@ object Test { } } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/i16930.scala b/tests/warn/i16930.scala similarity index 79% rename from tests/neg/i16930.scala rename to tests/warn/i16930.scala index 6028b939813a..bf30fccbf601 100644 --- a/tests/neg/i16930.scala +++ b/tests/warn/i16930.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wunused:imports +//> using options -Wunused:imports trait Outer: trait Used @@ -19,5 +19,4 @@ object Test1 { val outer1: Outer1 = ??? import outer1.{Unused1, UnusedToo1} // warn // warn def foo() = outer1.unusedToo1 // in this case UnusedToo1 is not used explicitly, only inferred -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i17314b.scala b/tests/warn/i17314b.scala similarity index 65% rename from tests/neg/i17314b.scala rename to tests/warn/i17314b.scala index be7fda4682f7..e1500028ca93 100644 --- a/tests/neg/i17314b.scala +++ b/tests/warn/i17314b.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wunused:all +//> using options -Wunused:all package foo: class Foo[T] @@ -13,4 +13,3 @@ package bar: val repro: Foo[Int] = summon[Foo[Int]] -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i17612a.scala b/tests/warn/i17612a.scala similarity index 91% rename from tests/neg/i17612a.scala rename to tests/warn/i17612a.scala index 5aba92b095f3..2ae9bd75ccea 100644 --- a/tests/neg/i17612a.scala +++ b/tests/warn/i17612a.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Xlint:private-shadow +//> using options -Xlint:private-shadow object i17612a: class Base(var x: Int, val y: Int, var z: Int): @@ -39,5 +39,4 @@ object i17612a: derived.increment() println(derived.toString) // still x: '1', probably unexpected, for y it never prints the super value, less surprising println(derived.shadowed2) - println(derived.shadowed3) -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + println(derived.shadowed3) \ No newline at end of file diff --git a/tests/neg/i17613a.scala b/tests/warn/i17613a.scala similarity index 84% rename from tests/neg/i17613a.scala rename to tests/warn/i17613a.scala index e161c5908297..6ee55a5cf973 100644 --- a/tests/neg/i17613a.scala +++ b/tests/warn/i17613a.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Xlint:type-parameter-shadow +//> using options -Xlint:type-parameter-shadow object i17613a: class B: @@ -20,5 +20,4 @@ object i17613a: 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") -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + def main(args: Array[String]) = println("Test for type parameter shadow") \ No newline at end of file diff --git a/tests/neg/i2333.scala b/tests/warn/i2333.scala similarity index 60% rename from tests/neg/i2333.scala rename to tests/warn/i2333.scala index 5cbf8fcd40cb..1ac5eb314325 100644 --- a/tests/neg/i2333.scala +++ b/tests/warn/i2333.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -deprecation +//> using options -deprecation @deprecated("bla", "2.11.0") class Foo { println("") @@ -8,5 +8,4 @@ object Test { new Foo // warn: deprecated new Foo(1) // warn: deprecated -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/warn/i2673.scala b/tests/warn/i2673.scala new file mode 100644 index 000000000000..a04e3b370d56 --- /dev/null +++ b/tests/warn/i2673.scala @@ -0,0 +1,6 @@ + + +package Foos + +class Foo // warn +class foo diff --git a/tests/warn/i2673b.scala b/tests/warn/i2673b.scala new file mode 100644 index 000000000000..0d11317cd9e6 --- /dev/null +++ b/tests/warn/i2673b.scala @@ -0,0 +1,7 @@ + + +package Foos + +class Bar // warn +object bar + diff --git a/tests/warn/i2673c.scala b/tests/warn/i2673c.scala new file mode 100644 index 000000000000..682e4adfa2c9 --- /dev/null +++ b/tests/warn/i2673c.scala @@ -0,0 +1,9 @@ + + +package Foos + +object Outer { + case class X() // warn + object x +} + diff --git a/tests/warn/i3324.scala b/tests/warn/i3324.scala new file mode 100644 index 000000000000..ab0c24da39a5 --- /dev/null +++ b/tests/warn/i3324.scala @@ -0,0 +1,6 @@ + + +class Foo { + def foo(x: Any): Boolean = + x.isInstanceOf[List[String]] // warn +} diff --git a/tests/neg/i3561.scala b/tests/warn/i3561.scala similarity index 80% rename from tests/neg/i3561.scala rename to tests/warn/i3561.scala index 0a19e01e8ab6..a64a599eafec 100644 --- a/tests/neg/i3561.scala +++ b/tests/warn/i3561.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class Test { val Constant = 'Q' // OK if final @@ -15,5 +15,4 @@ class Test { case '5' | Constant => 3 case '4' => 4 } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i4008.scala b/tests/warn/i4008.scala similarity index 93% rename from tests/neg/i4008.scala rename to tests/warn/i4008.scala index fb24c25fc4ff..489a067bf6fd 100644 --- a/tests/neg/i4008.scala +++ b/tests/warn/i4008.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + // ===== Template annotations ===== @@ -47,5 +47,4 @@ class C[A](using @annotation.implicitNotFound("No C[${B}] found") c: Class[A]) / def someMethod1[A](using @annotation.implicitNotFound("No C[${B}] found") sc: C[A]) = 0 // warn -def someMethod2[A](using @annotation.implicitNotFound("No C[${A}] found") sc: C[A]) = "" -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +def someMethod2[A](using @annotation.implicitNotFound("No C[${A}] found") sc: C[A]) = "" \ No newline at end of file diff --git a/tests/neg-deep-subtype/i4297.scala b/tests/warn/i4297.scala similarity index 88% rename from tests/neg-deep-subtype/i4297.scala rename to tests/warn/i4297.scala index 3fcb427c246e..3268b8a2c7f5 100644 --- a/tests/neg-deep-subtype/i4297.scala +++ b/tests/warn/i4297.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class Test { def test[X <: Option[Int]](x: X) = x.isInstanceOf[Some[Int]] @@ -10,5 +10,4 @@ class Test { def test5[Y <: Int, X <: Function1[Y, Unit]](x: X) = x.isInstanceOf[Function1[Int, Unit]] // warn def test6[Y <: Int, X <: Function1[Y, Unit]](x: X) = x.isInstanceOf[Function1[Int, Any]] // warn def test7[Y <: Int, X <: Function1[Y, Unit]](x: X) = x.isInstanceOf[Function1[_, Unit]] -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i4364.scala b/tests/warn/i4364.scala similarity index 75% rename from tests/neg/i4364.scala rename to tests/warn/i4364.scala index 225fd1dd0384..5cfc2ed5076d 100644 --- a/tests/neg/i4364.scala +++ b/tests/warn/i4364.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + object Test { def foo(c: java.util.function.Consumer[Integer]) = c.accept(0) @@ -9,5 +9,3 @@ object Test { new java.io.ObjectOutputStream(f) // warn: OutputStream is not @FunctionalInterface } } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/warn/i4936b.scala b/tests/warn/i4936b.scala new file mode 100644 index 000000000000..057c90545dbd --- /dev/null +++ b/tests/warn/i4936b.scala @@ -0,0 +1,3 @@ + + +final object Foo // warn diff --git a/tests/neg/i4986b.scala b/tests/warn/i4986b.scala similarity index 89% rename from tests/neg/i4986b.scala rename to tests/warn/i4986b.scala index 9df1eea64e28..6f2a0885090b 100644 --- a/tests/neg/i4986b.scala +++ b/tests/warn/i4986b.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import scala.annotation.implicitNotFound @@ -19,5 +19,4 @@ trait U[X, Y[_], Z[_, ZZ]] { class I[R] { def m[S](implicit @implicitNotFound("${X} ${Y} ${ Z } ${R} ${S} -- ${XX} ${ZZ} ${ Nix }") i: Int) = ??? // warn // warn // warn } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i5013.scala b/tests/warn/i5013.scala similarity index 73% rename from tests/neg/i5013.scala rename to tests/warn/i5013.scala index 1950770e8204..9fbc32967b78 100644 --- a/tests/neg/i5013.scala +++ b/tests/warn/i5013.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class Foo { @@ -8,5 +8,4 @@ class Foo { 3 // warn: A pure expression does nothing in statement position 4 // warn: A pure expression does nothing in statement position } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i5013b.scala b/tests/warn/i5013b.scala similarity index 75% rename from tests/neg/i5013b.scala rename to tests/warn/i5013b.scala index 6321538ffef2..09ce319e0a88 100644 --- a/tests/neg/i5013b.scala +++ b/tests/warn/i5013b.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class Foo { @@ -17,4 +17,3 @@ class Foo { } -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/warn/i6190b.scala b/tests/warn/i6190b.scala new file mode 100644 index 000000000000..a10006516c6f --- /dev/null +++ b/tests/warn/i6190b.scala @@ -0,0 +1,6 @@ + + +case class Rule(name: String) + +def foo = List("1", "2").map(Rule) // warn + diff --git a/tests/neg/i7314.scala b/tests/warn/i7314.scala similarity index 69% rename from tests/neg/i7314.scala rename to tests/warn/i7314.scala index 541e18c25761..4d0d525542bf 100644 --- a/tests/neg/i7314.scala +++ b/tests/warn/i7314.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -source future +//> using options -source future @main def Test = // conversion out of the opaque type: @@ -9,5 +9,3 @@ a(0) = 0 } println(imm1(0)) // 0 - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/i7821.scala b/tests/warn/i7821.scala similarity index 83% rename from tests/neg/i7821.scala rename to tests/warn/i7821.scala index 6604af7604c1..6ac46ef730bb 100644 --- a/tests/neg/i7821.scala +++ b/tests/warn/i7821.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + object XObject { opaque type X = Int @@ -24,4 +24,3 @@ object Main extends App { println(XObject.anX + XObject.anX) // prints 10 println(MyXObject.anX + MyXObject.anX) // infinite loop } -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i7821b.scala b/tests/warn/i7821b.scala similarity index 80% rename from tests/neg/i7821b.scala rename to tests/warn/i7821b.scala index 93598b968adf..db3de3f86e2f 100644 --- a/tests/neg/i7821b.scala +++ b/tests/warn/i7821b.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + object Test { @@ -10,5 +10,4 @@ object Test { { def f(x: Int, y: Int): Int = { val a = 3; f(a, 1) } } // warn { def f(x: Int): Int = f(1) } // warn -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i8427.scala b/tests/warn/i8427.scala similarity index 60% rename from tests/neg/i8427.scala rename to tests/warn/i8427.scala index 7c22184aeb03..61ea2eabb79a 100644 --- a/tests/neg/i8427.scala +++ b/tests/warn/i8427.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + @SerialVersionUID(1L) // warn trait T @@ -7,4 +7,3 @@ object Test { var t: T = compiletime.uninitialized def main(args: Array[String]) = println("hi") } -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i8781b.scala b/tests/warn/i8781b.scala similarity index 54% rename from tests/neg/i8781b.scala rename to tests/warn/i8781b.scala index 01cd7ef69096..455cd49b927a 100644 --- a/tests/neg/i8781b.scala +++ b/tests/warn/i8781b.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + object Test: @@ -6,4 +6,3 @@ object Test: println(3.isInstanceOf[Boolean]) // warn -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i8922b.scala b/tests/warn/i8922b.scala similarity index 97% rename from tests/neg/i8922b.scala rename to tests/warn/i8922b.scala index c199f5be5bd4..f167eea005c5 100644 --- a/tests/neg/i8922b.scala +++ b/tests/warn/i8922b.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + case class Token(tokenType: TokenType, lexeme: StringV, line: IntV) @@ -76,5 +76,3 @@ object Interpreter { } } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/i9166.scala b/tests/warn/i9166.scala similarity index 53% rename from tests/neg/i9166.scala rename to tests/warn/i9166.scala index bfb30937fb21..34a42987f6aa 100644 --- a/tests/neg/i9166.scala +++ b/tests/warn/i9166.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wimplausible-patterns +//> using options -Wimplausible-patterns object UnitTest extends App { def foo(m: Unit) = m match { case runtime.BoxedUnit.UNIT => println("ok") // warn @@ -6,4 +6,3 @@ object UnitTest extends App { foo(()) } -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i9241.scala b/tests/warn/i9241.scala similarity index 90% rename from tests/neg/i9241.scala rename to tests/warn/i9241.scala index a169ce709b5f..ed1db2df0c8e 100644 --- a/tests/neg/i9241.scala +++ b/tests/warn/i9241.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class Foo { def unary_~() : Foo = this // warn @@ -40,5 +40,4 @@ extension (using Int)(x: Byte) def unary_+[U] : Int = ??? def unary_!() : Int = ??? // warn def unary_~(using Int) : Int = ??? -end extension -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +end extension \ No newline at end of file diff --git a/tests/warn/i9266.scala b/tests/warn/i9266.scala new file mode 100644 index 000000000000..c621e9e20b99 --- /dev/null +++ b/tests/warn/i9266.scala @@ -0,0 +1,6 @@ + + +import language.`future-migration` + +def test = { implicit x: Int => x + x } // warn + diff --git a/tests/neg/i9408a.scala b/tests/warn/i9408a.scala similarity index 94% rename from tests/neg/i9408a.scala rename to tests/warn/i9408a.scala index d3544ec20be5..64b58ff59550 100644 --- a/tests/neg/i9408a.scala +++ b/tests/warn/i9408a.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import language.`3.0-migration` import scala.language.implicitConversions @@ -85,5 +85,4 @@ object Test15 { implicit def implicitSeq[A]: Seq[A] = ??? def foo(implicit ev: Seq[Int]): Unit = ??? foo -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i9740.scala b/tests/warn/i9740.scala similarity index 81% rename from tests/neg/i9740.scala rename to tests/warn/i9740.scala index 8e5f56eaab0d..fc330df4d6a9 100644 --- a/tests/neg/i9740.scala +++ b/tests/warn/i9740.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wimplausible-patterns +//> using options -Wimplausible-patterns abstract class RecoveryCompleted object RecoveryCompleted extends RecoveryCompleted @@ -14,5 +14,4 @@ class Test { def foo(x: TypedRecoveryCompleted) = x match case RecoveryCompleted => // warn case TypedRecoveryCompleted => -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i9740b.scala b/tests/warn/i9740b.scala similarity index 79% rename from tests/neg/i9740b.scala rename to tests/warn/i9740b.scala index 3f3f9a85222c..632308e3322d 100644 --- a/tests/neg/i9740b.scala +++ b/tests/warn/i9740b.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wimplausible-patterns +//> using options -Wimplausible-patterns enum Recovery: case RecoveryCompleted @@ -17,5 +17,4 @@ class Test { def foo(x: TypedRecovery) = x match case RecoveryCompleted => // warn case TypedRecoveryCompleted => -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i9740c.scala b/tests/warn/i9740c.scala similarity index 76% rename from tests/neg/i9740c.scala rename to tests/warn/i9740c.scala index b250ac907454..8ddf87adf46b 100644 --- a/tests/neg/i9740c.scala +++ b/tests/warn/i9740c.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wimplausible-patterns +//> using options -Wimplausible-patterns sealed trait Exp[T] case class IntExp(x: Int) extends Exp[Int] case class StrExp(x: String) extends Exp[String] @@ -16,4 +16,3 @@ class Foo { case Obj(o) => } -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/i9740d.scala b/tests/warn/i9740d.scala similarity index 71% rename from tests/neg/i9740d.scala rename to tests/warn/i9740d.scala index ee0df4ea7cf7..118ee20582dd 100644 --- a/tests/neg/i9740d.scala +++ b/tests/warn/i9740d.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wimplausible-patterns +//> using options -Wimplausible-patterns sealed trait Exp[T] case class IntExp(x: Int) extends Exp[Int] @@ -11,4 +11,3 @@ class Foo[U <: Int, T <: U] { case StrExp(x) => case UnitExp => // warn } -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/warn/i9751.scala b/tests/warn/i9751.scala new file mode 100644 index 000000000000..284070723474 --- /dev/null +++ b/tests/warn/i9751.scala @@ -0,0 +1,11 @@ + + +def f(): Unit = { + () // warn + () +} + +inline def g(): Unit = { + () // warn + () +} \ No newline at end of file diff --git a/tests/neg/i9776.scala b/tests/warn/i9776.scala similarity index 93% rename from tests/neg/i9776.scala rename to tests/warn/i9776.scala index d0f512454a31..93b7cce98fef 100644 --- a/tests/neg/i9776.scala +++ b/tests/warn/i9776.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import scala.annotation.switch @@ -58,5 +58,4 @@ object TaggedFruit { case 2 => true case Apple.tag => true } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i9880.scala b/tests/warn/i9880.scala similarity index 85% rename from tests/neg/i9880.scala rename to tests/warn/i9880.scala index 963711277faf..68775e7646a5 100644 --- a/tests/neg/i9880.scala +++ b/tests/warn/i9880.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + opaque type Bytes = Array[Byte] object Bytes: @@ -29,5 +29,4 @@ class Sym(val owner: Sym) extension (sym: Sym) def isSomething: Boolean = false def isFoo: Boolean = sym.isSomething && sym.owner.isFoo // was: Infinite loop in function body - def isBar: Boolean = sym.isSomething || sym.owner.isBar // was: Infinite loop in function body -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + def isBar: Boolean = sym.isSomething || sym.owner.isBar // was: Infinite loop in function body \ No newline at end of file diff --git a/tests/neg/implicit-conversions-old.scala b/tests/warn/implicit-conversions-old.scala similarity index 81% rename from tests/neg/implicit-conversions-old.scala rename to tests/warn/implicit-conversions-old.scala index c1267ae79064..24e1124015e3 100644 --- a/tests/neg/implicit-conversions-old.scala +++ b/tests/warn/implicit-conversions-old.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -feature +//> using options -feature class A class B @@ -22,5 +22,4 @@ object Test { val x1: A = new B val x2: B = new A // ok, since it's an old-style comversion val x3: C = new A // ok, since it's an old-style comversion -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/implicit-conversions.scala b/tests/warn/implicit-conversions.scala similarity index 81% rename from tests/neg/implicit-conversions.scala rename to tests/warn/implicit-conversions.scala index 154fc0689d98..946d0c96fd5a 100644 --- a/tests/neg/implicit-conversions.scala +++ b/tests/warn/implicit-conversions.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -feature +//> using options -feature class A class B @@ -28,5 +28,4 @@ object Test { val x1: A = new B // warn under -Xfatal-warnings -feature val x2: B = new A // warn under -Xfatal-warnings -feature val x3: C = new A // warn under -Xfatal-warnings -feature -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/infix.scala b/tests/warn/infix.scala similarity index 92% rename from tests/neg/infix.scala rename to tests/warn/infix.scala index 2be1e3091eed..6494df970e3f 100644 --- a/tests/neg/infix.scala +++ b/tests/warn/infix.scala @@ -1,4 +1,4 @@ -//> using options -source future -deprecation -Xfatal-warnings +//> using options -source future -deprecation // Compile with -strict -Xfatal-warnings -deprecation class C: @@ -67,5 +67,4 @@ def test() = { val _ Q _ = q // OK -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/inline-givens.scala b/tests/warn/inline-givens.scala similarity index 67% rename from tests/neg/inline-givens.scala rename to tests/warn/inline-givens.scala index d8b9d1f2692c..5ab4fd65fdc9 100644 --- a/tests/neg/inline-givens.scala +++ b/tests/warn/inline-givens.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class Item(x: String) @@ -12,5 +12,4 @@ inline given c: Conversion[String, Item] = { x => Item(x) } // warn inline given d: Conversion[String, Item] with - def apply(x: String) = Item(x) // ok -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + def apply(x: String) = Item(x) // ok \ No newline at end of file diff --git a/tests/neg/main-functions-nameclash.scala b/tests/warn/main-functions-nameclash.scala similarity index 56% rename from tests/neg/main-functions-nameclash.scala rename to tests/warn/main-functions-nameclash.scala index e72f3d2eb0a4..bc0fe64379d4 100644 --- a/tests/neg/main-functions-nameclash.scala +++ b/tests/warn/main-functions-nameclash.scala @@ -1,7 +1,5 @@ -//> using options -Xfatal-warnings + object foo { @main def foo(x: Int) = () // warn: class foo and object foo produce classes that overwrite one another } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/warn/manifest-summoning-b.scala b/tests/warn/manifest-summoning-b.scala new file mode 100644 index 000000000000..18ddec1250b5 --- /dev/null +++ b/tests/warn/manifest-summoning-b.scala @@ -0,0 +1,4 @@ +//> using options -deprecation + +val foo = manifest[List[? <: Int]] // warn +val bar = optManifest[Array[? <: String]] // warn \ No newline at end of file diff --git a/tests/neg/matchable.scala b/tests/warn/matchable.scala similarity index 84% rename from tests/neg/matchable.scala rename to tests/warn/matchable.scala index 6d8b41f87e55..8adcdcf1c90a 100644 --- a/tests/neg/matchable.scala +++ b/tests/warn/matchable.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -source future +//> using options -source future def foo[T](x: T): Matchable = println(x.getClass()) // ok @@ -25,5 +25,4 @@ def foo[T](x: T): Matchable = @main def Test = val x: Matchable = foo(1) val y: Matchable = foo("hello") - assert(x != y) -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + assert(x != y) \ No newline at end of file diff --git a/tests/neg/newline-braces.scala b/tests/warn/newline-braces.scala similarity index 55% rename from tests/neg/newline-braces.scala rename to tests/warn/newline-braces.scala index 2aea81c229b2..9ec2961ee30d 100644 --- a/tests/neg/newline-braces.scala +++ b/tests/warn/newline-braces.scala @@ -1,4 +1,4 @@ -//> using options -source 3.0-migration -Xfatal-warnings +//> using options -source 3.0-migration def f: List[Int] = { List(1, 2, 3).map // no newline inserted here in Scala-2 compat mode @@ -7,4 +7,3 @@ def f: List[Int] = { } } -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/nonunit-statement.scala b/tests/warn/nonunit-statement.scala similarity index 97% rename from tests/neg/nonunit-statement.scala rename to tests/warn/nonunit-statement.scala index b96d6b5cfa59..297a1063cb4d 100644 --- a/tests/neg/nonunit-statement.scala +++ b/tests/warn/nonunit-statement.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -Wnonunit-statement -Wvalue-discard +//> using options -Wnonunit-statement -Wvalue-discard import collection.ArrayOps import collection.mutable.{ArrayBuilder, LinkedHashSet, ListBuffer} import concurrent._ @@ -195,5 +195,4 @@ class Depends { f(d) () } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/warn/old-syntax.scala b/tests/warn/old-syntax.scala new file mode 100644 index 000000000000..d584e3692a0a --- /dev/null +++ b/tests/warn/old-syntax.scala @@ -0,0 +1,5 @@ +//> using options -deprecation + +val f = (x: Int) ⇒ x + 1 // warn + +val list = for (n ← List(42)) yield n + 1 // warn \ No newline at end of file diff --git a/tests/neg/opaque-match.scala b/tests/warn/opaque-match.scala similarity index 75% rename from tests/neg/opaque-match.scala rename to tests/warn/opaque-match.scala index 88c8104506ae..453d525bac2c 100644 --- a/tests/neg/opaque-match.scala +++ b/tests/warn/opaque-match.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + case class C() @@ -21,5 +21,4 @@ def Test[T] = (??? : Any) match case _: List[O.T @unchecked] => ??? // OK (??? : Any) match - case _: List[T] => ??? // warn -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + case _: List[T] => ??? // warn \ No newline at end of file diff --git a/tests/neg-deep-subtype/or-type-trees.scala b/tests/warn/or-type-trees.scala similarity index 90% rename from tests/neg-deep-subtype/or-type-trees.scala rename to tests/warn/or-type-trees.scala index 4e74df3cea4e..ed6e4d01b9ff 100644 --- a/tests/neg-deep-subtype/or-type-trees.scala +++ b/tests/warn/or-type-trees.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + object Test1 { trait Tree @@ -37,5 +37,4 @@ object Test2 { myTree match case treeFn: (_ => _) => // ok case _ => -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/warn/ovlazy.scala b/tests/warn/ovlazy.scala new file mode 100644 index 000000000000..1dfa284a00c9 --- /dev/null +++ b/tests/warn/ovlazy.scala @@ -0,0 +1,9 @@ +//> using options -source 3.0-migration + +class A { + val x: Int = 1 +} +class B extends A { + override lazy val x: Int = 2 // warn +} + diff --git a/tests/neg/quote-simple-hole.scala b/tests/warn/quote-simple-hole.scala similarity index 77% rename from tests/neg/quote-simple-hole.scala rename to tests/warn/quote-simple-hole.scala index 88af780aa5cd..f23d2c0535c4 100644 --- a/tests/neg/quote-simple-hole.scala +++ b/tests/warn/quote-simple-hole.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import scala.quoted.Quotes @@ -14,5 +14,4 @@ def test(using Quotes) = { } } } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg-deep-subtype/refined-types.scala b/tests/warn/refined-types.scala similarity index 90% rename from tests/neg-deep-subtype/refined-types.scala rename to tests/warn/refined-types.scala index 0e76ff58515f..1ef0f84c00d4 100644 --- a/tests/neg-deep-subtype/refined-types.scala +++ b/tests/warn/refined-types.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + class A class B extends A @@ -21,5 +21,4 @@ def bu(x: AA) = x.isInstanceOf[BU] // was: the type test for BU cannot be checke def al_ba(x: AL) = x.isInstanceOf[BA] // warn: the type test for BA cannot be checked at runtime def au_ba(x: AU) = x.isInstanceOf[BA] // warn: the type test for BA cannot be checked at runtime def al_bu(x: AL) = x.isInstanceOf[BU] // warn: the type test for BU cannot be checked at runtime -def au_bl(x: AU) = x.isInstanceOf[BL] // warn: the type test for BL cannot be checked at runtime -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +def au_bl(x: AU) = x.isInstanceOf[BL] // warn: the type test for BL cannot be checked at runtime \ No newline at end of file diff --git a/tests/neg/refinements-this.scala b/tests/warn/refinements-this.scala similarity index 52% rename from tests/neg/refinements-this.scala rename to tests/warn/refinements-this.scala index 111ce84ffdc8..3e4c64cf1e59 100644 --- a/tests/neg/refinements-this.scala +++ b/tests/warn/refinements-this.scala @@ -1,7 +1,6 @@ -//> using options -Xfatal-warnings + class Outer: type X = { type O = Outer.this.type } // ok type Y = { type O = this.type } // warn -// nopos-error: No warnings can be incurred under -Werror. diff --git a/tests/neg/strict-pattern-bindings-3.2.scala b/tests/warn/strict-pattern-bindings-3.2.scala similarity index 90% rename from tests/neg/strict-pattern-bindings-3.2.scala rename to tests/warn/strict-pattern-bindings-3.2.scala index c678e2ebe93a..e4df8e770a01 100644 --- a/tests/neg/strict-pattern-bindings-3.2.scala +++ b/tests/warn/strict-pattern-bindings-3.2.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + // These tests should fail under -Xfatal-warnings with source version source version 3.2 or later import language.`3.2` @@ -34,5 +34,4 @@ object Test: object Triple { def unapply(t: (Int, Int, Int)): (Int, Int, Int) = t } val Positive(p) = 5 // warn - val Some(s1) = Option(1) // warn -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + val Some(s1) = Option(1) // warn \ No newline at end of file diff --git a/tests/neg/supertraits-b.scala b/tests/warn/supertraits-b.scala similarity index 84% rename from tests/neg/supertraits-b.scala rename to tests/warn/supertraits-b.scala index b56059b4abbb..b36fcb5634b7 100644 --- a/tests/neg/supertraits-b.scala +++ b/tests/warn/supertraits-b.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + transparent sealed trait TA transparent sealed trait TB @@ -32,5 +32,4 @@ object Test: choose4(a, b) match case _: (TA & TB) => ??? - case _: Product => ??? // warn: unreachable -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file + case _: Product => ??? // warn: unreachable \ No newline at end of file diff --git a/tests/neg/switches.scala b/tests/warn/switches.scala similarity index 97% rename from tests/neg/switches.scala rename to tests/warn/switches.scala index f662a1f694ca..9b45e3ed0d51 100644 --- a/tests/neg/switches.scala +++ b/tests/warn/switches.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import scala.annotation.switch @@ -99,5 +99,4 @@ object Main { case IntAnyVal(1000) => 3 case IntAnyVal(10000) => 4 } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/symbolic-packages.scala b/tests/warn/symbolic-packages.scala similarity index 59% rename from tests/neg/symbolic-packages.scala rename to tests/warn/symbolic-packages.scala index 557fb06f68a9..6e0ef04da6bb 100644 --- a/tests/neg/symbolic-packages.scala +++ b/tests/warn/symbolic-packages.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + package `with spaces` { // warn class Foo @@ -10,5 +10,4 @@ package +.* { // warn // warn package object `mixed_*` { // warn class Baz -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg-deep-subtype/t2755.scala b/tests/warn/t2755.scala similarity index 95% rename from tests/neg-deep-subtype/t2755.scala rename to tests/warn/t2755.scala index 698b59a57efd..89ebda4fb54d 100644 --- a/tests/neg-deep-subtype/t2755.scala +++ b/tests/warn/t2755.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + // Test cases: the only place we can cut and paste without crying // ourself to sleep. @@ -57,5 +57,4 @@ object Test { println(f3(Array(1L))) println(f3(null)) } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/t3235-minimal.scala b/tests/warn/t3235-minimal.scala similarity index 74% rename from tests/neg/t3235-minimal.scala rename to tests/warn/t3235-minimal.scala index 27448da4b80b..22e6da9f31a0 100644 --- a/tests/neg/t3235-minimal.scala +++ b/tests/warn/t3235-minimal.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings -deprecation +//> using options -deprecation object Test { def main(args: Array[String]): Unit = { @@ -7,5 +7,4 @@ object Test { assert(1234567890123456789L.round == 1234567890123456789L) // warn assert(math.round(1234567890123456789L) == 1234567890123456789L) // warn } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/t5830.scala b/tests/warn/t5830.scala similarity index 69% rename from tests/neg/t5830.scala rename to tests/warn/t5830.scala index dc6e51ed1f3d..41cdfb1059a7 100644 --- a/tests/neg/t5830.scala +++ b/tests/warn/t5830.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import scala.annotation.switch @@ -9,5 +9,3 @@ class Test { case 'c' => } } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg-deep-subtype/type-lambda.scala b/tests/warn/type-lambda.scala similarity index 74% rename from tests/neg-deep-subtype/type-lambda.scala rename to tests/warn/type-lambda.scala index 9e1b1b408f7c..788647496a4f 100644 --- a/tests/neg-deep-subtype/type-lambda.scala +++ b/tests/warn/type-lambda.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + trait A[T] trait B[T] extends A[T] @@ -14,5 +14,3 @@ object Test { case _ => } } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/type-test-paths-2.scala b/tests/warn/type-test-paths-2.scala similarity index 91% rename from tests/neg/type-test-paths-2.scala rename to tests/warn/type-test-paths-2.scala index 5a68c1607bfd..79b22fa70049 100644 --- a/tests/neg/type-test-paths-2.scala +++ b/tests/warn/type-test-paths-2.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import scala.reflect.TypeTest @@ -40,5 +40,4 @@ object Test { case n: r1.Idx => // warn: the type test for Test.r1.Idx cannot be checked at runtime case n: r1.Nat => // Ok } -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/type-test-paths.scala b/tests/warn/type-test-paths.scala similarity index 87% rename from tests/neg/type-test-paths.scala rename to tests/warn/type-test-paths.scala index e8c9d2879e6d..03501cfd5957 100644 --- a/tests/neg/type-test-paths.scala +++ b/tests/warn/type-test-paths.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import scala.reflect.TypeTest @@ -37,5 +37,3 @@ object T1 extends T { } } - -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file diff --git a/tests/neg/type-test-syntesize-b.scala b/tests/warn/type-test-syntesize-b.scala similarity index 82% rename from tests/neg/type-test-syntesize-b.scala rename to tests/warn/type-test-syntesize-b.scala index ab3b970f79f8..f5a71c816ef1 100644 --- a/tests/neg/type-test-syntesize-b.scala +++ b/tests/warn/type-test-syntesize-b.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + import scala.reflect.TypeTest @@ -28,5 +28,4 @@ object Test { class A { type X type Y <: X -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/xfatalWarnings.scala b/tests/warn/xfatalWarnings.scala similarity index 74% rename from tests/neg/xfatalWarnings.scala rename to tests/warn/xfatalWarnings.scala index 13763bf3b48d..7e77ac468370 100644 --- a/tests/neg/xfatalWarnings.scala +++ b/tests/warn/xfatalWarnings.scala @@ -1,4 +1,4 @@ -//> using options -Xfatal-warnings + object xfatalWarnings { val opt:Option[String] = Some("test") @@ -13,4 +13,3 @@ object xfatalWarnings { } // When running with fatal warnings: -// nopos-error: No warnings can be incurred under -Werror.