Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the List rewrite in patmat to use 2.13's UnapplySeqWrapper
I didn't double-check, but what I expect happened is that all the pattern matches that included a "case List()" stopped producing any exhaustivity/unreachable warnings. And then my guess is the impact wasn't understood and the checkfiles were just updated? In the next commit strict pattern matching becomes the default, which, when bootstrapping, found a pattern match in the compiler that uses "case List()" (with -Werror enabled).
- Loading branch information
Showing
5 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// scalac: -Werror -Xstrict-patmat-analysis | ||
// | ||
class C { | ||
def m(xs: List[String]) = xs match { | ||
case List() => "z" | ||
case y :: _ => y | ||
} | ||
// was: patmat_list_rewrite.scala:4: warning: match may not be exhaustive. | ||
// It would fail on the following input: Nil | ||
} |