Skip to content

Commit 4d111b9

Browse files
committed
Move warn tests from tests/neg to tests/warn: Batch 2
1 parent ec5ac6d commit 4d111b9

File tree

210 files changed

+857
-3731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+857
-3731
lines changed

tests/neg/14034b.scala

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/neg/17284.scala

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/neg/18493.check

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/neg/adhoc-extension/B.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//> using options -source future -feature -Xfatal-warnings
22

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

77
object O {
8-
val a = new A {} // error
9-
object E extends A // error
10-
}
8+
val a = new A {} // warn
9+
object E extends A // warn
10+
}
11+
// nopos-error: No warnings can be incurred under -Werror.

tests/neg/avoid-warn-deprecation.scala

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/neg/capt-wf.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ def test(c: Cap, other: String): Unit =
1313
val x3a: () -> String = s1
1414
val s2 = () => if x1 == null then "" else "abc"
1515
val x4: C^{s2} = ??? // OK
16-
val x5: C^{c, c} = ??? // error: redundant // error: redundant
16+
val x5: C^{c, c} = ??? // warn: redundant // warn: redundant
1717
// val x6: C^{c}^{c} = ??? // would be syntax error
18-
val x7: Cap^{c} = ??? // error: redundant
18+
val x7: Cap^{c} = ??? // warn: redundant
1919
// val x8: C^{c}^{cap} = ??? // would be syntax error
20-
val x9: C^{c, cap} = ??? // error: redundant
21-
val x10: C^{cap, c} = ??? // error: redundant
20+
val x9: C^{c, cap} = ??? // warn: redundant
21+
val x10: C^{cap, c} = ??? // warn: redundant
2222

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

37-
()
37+
()
38+
// nopos-error: No warnings can be incurred under -Werror.

tests/neg/classtag-typetest/3_1-migration.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ import scala.reflect.ClassTag
55

66
def f3_1m[T: ClassTag](x: Any): Unit =
77
x match
8-
case _: T => // error
8+
case _: T => // warn
9+
// nopos-error: No warnings can be incurred under -Werror.

tests/neg/classtag-typetest/3_1.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ import scala.reflect.ClassTag
55

66
def f3_1[T: ClassTag](x: Any): Unit =
77
x match
8-
case _: T => // error
8+
case _: T => // warn
9+
// nopos-error: No warnings can be incurred under -Werror.

tests/neg/i10247.scala

Lines changed: 0 additions & 28 deletions
This file was deleted.

tests/neg/i10930.scala

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/neg/i10994.scala

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/neg/i11022.check

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/neg/i11022.scala

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/neg/i11097.scala

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/neg/i11225b.check

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- Error: tests/neg/i11225b.scala:6:26 ---------------------------------------------------------------------------------
2+
6 | private var cached: A = _ // error
3+
| ^
4+
| `= _` has been deprecated; use `= uninitialized` instead.
5+
| `uninitialized` can be imported with `scala.compiletime.uninitialized`.
6+
| This construct can be rewritten automatically under -rewrite -source 3.4-migration.

tests/neg/i11225b.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//> using options -source future -deprecation -Xfatal-warnings
1+
//> using options -source future -deprecation
22

33
import compiletime.uninitialized
44

@@ -10,3 +10,4 @@ class Memo[A](x: => A):
1010
known = true
1111
cached = x
1212
cached
13+

tests/neg/i11333.check

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/neg/i11333.scala

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/neg/i11344.scala

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/neg/i11963a.scala

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/neg/i11963b.scala

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/neg/i11963c.scala

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/neg/i12188/Test.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ case class PC2(b: Int) extends P
77
def Test = MatchTest.test(PC2(10): P)
88

99
def foo(x: P): Unit =
10-
x match // error
11-
case _: PC1 =>
10+
x match // warn
11+
case _: PC1 =>
12+
13+
// nopos-error: No warnings can be incurred under -Werror.

tests/neg/i12253.check

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/neg/i12253.scala

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/neg/i12597.scala

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/neg/i13011.scala

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)