Skip to content

Commit 454596b

Browse files
committed
Move some files to warn
1 parent fbdf7c6 commit 454596b

14 files changed

+104
-46
lines changed
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
-- Error: tests/neg-custom-args/fatal-warnings/i12253.scala:11:10 ------------------------------------------------------
1+
-- [E092] Pattern Match Error: tests/neg-custom-args/fatal-warnings/i12253.scala:11:10 ---------------------------------
22
11 | case extractors.InlinedLambda(_, Select(_, name)) => Expr(name) // error // error
33
| ^
44
|the type test for extractors.q2.reflect.Term cannot be checked at runtime because it refers to an abstract type member or type parameter
5-
-- Error: tests/neg-custom-args/fatal-warnings/i12253.scala:11:38 ------------------------------------------------------
5+
|
6+
| longer explanation available when compiling with `-explain`
7+
-- [E092] Pattern Match Error: tests/neg-custom-args/fatal-warnings/i12253.scala:11:38 ---------------------------------
68
11 | case extractors.InlinedLambda(_, Select(_, name)) => Expr(name) // error // error
79
| ^
810
|the type test for q1.reflect.Select cannot be checked at runtime because it refers to an abstract type member or type parameter
11+
|
12+
| longer explanation available when compiling with `-explain`
913
there was 1 deprecation warning; re-run with -deprecation for details
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
-- Error: tests/neg-custom-args/fatal-warnings/i16728.scala:16:11 ------------------------------------------------------
1+
-- [E092] Pattern Match Error: tests/neg-custom-args/fatal-warnings/i16728.scala:16:11 ---------------------------------
22
16 | case tx : C[Int]#X => // error
33
| ^
44
| the type test for C[Int] cannot be checked at runtime because its type arguments can't be determined from A
5+
|
6+
| longer explanation available when compiling with `-explain`

tests/neg-custom-args/isInstanceOf/enum-approx2.scala

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

tests/neg-custom-args/nowarn/nowarn.check

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ Matching filters for @nowarn or -Wconf:
6666
47 |def t7c = f // warning (deprecation)
6767
| ^
6868
| method f is deprecated
69-
-- Unchecked Warning: tests/neg-custom-args/nowarn/nowarn.scala:53:7 ---------------------------------------------------
69+
-- [E092] Pattern Match Unchecked Warning: tests/neg-custom-args/nowarn/nowarn.scala:53:7 ------------------------------
7070
53 | case _: List[Int] => 0 // warning (patmat, unchecked)
7171
| ^
7272
|the type test for List[Int] cannot be checked at runtime because its type arguments can't be determined from Any
73+
|
74+
| longer explanation available when compiling with `-explain`
7375
-- Error: tests/neg-custom-args/nowarn/nowarn.scala:31:1 ---------------------------------------------------------------
7476
31 |@nowarn("id=1") def t4d = try 1 // error and warning (unused nowarn, wrong id)
7577
|^^^^^^^^^^^^^^^

tests/neg/15981.check

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
-- Error: tests/neg/15981.scala:4:45 -----------------------------------------------------------------------------------
1+
-- [E092] Pattern Match Error: tests/neg/15981.scala:4:45 --------------------------------------------------------------
22
4 | override def equals(any: Any): Boolean = any.isInstanceOf[PosInt] // error
33
| ^^^
44
| the type test for PosInt cannot be checked at runtime because it's a local class
5+
|
6+
| longer explanation available when compiling with `-explain`

