Preserve pattern, use tuple type when optimizing#25566
Merged
Merged
Conversation
som-snytt
force-pushed
the
issue/25547-flattened-tuple
branch
from
March 19, 2026 03:19
1c1ed7b to
00e2ab5
Compare
som-snytt
force-pushed
the
issue/25547-flattened-tuple
branch
from
March 19, 2026 14:22
00e2ab5 to
e4f8ca7
Compare
som-snytt
marked this pull request as ready for review
March 19, 2026 21:14
SolalPirelli
approved these changes
Mar 20, 2026
SolalPirelli
left a comment
Contributor
There was a problem hiding this comment.
Thanks. I'm not really sure why the wildcard stuff was there in the first place.
SolalPirelli
pushed a commit
that referenced
this pull request
Apr 5, 2026
Fixes #25700 ## How much have you relied on LLM-based tools in this contribution? But can one _rely_ on LLM-based tools? ## How was the solution tested? Apparently, there was not a test for val def with stable identifier pattern. The ticket minimization supplies it. Edit: a previous test was erroring incorrectly but flew under the radar. Its correct error is restored. ## Additional notes Follow-up to #25566 that tweaked #24972. Obviously, a pattern variable must be `isVarPattern`, but the degrees of freedom are lowercase, underscore, and backquoted. The code comment, that "royal we" want wildcards, suggests our bases are not covered. `IdPattern` is for parsing and would not be useful here. But how do I ask whether I'm looking at a patvar? There is an attachment. Are we too early or late for it? "One does not simply ask if an identifier is a pattern variable."
WojciechMazur
pushed a commit
that referenced
this pull request
Apr 18, 2026
Fixes #25700 ## How much have you relied on LLM-based tools in this contribution? But can one _rely_ on LLM-based tools? ## How was the solution tested? Apparently, there was not a test for val def with stable identifier pattern. The ticket minimization supplies it. Edit: a previous test was erroring incorrectly but flew under the radar. Its correct error is restored. ## Additional notes Follow-up to #25566 that tweaked #24972. Obviously, a pattern variable must be `isVarPattern`, but the degrees of freedom are lowercase, underscore, and backquoted. The code comment, that "royal we" want wildcards, suggests our bases are not covered. `IdPattern` is for parsing and would not be useful here. But how do I ask whether I'm looking at a patvar? There is an attachment. Are we too early or late for it? "One does not simply ask if an identifier is a pattern variable." [Cherry-picked 2c668b5]
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.
Fixes #25547
Supply the tuple type for the temp val only if optimizing.
Always use the pattern for the
MatchableTupleoptimization, for the correct tuple type.