Skip to content

Commit d482108

Browse files
authored
Add regression test for issue i18493 (#18497)
Closes #18493
2 parents 4c77f62 + b93763a commit d482108

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)