Skip to content

Commit

Permalink
Add regression test for issue i18493 (#18497)
Browse files Browse the repository at this point in the history
Closes #18493
  • Loading branch information
bishabosha authored Sep 1, 2023
2 parents 4c77f62 + b93763a commit d482108
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 d482108

Please sign in to comment.