- Notifications
You must be signed in to change notification settings - Fork 5.5k
Enable ruby2_keywords semantics by default #2853
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
a1093aa to 0297139 Compare | @mame @jeremyevans This passes |
0297139 to c37f995 Compare | Of course with this change, calling It's not in this PR (yet) to keep it minimal and easy to review. I'm happy to add a commit doing that though. We might possibly also want a |
jeremyevans left a comment
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-wise, this looks like the best way to make this change, and should make backporting the feature easy. I'm still not in favor of the change, but if matz approves it, this is definitely the best way to implement it.
| Here is the same PR based on |
| And here we go, the proof that the entire Rails test suite is green with this change on top of 2.7.0! In fact, it's even more compatible with 2.6, and does not need And as we can see in https://github.com/rails/rails/blob/69a99e47c063f5d238e6d68f999f44f063aaf478/railties/test/generators/actions_test.rb#L576-L584 people are tempted to use |
| Also, this branch would allow a nice cleanup to remove 42 calls to ruby2_keywords(:use) if respond_to?(:ruby2_keywords, true) |
| Also worth noting that this PR based on ruby master seems more compatible than ruby master for Rails tests. I would guess because Results for ruby |
* See https://bugs.ruby-lang.org/issues/16463 * This preserves *args-delegation as it worked since Ruby 1.9. * It does not require to change delegation code until it can be changed in a way compatible with older versions (i.e., after Ruby 2 EOL). * This should make it significantly easier to make code compatible with Ruby 2.7, also avoiding confusing warnings in delegation code. * It will also provide precise warnings with instructions on how to migrate delegation in the future, once Ruby 2 is EOL. * The implementation simply sets the ruby2_keywords flag for all args nodes with a *rest argument and no keyword arguments.
c37f995 to 4a4a7ba Compare | I rebased this PR. With the recent changes by @jeremyevans to remove
|
| Matz said no to this, so I'll close this PR. Maybe it could become a disabled-by-default flag to help transition, on MRI or other Ruby implementations if there is interest. It seems like the general direction is to force migrating delegation by 3.0 and to have to use I feel sad that we have to use an explicit |

See https://bugs.ruby-lang.org/issues/16463
Slides: https://docs.google.com/presentation/d/1J6voqHFQ46-MsEm_vUJsBJiktNvoA6niz3fea9awmco/edit?usp=sharing