Skip to content

Commit

Permalink
Add regression test for issue 18493
Browse files Browse the repository at this point in the history
[Cherry-picked b93763a]
  • Loading branch information
jchyb authored and WojciechMazur committed Jun 20, 2024
1 parent 3dbb053 commit c6ade8b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/neg/18493.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- [E030] Match case Unreachable Error: tests/neg/18493.scala:6:9 ------------------------------------------------------
6 | case "abc" => // error
| ^^^^^
| Unreachable case
-- [E030] Match case Unreachable Error: tests/neg/18493.scala:12:9 -----------------------------------------------------
12 | case "abc" => // error
| ^^^^^
| Unreachable case
14 changes: 14 additions & 0 deletions tests/neg/18493.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//> using options -Werror
object PartialFunctionNoWarning {
// nice warning
"abc" match {
case "abc" =>
case "abc" => // error
}

// no warnings
val pf: PartialFunction[String, Unit] = {
case "abc" =>
case "abc" => // error
}
}

0 comments on commit c6ade8b

Please sign in to comment.