|
| 1 | +-- Error: tests/neg/refutable-pattern-binding-messages-maybe.scala:6:14 ------------------------------------------------ |
| 2 | +6 | val Positive(p) = 5 // error: refutable extractor |
| 3 | + | ^^^^^^^^^^^^^^^ |
| 4 | + | pattern binding uses refutable extractor `Test.Positive` |
| 5 | + | |
| 6 | + | If this usage is intentional, this can be communicated by adding `.runtimeChecked` after the expression, |
| 7 | + | which may result in a MatchError at runtime. |
| 8 | + | This patch can be rewritten automatically under -rewrite -source 3.8-migration. |
1 | 9 | -- Error: tests/neg/refutable-pattern-binding-messages-maybe.scala:7:14 ------------------------------------------------ |
2 | 10 | 7 | for Positive(i) <- List(1, 2, 3) do () // error: refutable extractor |
3 | 11 | | ^^^^^^^^^^^ |
|
6 | 14 | | If this usage is intentional, this can be communicated by adding the `case` keyword before the full pattern, |
7 | 15 | | which will result in a filtering for expression (using `withFilter`). |
8 | 16 | | This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
| 17 | +-- Error: tests/neg/refutable-pattern-binding-messages-maybe.scala:11:20 ----------------------------------------------- |
| 18 | +11 | val i :: is = List(1, 2, 3) // error: pattern type more specialized |
| 19 | + | ^^^^^^^^^^^^^ |
| 20 | + | pattern's type ::[Int] is more specialized than the right hand side expression's type List[Int] |
| 21 | + | |
| 22 | + | If the narrowing is intentional, this can be communicated by adding `.runtimeChecked` after the expression, |
| 23 | + | which may result in a MatchError at runtime. |
| 24 | + | This patch can be rewritten automatically under -rewrite -source 3.8-migration. |
9 | 25 | -- Error: tests/neg/refutable-pattern-binding-messages-maybe.scala:12:11 ----------------------------------------------- |
10 | 26 | 12 | for ((x: String) <- xs) do () // error: pattern type more specialized |
11 | 27 | | ^^^^^^ |
|
22 | 38 | | If the narrowing is intentional, this can be communicated by adding the `case` keyword before the full pattern, |
23 | 39 | | which will result in a filtering for expression (using `withFilter`). |
24 | 40 | | This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
25 | | --- Warning: tests/neg/refutable-pattern-binding-messages-maybe.scala:6:14 ---------------------------------------------- |
26 | | -6 | val Positive(p) = 5 // warn: refutable extractor |
27 | | - | ^^^^^^^^^^^^^^^ |
28 | | - | pattern binding uses refutable extractor `Test.Positive` |
29 | | - | |
30 | | - | If this usage is intentional, this can be communicated by adding `.runtimeChecked` after the expression, |
31 | | - | which may result in a MatchError at runtime. |
32 | | - | This patch can be rewritten automatically under -rewrite -source 3.8-migration. |
33 | | --- Warning: tests/neg/refutable-pattern-binding-messages-maybe.scala:11:20 --------------------------------------------- |
34 | | -11 | val i :: is = List(1, 2, 3) // warn: pattern type more specialized |
35 | | - | ^^^^^^^^^^^^^ |
36 | | - | pattern's type ::[Int] is more specialized than the right hand side expression's type List[Int] |
37 | | - | |
38 | | - | If the narrowing is intentional, this can be communicated by adding `.runtimeChecked` after the expression, |
39 | | - | which may result in a MatchError at runtime. |
40 | | - | This patch can be rewritten automatically under -rewrite -source 3.8-migration. |
41 | | --- Warning: tests/neg/refutable-pattern-binding-messages-maybe.scala:17:10 --------------------------------------------- |
42 | | -17 | val 1 = 2 // warn: pattern type does not match |
| 41 | +-- Error: tests/neg/refutable-pattern-binding-messages-maybe.scala:17:10 ----------------------------------------------- |
| 42 | +17 | val 1 = 2 // error: pattern type does not match |
43 | 43 | | ^ |
44 | 44 | | pattern's type (1 : Int) does not match the right hand side expression's type (2 : Int) |
45 | 45 | | |
|
0 commit comments