|
| 1 | +-- Error: tests/neg/refutable-pattern-binding-messages.scala:5:14 ------------------------------------------------------ |
| 2 | +5 | 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 `: @unchecked` after the expression, |
| 7 | + | which may result in a MatchError at runtime. |
| 8 | + | This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
1 | 9 | -- Error: tests/neg/refutable-pattern-binding-messages.scala:6:14 ------------------------------------------------------
|
2 | 10 | 6 | 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.scala:10:20 ----------------------------------------------------- |
| 18 | +10 | 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 `: @unchecked` after the expression, |
| 23 | + | which may result in a MatchError at runtime. |
| 24 | + | This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
9 | 25 | -- Error: tests/neg/refutable-pattern-binding-messages.scala:11:11 -----------------------------------------------------
|
10 | 26 | 11 | 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 |
| --- Error: tests/neg/refutable-pattern-binding-messages.scala:5:14 ------------------------------------------------------ |
26 |
| -5 | val Positive(p) = 5 // error: refutable extractor |
27 |
| - | ^^^^^^^^^^^^^^^ |
28 |
| - | pattern binding uses refutable extractor `Test.Positive` |
29 |
| - | |
30 |
| - | If this usage is intentional, this can be communicated by adding `: @unchecked` after the expression, |
31 |
| - | which may result in a MatchError at runtime. |
32 |
| - | This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
33 |
| --- Error: tests/neg/refutable-pattern-binding-messages.scala:10:20 ----------------------------------------------------- |
34 |
| -10 | val i :: is = List(1, 2, 3) // error: 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 `: @unchecked` after the expression, |
39 |
| - | which may result in a MatchError at runtime. |
40 |
| - | This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
41 | 41 | -- Error: tests/neg/refutable-pattern-binding-messages.scala:16:10 -----------------------------------------------------
|
42 | 42 | 16 | val 1 = 2 // error: pattern type does not match
|
43 | 43 | | ^
|
|
0 commit comments