Skip to content

Commit eab952f

Browse files
jchybWojciechMazur
authored andcommitted
Add regression test for issue 18493
[Cherry-picked b93763a]
1 parent b7e118c commit eab952f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/neg/18493.check

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- [E030] Match case Unreachable Error: tests/neg/18493.scala:6:9 ------------------------------------------------------
2+
6 | case "abc" => // error
3+
| ^^^^^
4+
| Unreachable case
5+
-- [E030] Match case Unreachable Error: tests/neg/18493.scala:12:9 -----------------------------------------------------
6+
12 | case "abc" => // error
7+
| ^^^^^
8+
| Unreachable case

tests/neg/18493.scala

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//> using options -Werror
2+
object PartialFunctionNoWarning {
3+
// nice warning
4+
"abc" match {
5+
case "abc" =>
6+
case "abc" => // error
7+
}
8+
9+
// no warnings
10+
val pf: PartialFunction[String, Unit] = {
11+
case "abc" =>
12+
case "abc" => // error
13+
}
14+
}

0 commit comments

Comments
 (0)