-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Extend match expressions to full patterns This commit brings together many previous chunks of work to finally make match expressions accept generic patterns, and not just enum tags. Pattern compilation was already implemented. Besides changing the parsing rule for "match" and change the implementation to compile the pattern and applies the result to the argument, the bulk of the work has been to correctly typecheck arbitrary structural patterns. Refer to the comments for the "Match" case in the typechecker for more details about the algorithm. * Fix failing test, reword code documentation * Fix undue unbound identifier when typechecking match * Add tests for full pattern matching * Fix null error in pattern compilation The compilation of record pattern was missing a null check which would trigger a dynamic type error when some matches aren't exhaustive. This commit fixes the issue by adding the missing null check. * Fix clippy warnings * Limited rewording of some code comments * Post-rebase fixup of snapshot tests * Apply suggestions from code review Co-authored-by: Viktor Kleen <[email protected]> --------- Co-authored-by: Viktor Kleen <[email protected]>
- Loading branch information
Showing
28 changed files
with
815 additions
and
337 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
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
Oops, something went wrong.