Skip to content

Commit

Permalink
Backport "Add regression test for issue i18493" to LTS (#20664)
Browse files Browse the repository at this point in the history
Backports #18497 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Jun 20, 2024
2 parents 0365d9f + c6ade8b commit 747a473
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 747a473

Please sign in to comment.