-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not consider uninhabited constructors when performing exhaustive m…
…atch checking
- Loading branch information
Showing
2 changed files
with
23 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//> using options -Xfatal-warnings -deprecation -feature | ||
|
||
enum TestAdt: | ||
case Inhabited | ||
case Uninhabited(no: Nothing) | ||
|
||
def test1(t: TestAdt): Int = t match | ||
case TestAdt.Inhabited => 1 | ||
|
||
def test2(o: Option[Option[Nothing]]): Int = o match | ||
case Some(None) => 1 | ||
case None => 2 |