|
20 | 20 | | pattern expected
|
21 | 21 | |
|
22 | 22 | | longer explanation available when compiling with `-explain`
|
| 23 | +-- Error: tests/neg/t5702-neg-bad-and-wild.scala:16:16 ----------------------------------------------------------------- |
| 24 | +16 | case (1, x*) => // error: bad use of * |
| 25 | + | ^ |
| 26 | + | bad use of `*` - sequence pattern not allowed here |
23 | 27 | -- [E031] Syntax Error: tests/neg/t5702-neg-bad-and-wild.scala:17:18 ---------------------------------------------------
|
24 | 28 | 17 | case (1, x: _*) => // error: bad use of _* (sequence pattern not allowed)
|
25 | 29 | | ^
|
|
32 | 36 | | pattern expected
|
33 | 37 | |
|
34 | 38 | | longer explanation available when compiling with `-explain`
|
| 39 | +-- Error: tests/neg/t5702-neg-bad-and-wild.scala:25:14 ----------------------------------------------------------------- |
| 40 | +25 | val (b, _ * ) = (5,6) // error: bad use of `*` |
| 41 | + | ^ |
| 42 | + | bad use of `*` - sequence pattern not allowed here |
35 | 43 | -- [E161] Naming Error: tests/neg/t5702-neg-bad-and-wild.scala:24:10 ---------------------------------------------------
|
36 | 44 | 24 | val K(x) = k // error: x is already defined as value x
|
37 | 45 | | ^^^^^^^^^^^^
|
|
71 | 79 | | If the narrowing is intentional, this can be communicated by adding `: @unchecked` after the expression,
|
72 | 80 | | which may result in a MatchError at runtime.
|
73 | 81 | | This patch can be rewritten automatically under -rewrite -source 3.2-migration.
|
74 |
| --- Warning: tests/neg/t5702-neg-bad-and-wild.scala:25:20 --------------------------------------------------------------- |
75 |
| -25 | val (b, _ * ) = (5,6) // ok |
76 |
| - | ^^^^^ |
77 |
| - | pattern's type Int* does not match the right hand side expression's type Int |
78 |
| - | |
79 |
| - | If the narrowing is intentional, this can be communicated by adding `: @unchecked` after the expression, |
80 |
| - | which may result in a MatchError at runtime. |
81 |
| - | This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
0 commit comments