tests/neg/i4812.check

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
1-
-- Error: tests/neg/i4812.scala:8:11 -----------------------------------------------------------------------------------
1+
-- [E092] Pattern Match Error: tests/neg/i4812.scala:8:11 --------------------------------------------------------------
22
8 | case prev: A => // error: the type test for A cannot be checked at runtime
33
| ^
44
| the type test for A cannot be checked at runtime because it's a local class
5-
-- Error: tests/neg/i4812.scala:18:11 ----------------------------------------------------------------------------------
5+
|
6+
| longer explanation available when compiling with `-explain`
7+
-- [E092] Pattern Match Error: tests/neg/i4812.scala:18:11 -------------------------------------------------------------
68
18 | case prev: A => // error: the type test for A cannot be checked at runtime
79
| ^
810
| the type test for A cannot be checked at runtime because it's a local class
9-
-- Error: tests/neg/i4812.scala:28:11 ----------------------------------------------------------------------------------
11+
|
12+
| longer explanation available when compiling with `-explain`
13+
-- [E092] Pattern Match Error: tests/neg/i4812.scala:28:11 -------------------------------------------------------------
1014
28 | case prev: A => // error: the type test for A cannot be checked at runtime
1115
| ^
1216
| the type test for A cannot be checked at runtime because it's a local class
13-
-- Error: tests/neg/i4812.scala:38:11 ----------------------------------------------------------------------------------
17+
|
18+
| longer explanation available when compiling with `-explain`
19+
-- [E092] Pattern Match Error: tests/neg/i4812.scala:38:11 -------------------------------------------------------------
1420
38 | case prev: A => // error: the type test for A cannot be checked at runtime
1521
| ^
1622
| the type test for A cannot be checked at runtime because it's a local class
17-
-- Error: tests/neg/i4812.scala:50:13 ----------------------------------------------------------------------------------
23+
|
24+
| longer explanation available when compiling with `-explain`
25+
-- [E092] Pattern Match Error: tests/neg/i4812.scala:50:13 -------------------------------------------------------------
1826
50 | case prev: A => // error: the type test for A cannot be checked at runtime
1927
| ^
2028
| the type test for A cannot be checked at runtime because it's a local class
21-
-- Error: tests/neg/i4812.scala:60:11 ----------------------------------------------------------------------------------
29+
|
30+
| longer explanation available when compiling with `-explain`
31+
-- [E092] Pattern Match Error: tests/neg/i4812.scala:60:11 -------------------------------------------------------------
2232
60 | case prev: A => // error: the type test for A cannot be checked at runtime
2333
| ^
2434
| the type test for A cannot be checked at runtime because it's a local class
25-
-- Error: tests/neg/i4812.scala:96:11 ----------------------------------------------------------------------------------
35+
|
36+
| longer explanation available when compiling with `-explain`
37+
-- [E092] Pattern Match Error: tests/neg/i4812.scala:96:11 -------------------------------------------------------------
2638
96 | case x: B => // error: the type test for B cannot be checked at runtime
2739
| ^
2840
| the type test for B cannot be checked at runtime because it's a local class
41+
|
42+
| longer explanation available when compiling with `-explain`

tests/warn/enum-approx2.check

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- [E092] Pattern Match Unchecked Warning: tests/warn/enum-approx2.scala:6:13 ------------------------------------------
2+
6 | case Fun(x: Fun[Int, Double]) => ??? // warn: unchecked
3+
| ^
4+
|the type test for Fun[Int, Double] cannot be checked at runtime because its type arguments can't be determined from Exp[Int => Int]
5+
|
6+
| longer explanation available when compiling with `-explain`
7+
-- [E092] Pattern Match Unchecked Warning: tests/warn/enum-approx2.scala:7:13 ------------------------------------------
8+
7 | case Fun(x: Exp[Int => String]) => ??? // warn: unreachable // warn: unchecked
9+
| ^
10+
|the type test for Exp[Int => String] cannot be checked at runtime because its type arguments can't be determined from Exp[Int => Int]
11+
|
12+
| longer explanation available when compiling with `-explain`

tests/warn/enum-approx2.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sealed trait Exp[T]
2+
case class Fun[A, B](f: Exp[A => B]) extends Exp[A => B]
3+
4+
class Test {
5+
def eval(e: Fun[Int, Int]) = e match {
6+
case Fun(x: Fun[Int, Double]) => ??? // warn: unchecked
7+
case Fun(x: Exp[Int => String]) => ??? // warn: unreachable // warn: unchecked
8+
case _ => // warn: unreachable-only-null
9+
}
10+
}

