-
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.
Merge pull request #13962 from dwijnand/pattern-typer/arity
Tighten product match logic in irrefutable check
- Loading branch information
Showing
5 changed files
with
28 additions
and
11 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 @@ | ||
14: Pattern Match Exhaustivity: _: Success |
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,15 @@ | ||
sealed trait Result | ||
|
||
case class Success(result: String, next: Int) extends Result { | ||
def isEmpty: Boolean = 10 % 2 == 1 | ||
def get: String = result | ||
} | ||
|
||
object Success { | ||
def unapply(x: Success): Success = x | ||
} | ||
|
||
def main = | ||
val res: Result = ??? | ||
res match // error | ||
case Success(v) => v |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
22: Pattern Match Exhaustivity: _: A, _: B, C(_, _) | ||
65: Pattern Match Exhaustivity: ExM(_, _) | ||
65: Pattern Match Exhaustivity: _: M |