Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fill in a bunch of corners of if-case and patterns. #1382

Merged
merged 1 commit into from
Feb 13, 2024
Merged

Conversation

munificent
Copy link
Member

  • Format if-case elements in collection literals.
  • Format when clauses in if-case.
  • Format wildcard patterns (which are basically the same as variables).
  • Format constant patterns with a leading const.
  • Migrated over a bunch of other patterns tests that can be run now.

To handle if-case and when clauses, I ended up creating a new IfCasePiece since it because different enough from AssignPiece to not make sense to share code any more.

This doesn't add support for guard clauses in switch cases yet. I'll do that separately.

- Format if-case elements in collection literals.
- Format `when` clauses in if-case.
- Format wildcard patterns (which are basically the same as variables).
- Format constant patterns with a leading `const`.
- Migrated over a bunch of other patterns tests that can be run now.

To handle if-case and when clauses, I ended up creating a new
IfCasePiece since it because different enough from AssignPiece to not
make sense to share code any more.

This doesn't add support for guard clauses in switch cases yet. I'll do
that separately.
Copy link
Member

@kallentu kallentu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very appreciated, thank you.

@munificent munificent merged commit 8040e06 into main Feb 13, 2024
7 checks passed
@munificent munificent deleted the more-if-case branch February 13, 2024 22:05
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.

3 participants