Skip to content

Commit

Permalink
Move warn tests from tests/neg to tests/warn: Batch 2
Browse files Browse the repository at this point in the history
  • Loading branch information
szymon-rd committed Dec 11, 2023
1 parent 55a63f3 commit dd50793
Show file tree
Hide file tree
Showing 210 changed files with 857 additions and 3,731 deletions.
15 changes: 0 additions & 15 deletions tests/neg/14034b.scala

This file was deleted.

14 changes: 0 additions & 14 deletions tests/neg/17284.scala

This file was deleted.

8 changes: 0 additions & 8 deletions tests/neg/18493.check

This file was deleted.

11 changes: 6 additions & 5 deletions tests/neg/adhoc-extension/B.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
//> using options -source future -feature -Xfatal-warnings

package adhoc
class B extends A // error: adhoc-extension (under -strict -feature -Xfatal-warnings)
class C extends A // error
class B extends A // warn: adhoc-extension (under -strict -feature -Xfatal-warnings)
class C extends A // warn

object O {
val a = new A {} // error
object E extends A // error
}
val a = new A {} // warn
object E extends A // warn
}
// nopos-error: No warnings can be incurred under -Werror.
11 changes: 0 additions & 11 deletions tests/neg/avoid-warn-deprecation.scala

This file was deleted.

11 changes: 6 additions & 5 deletions tests/neg/capt-wf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ def test(c: Cap, other: String): Unit =
val x3a: () -> String = s1
val s2 = () => if x1 == null then "" else "abc"
val x4: C^{s2} = ??? // OK
val x5: C^{c, c} = ??? // error: redundant // error: redundant
val x5: C^{c, c} = ??? // warn: redundant // warn: redundant
// val x6: C^{c}^{c} = ??? // would be syntax error
val x7: Cap^{c} = ??? // error: redundant
val x7: Cap^{c} = ??? // warn: redundant
// val x8: C^{c}^{cap} = ??? // would be syntax error
val x9: C^{c, cap} = ??? // error: redundant
val x10: C^{cap, c} = ??? // error: redundant
val x9: C^{c, cap} = ??? // warn: redundant
val x10: C^{cap, c} = ??? // warn: redundant

def even(n: Int): Boolean = if n == 0 then true else odd(n - 1)
def odd(n: Int): Boolean = if n == 1 then true else even(n - 1)
Expand All @@ -34,4 +34,5 @@ def test(c: Cap, other: String): Unit =
if n == 0 then true else od(n - 1)
val y3: String^{ev} = ??? // error cs is empty

()
()
// nopos-error: No warnings can be incurred under -Werror.
3 changes: 2 additions & 1 deletion tests/neg/classtag-typetest/3_1-migration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ import scala.reflect.ClassTag

def f3_1m[T: ClassTag](x: Any): Unit =
x match
case _: T => // error
case _: T => // warn
// nopos-error: No warnings can be incurred under -Werror.
3 changes: 2 additions & 1 deletion tests/neg/classtag-typetest/3_1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ import scala.reflect.ClassTag

def f3_1[T: ClassTag](x: Any): Unit =
x match
case _: T => // error
case _: T => // warn
// nopos-error: No warnings can be incurred under -Werror.
28 changes: 0 additions & 28 deletions tests/neg/i10247.scala

This file was deleted.

15 changes: 0 additions & 15 deletions tests/neg/i10930.scala

This file was deleted.

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

This file was deleted.

20 changes: 0 additions & 20 deletions tests/neg/i11022.check

This file was deleted.

13 changes: 0 additions & 13 deletions tests/neg/i11022.scala

This file was deleted.

15 changes: 0 additions & 15 deletions tests/neg/i11097.scala

This file was deleted.

6 changes: 6 additions & 0 deletions tests/neg/i11225b.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- Error: tests/neg/i11225b.scala:6:26 ---------------------------------------------------------------------------------
6 | private var cached: A = _ // error
| ^
| `= _` has been deprecated; use `= uninitialized` instead.
| `uninitialized` can be imported with `scala.compiletime.uninitialized`.
| This construct can be rewritten automatically under -rewrite -source 3.4-migration.
3 changes: 2 additions & 1 deletion tests/neg/i11225b.scala
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

import compiletime.uninitialized

Expand All @@ -10,3 +10,4 @@ class Memo[A](x: => A):
known = true
cached = x
cached

30 changes: 0 additions & 30 deletions tests/neg/i11333.check

This file was deleted.

14 changes: 0 additions & 14 deletions tests/neg/i11333.scala

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

6 changes: 4 additions & 2 deletions tests/neg/i12188/Test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ case class PC2(b: Int) extends P
def Test = MatchTest.test(PC2(10): P)

def foo(x: P): Unit =
x match // error
case _: PC1 =>
x match // warn
case _: PC1 =>

// nopos-error: No warnings can be incurred under -Werror.
13 changes: 0 additions & 13 deletions tests/neg/i12253.check

This file was deleted.

30 changes: 0 additions & 30 deletions tests/neg/i12253.scala

This file was deleted.

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

This file was deleted.

23 changes: 0 additions & 23 deletions tests/neg/i13011.scala

This file was deleted.

Loading

0 comments on commit dd50793

Please sign in to comment.