-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Two fixes to NamedTuple pattern matching #22953
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
Conversation
odersky
commented
Apr 9, 2025
- Fix translation for named patterns where the selector is a single-element named tuple. We used to take the whole tuple as result (which is correct for unnamed patterns) but for named patterns we have to select the field instead.
- Take account of named patterns in the refutability check.
1. Fix translation for named patterns where the selector is a single-element named tuple. We used to take the whole tuple as result (which is correct for unnamed patterns) but for named patterns we have to select the field instead. 2. Take account of named patterns in the refutability check.
Fixes #22900 |
It would be nice if we could ship this in 3.7.0 RC3, since
But only if it does not hold up the release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation looks good.
It seems the tests were intended to have check files (they println
things rather than assert
), but there are no checkfiles.
Now also fixes #22899 |
Backports #22953 to the 3.7.0-RC2. PR submitted by the release tooling.