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

When a pattern variable is defined on only one side of a disjunction, #100

Merged
merged 2 commits into from
Dec 19, 2023

Conversation

gafter
Copy link
Member

@gafter gafter commented Dec 15, 2023

When a pattern variable is defined on only one side of a disjunction,
it is now an error to use it again later in the pattern, or in a value expression. The reason is that the semantics are too confusing. If you get this error, just rename the pattern variable to avoid the conflict, or use a wildcard instead.

This is technically a breaking change, but I'm guessing that it will occur only rarely in practice. Therefore I am only bumping the minor version number.

Fixes #99

it is now an error to use it again later in the pattern,
or in a value expression. The reason is that the semantics
are too confusing. If you get this error, just rename the
pattern variable to avoid the conflict, or use a wildcard
instead.

This is technically a breaking change, but I'm guessing
that it will occur only rarely in practice. Therefore I
am only bumping the minor version number.

Fixes #99
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4988ecc) 100.00% compared to head (5c33a4c) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #100   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines         1036      1049   +13     
=========================================
+ Hits          1036      1049   +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gafter
Copy link
Member Author

gafter commented Dec 16, 2023

@mcmcgrath13 @quinnj @NHDaly I would love to have an opinion (and review) from any of you about this PR.

Copy link
Collaborator

@mcmcgrath13 mcmcgrath13 left a comment

Choose a reason for hiding this comment

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

This restriction makes a lot of sense to me - thanks!

@gafter gafter merged commit 4cbd3fd into main Dec 19, 2023
9 checks passed
@gafter gafter deleted the partial1 branch December 19, 2023 22:26
@KristofferC
Copy link

Could this new release be, well, released? It fixes some test errors on 1.11.

@gafter
Copy link
Member Author

gafter commented Mar 28, 2024

Could this new release be, well, released? It fixes some test errors on 1.11.

Yes, I'll work on that tomorrow. Thanks for reminding me.

@gafter
Copy link
Member Author

gafter commented Jul 18, 2024

@mcmcgrath13 You created a branch that reverts this change. What do you plan to do with it?

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.

Unexpected match with disjunction
3 participants