Skip to content

Allow tuple destructuring in matches#649

Open
kengorab wants to merge 7 commits into
masterfrom
match-tuple
Open

Allow tuple destructuring in matches#649
kengorab wants to merge 7 commits into
masterfrom
match-tuple

Conversation

@kengorab

Copy link
Copy Markdown
Owner

This introduces a new syntax for matching on tuple values, using nested tuple destructuring. For now, this just accounts for the parsing changes in addition to a sizeable refactoring/cleanup in the typechecker (which does not yet support tuple match cases).

This introduces a new syntax for matching on tuple values, using nested
tuple destructuring. For now, this just accounts for the parsing changes
in addition to a sizeable refactoring/cleanup in the typechecker (which
does not yet support tuple match cases).
This took a LONG time to get right, and it resulted in multiple
iterations of trying out various strategies. In the end, I refactored
the way match-cases are typechecked across the board in order to support
this, as well as future use cases that will be coming (soon, probably).
Add a specific MatchCasePossibility to represent unbounded cases, for
example integers, floats, strings, structs, etc. Technically a struct
which consists solely of bounded cases (recursively) is itself bounded,
but we don't have support for nested match patterns in this way (yet).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant