Skip to content

Commit

Permalink
Move warn tests to warn
Browse files Browse the repository at this point in the history
  • Loading branch information
szymon-rd committed Nov 3, 2023
1 parent dd9808a commit a9a67d5
Show file tree
Hide file tree
Showing 127 changed files with 255 additions and 386 deletions.
8 changes: 0 additions & 8 deletions tests/neg-deep-subtype/i3324.scala

This file was deleted.

6 changes: 0 additions & 6 deletions tests/neg/i10994.scala

This file was deleted.

5 changes: 0 additions & 5 deletions tests/neg/i11963a.scala

This file was deleted.

5 changes: 0 additions & 5 deletions tests/neg/i11963b.scala

This file was deleted.

10 changes: 0 additions & 10 deletions tests/neg/i11963c.scala

This file was deleted.

7 changes: 0 additions & 7 deletions tests/neg/i14705.scala

This file was deleted.

8 changes: 0 additions & 8 deletions tests/neg/i2673.scala

This file was deleted.

8 changes: 0 additions & 8 deletions tests/neg/i2673b.scala

This file was deleted.

10 changes: 0 additions & 10 deletions tests/neg/i2673c.scala

This file was deleted.

5 changes: 0 additions & 5 deletions tests/neg/i4936b.scala

This file was deleted.

7 changes: 0 additions & 7 deletions tests/neg/i6190b.scala

This file was deleted.

7 changes: 0 additions & 7 deletions tests/neg/i9266.scala

This file was deleted.

12 changes: 0 additions & 12 deletions tests/neg/i9751.scala

This file was deleted.

5 changes: 0 additions & 5 deletions tests/neg/manifest-summoning-b.scala

This file was deleted.

6 changes: 0 additions & 6 deletions tests/neg/old-syntax.scala

This file was deleted.

10 changes: 0 additions & 10 deletions tests/neg/ovlazy.scala

This file was deleted.

5 changes: 2 additions & 3 deletions tests/neg/14034b.scala → tests/warn/14034b.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings -deprecation
//> using options -deprecation

@deprecated trait Exp
@deprecated val exp = 1
Expand All @@ -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.
type Quuz[A <: Exp] = Int // warn
4 changes: 1 addition & 3 deletions tests/neg-deep-subtype/1828.scala → tests/warn/1828.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings


class Test {
def remove[S](a: S | Int, f: Int => S):S = a match {
Expand All @@ -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.
5 changes: 2 additions & 3 deletions tests/neg-deep-subtype/3324b.scala → tests/warn/3324b.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings


class C[T] {
val x: Any = ???
Expand All @@ -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.
}
5 changes: 2 additions & 3 deletions tests/neg-deep-subtype/3324f.scala → tests/warn/3324f.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings


trait C[T]
class D[T]
Expand All @@ -8,5 +8,4 @@ class Test {
case _: D[T] => // warn
case _: C[Int] => // warn
}
}
// nopos-error: No warnings can be incurred under -Werror.
}
5 changes: 2 additions & 3 deletions tests/neg-deep-subtype/3324g.scala → tests/warn/3324g.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings


class Test {
trait A[+T]
Expand All @@ -18,5 +18,4 @@ class Test {
}

quux(new C[Int])
}
// nopos-error: No warnings can be incurred under -Werror.
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings


import scala.reflect.TypeTest

Expand All @@ -23,4 +23,3 @@ object IsInstanceOfClassTag {
}
}

// nopos-error: No warnings can be incurred under -Werror.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings


object Test1 {
trait Tree[-T]
Expand Down Expand Up @@ -29,5 +29,3 @@ object Test2 {

foo1(new DummyTree)
}

// nopos-error: No warnings can be incurred under -Werror.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings -feature
//> using options -feature

object A {
@deprecated("use bar instead of this one", "0.2.3")
Expand All @@ -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.
// nopos-warn there was 1 deprecation warning; re-run with -deprecation for details
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -deprecation -Xfatal-warnings
//> using options -deprecation

object Test {
@deprecated def foo = ???
Expand All @@ -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.
}
5 changes: 2 additions & 3 deletions tests/neg/convertible.scala → tests/warn/convertible.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings -feature
//> using options -feature

import language.experimental.into

Expand Down Expand Up @@ -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.
y("abc") // warn, inference through type variable does not propagate
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -source future -deprecation -Xfatal-warnings
//> using options -source future -deprecation

trait A:
def f: Int
Expand All @@ -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.
object E extends B, D // warn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings -feature
//> using options -feature

import language.implicitConversions
given Conversion[Int, String] = _.toString
Expand All @@ -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.
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -11,5 +11,4 @@ object Test {
case (Bar3, _) => ()
}

}
// nopos-error: No warnings can be incurred under -Werror.
}
4 changes: 1 addition & 3 deletions tests/neg-deep-subtype/gadt.scala → tests/warn/gadt.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings


class Test {
trait A[+T]
Expand All @@ -13,5 +13,3 @@ class Test {

quux(new B[D])
}

// nopos-error: No warnings can be incurred under -Werror.
4 changes: 1 addition & 3 deletions tests/neg-deep-subtype/html.scala → tests/warn/html.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings


object HTML:
type AttrArg = AppliedAttr | Seq[AppliedAttr]
Expand All @@ -18,5 +18,3 @@ object HTML:
}
sb
}

// nopos-error: No warnings can be incurred under -Werror.
5 changes: 2 additions & 3 deletions tests/neg/i10247.scala → tests/warn/i10247.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings -deprecation
//> using options -deprecation

def usered = Color.Red // warn: value Red is deprecated

Expand All @@ -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.
}
5 changes: 2 additions & 3 deletions tests/neg/i10930.scala → tests/warn/i10930.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings


import language.future
@main def Test =
Expand All @@ -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.
case x: AnyVal => x // warn
5 changes: 5 additions & 0 deletions tests/warn/i10994.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


def foo = true match
case (b: Boolean): Boolean => () // warn

Loading

0 comments on commit a9a67d5

Please sign in to comment.