Skip to content

Commit d7ec913

Browse files
committed
Fix test
1 parent 1faade5 commit d7ec913

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tests/neg/t5702-neg-bad-and-wild.check

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
| pattern expected
2121
|
2222
| 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
2327
-- [E031] Syntax Error: tests/neg/t5702-neg-bad-and-wild.scala:17:18 ---------------------------------------------------
2428
17 | case (1, x: _*) => // error: bad use of _* (sequence pattern not allowed)
2529
| ^
@@ -32,6 +36,10 @@
3236
| pattern expected
3337
|
3438
| 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
3543
-- [E161] Naming Error: tests/neg/t5702-neg-bad-and-wild.scala:24:10 ---------------------------------------------------
3644
24 | val K(x) = k // error: x is already defined as value x
3745
| ^^^^^^^^^^^^
@@ -71,11 +79,3 @@
7179
| If the narrowing is intentional, this can be communicated by adding `: @unchecked` after the expression,
7280
| which may result in a MatchError at runtime.
7381
| 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.

tests/neg/t5702-neg-bad-and-wild.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ object Test {
1313
case List(1, _*3:) => // error // error
1414
case List(1, x*) => // ok
1515
case List(x*, 1) => // error: pattern expected
16-
case (1, x*) => //ok
16+
case (1, x*) => // error: bad use of *
1717
case (1, x: _*) => // error: bad use of _* (sequence pattern not allowed)
1818
}
1919

@@ -22,7 +22,7 @@ object Test {
2222
val K(x @ _*) = k
2323
val K(ns @ _*, xx) = k // error: pattern expected // error
2424
val K(x) = k // error: x is already defined as value x
25-
val (b, _ * ) = (5,6) // ok
25+
val (b, _ * ) = (5,6) // error: bad use of `*`
2626
// no longer complains
2727
//bad-and-wild.scala:15: error: ')' expected but '}' found.
2828
}

0 commit comments

Comments
 (0)