Repository navigation
Conversation
|
This pull request references the following Redmine tickets: |
This was referenced Sep 27, 2026
Closed
yuki-300
force-pushed
the
fix/alt-pattern-capture-check
branch
2 times, most recently
from
September 28, 2026 17:25
c128929 to
ec84b61
Compare
…patterns `capture_in_pattern` is set by any binding in the whole `in` clause, so `in [ x, :a | :b ]` was rejected while `in [ :a | :b, x ]` was accepted. Keep the flag as a pre-check and walk the left operand for an actual binding before raising, like Prism does. Save and restore `in_alt_pattern` around the right operand so that a nested alternation does not clear it.
yuki-300
force-pushed
the
fix/alt-pattern-capture-check
branch
from
September 28, 2026 18:20
ec84b61 to
db30a13
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Bug #22310]
capture_in_patternis set by any binding in the wholeinclause, so parse.y rejectedin [ x, :a | :b ]while acceptingin [ :a | :b, x ]. Keep the flag as a pre-check and walk the left operand for an actual binding, like Prism does.in_alt_patternis now saved and restored around the right operand so a nested alternation does not clear it.Regression from 4.0 (#15329), so this should be a backport candidate for 4.0.