Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9147 from dwijnand/exhaust-tuple
Check all bindings exhaustively, e.g. tuples components
- Loading branch information
Showing
6 changed files
with
29 additions
and
10 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
t10019.scala:4: warning: match may not be exhaustive. | ||
It would fail on the following input: Foo(None) | ||
def single(t: Foo): Nothing = t match { | ||
^ | ||
t10019.scala:8: warning: match may not be exhaustive. | ||
It would fail on the following input: (Foo(None), _) | ||
def tuple(s: Foo, t: Foo): Nothing = (s, t) match { | ||
^ | ||
error: No warnings can be incurred under -Xfatal-warnings. | ||
two warnings found | ||
one error found |
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 @@ | ||
-Xfatal-warnings |
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,11 @@ | ||
object Bug { | ||
sealed case class Foo(e: Option[Int]) | ||
|
||
def single(t: Foo): Nothing = t match { | ||
case Foo(Some(_)) => ??? | ||
} | ||
|
||
def tuple(s: Foo, t: Foo): Nothing = (s, t) match { | ||
case (Foo(Some(_)), _) => ??? | ||
} | ||
} |
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