tests/warn/i16451.check

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
1-
-- [E029] Pattern Match Exhaustivity Warning: tests/warn/i16451.scala:12:73 --------------------------------------------
2-
12 | def test_correct(x: Wrapper[Color]): Option[Wrapper[Color.Red.type]] = x match // error: inexhaustive
3-
| ^
4-
| match may not be exhaustive.
5-
|
6-
| It would fail on pattern case: Wrapper(_)
7-
|
8-
| longer explanation available when compiling with `-explain`
9-
-- [E030] Match case Unreachable Warning: tests/warn/i16451.scala:25:9 -------------------------------------------------
10-
25 | case x: Wrapper[Color.Red.type] => Some(x) // error: unreachable // error: unchecked
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
1+
-- [E030] Match case Unreachable Warning: tests/warn/i16451.scala:14:9 -------------------------------------------------
2+
14 | case x: Wrapper[Color.Green.type] => None // error: unchecked
3+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
124
| Unreachable case
13-
-- [E030] Match case Unreachable Warning: tests/warn/i16451.scala:29:9 -------------------------------------------------
14-
29 | case x: Wrapper[Color.Red.type] => Some(x) // error: unreachable // error: unchecked
15-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
-- [E030] Match case Unreachable Warning: tests/warn/i16451.scala:22:9 -------------------------------------------------
6+
22 | case x: Wrapper[Color.Green.type] => None // error: unchecked
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
168
| Unreachable case
17-
-- [E030] Match case Unreachable Warning: tests/warn/i16451.scala:34:11 ------------------------------------------------
18-
34 | case x: Wrapper[Color.Red.type] => x // error: unreachable // error: unchecked
19-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
20-
| Unreachable case
21-
-- [E030] Match case Unreachable Warning: tests/warn/i16451.scala:39:11 ------------------------------------------------
22-
39 | case x: Wrapper[Color.Red.type] => x // error: unreachable // error: unchecked
23-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
24-
| Unreachable case
9+
-- [E121] Pattern Match Warning: tests/warn/i16451.scala:26:9 ----------------------------------------------------------
10+
26 | case _ => None
11+
| ^
12+
| Unreachable case except for null (if this is intentional, consider writing case null => instead).
13+
-- [E121] Pattern Match Warning: tests/warn/i16451.scala:30:9 ----------------------------------------------------------
14+
30 | case _ => None
15+
| ^
16+
| Unreachable case except for null (if this is intentional, consider writing case null => instead).
2517
-- [E092] Pattern Match Unchecked Warning: tests/warn/i16451.scala:13:9 ------------------------------------------------
2618
13 | case x: Wrapper[Color.Red.type] => Some(x) // error: unchecked
2719
| ^

tests/warn/i5826.check

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
-- [E092] Pattern Match Unchecked Warning: tests/warn/i5826.scala:3:9 --------------------------------------------------
2+
3 | case ls: List[Int] => ls.head // error, A = List[String]
3+
| ^
4+
| the type test for List[Int] cannot be checked at runtime because its type arguments can't be determined from A
5+
|
6+
| longer explanation available when compiling with `-explain`
7+
-- [E092] Pattern Match Unchecked Warning: tests/warn/i5826.scala:8:9 --------------------------------------------------
8+
8 | case ls: List[Int] => ls.head // warn: unchecked
9+
| ^
10+
|the type test for List[Int] cannot be checked at runtime because its type arguments can't be determined from List[String]
11+
|
12+
| longer explanation available when compiling with `-explain`
13+
-- [E092] Pattern Match Unchecked Warning: tests/warn/i5826.scala:17:9 -------------------------------------------------
14+
17 | case ls: A[X] => 4 // error
15+
| ^
16+
|the type test for Foo.this.A[X] cannot be checked at runtime because its type arguments can't be determined from Foo.this.B[X]
17+
|
18+
| longer explanation available when compiling with `-explain`
19+
-- [E092] Pattern Match Unchecked Warning: tests/warn/i5826.scala:22:9 -------------------------------------------------
20+
22 | case ls: List[Int] => ls.head // error, List extends Int => T
21+
| ^
22+
|the type test for List[Int] cannot be checked at runtime because its type arguments can't be determined from A => Int
23+
|
24+
| longer explanation available when compiling with `-explain`
25+
-- [E092] Pattern Match Unchecked Warning: tests/warn/i5826.scala:28:54 ------------------------------------------------
26+
28 | def test5[T](x: A[T] | B[T] | Option[T]): Boolean = x.isInstanceOf[C[String]] // error
27+
| ^
28+
|the type test for Foo.this.C[String] cannot be checked at runtime because its type arguments can't be determined from Foo.this.A[T]
29+
|
30+
| longer explanation available when compiling with `-explain`

tests/neg-custom-args/isInstanceOf/i5826.scala renamed to tests/warn/i5826.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ class Foo {
55
}
66

77
def test2: List[Int] | List[String] => Int = {
8-
case ls: List[Int] => ls.head // error
9-
case _ => 0
8+
case ls: List[Int] => ls.head // warn: unchecked
9+
case _ => 0 // warn: unreachable-only-null
1010
}
1111

1212
trait A[T]

0 commit comments

Comments
 (0)