|
| 1 | +-- Error: tests/neg/refutable-pattern-binding-messages-old.scala:6:14 -------------------------------------------------- |
| 2 | +6 | for Positive(i) <- List(1, 2, 3) do () // 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 the `case` keyword before the full pattern, |
| 7 | + | which will result in a filtering for expression (using `withFilter`). |
| 8 | + | This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
| 9 | +-- Error: tests/neg/refutable-pattern-binding-messages-old.scala:11:11 ------------------------------------------------- |
| 10 | +11 | for ((x: String) <- xs) do () // error: pattern type more specialized |
| 11 | + | ^^^^^^ |
| 12 | + | pattern's type String is more specialized than the right hand side expression's type AnyRef |
| 13 | + | |
| 14 | + | If the narrowing is intentional, this can be communicated by adding the `case` keyword before the full pattern, |
| 15 | + | which will result in a filtering for expression (using `withFilter`). |
| 16 | + | This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
| 17 | +-- Error: tests/neg/refutable-pattern-binding-messages-old.scala:15:13 ------------------------------------------------- |
| 18 | +15 | for none @ None <- ys do () // error: pattern type does not match |
| 19 | + | ^^^^ |
| 20 | + | pattern's type None.type does not match the right hand side expression's type (x$1 : Option[?]) |
| 21 | + | |
| 22 | + | If the narrowing is intentional, this can be communicated by adding the `case` keyword before the full pattern, |
| 23 | + | which will result in a filtering for expression (using `withFilter`). |
| 24 | + | This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
| 25 | +-- Warning: tests/neg/refutable-pattern-binding-messages-old.scala:5:14 ------------------------------------------------ |
| 26 | +5 | 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 `: @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 | +-- Warning: tests/neg/refutable-pattern-binding-messages-old.scala:10:20 ----------------------------------------------- |
| 34 | +10 | 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 `: @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 | +-- Warning: tests/neg/refutable-pattern-binding-messages-old.scala:16:10 ----------------------------------------------- |
| 42 | +16 | val 1 = 2 // warn: pattern type does not match |
| 43 | + | ^ |
| 44 | + | pattern's type (1 : Int) does not match the right hand side expression's type (2 : Int) |
| 45 | + | |
| 46 | + | If the narrowing is intentional, this can be communicated by adding `: @unchecked` after the expression, |
| 47 | + | which may result in a MatchError at runtime. |
| 48 | + | This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
0 commit comments