-
Notifications
You must be signed in to change notification settings - Fork 185
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
[Ruby 3.0 support] Kernel#lambda now warns if called without a literal block #2500
[Ruby 3.0 support] Kernel#lambda now warns if called without a literal block #2500
Conversation
Hello Andrew Konchin, thanks for contributing a PR to our project! We use the Oracle Contributor Agreement to make the copyright of contributions clear. We don't have a record of you having signed this yet, based on your email address andry -(dot)- konchin -(at)- gmail -(dot)- com. You can sign it at that link. If you think you've already signed it, please comment below and we'll check. |
I have signed the contributor agreement. Please check. The link to the contributor agreement in the comment above is broken. I used a link mentioned here: https://www.oracle.com/technical-resources/oracle-contributor-agreement.html |
Andrew Konchin has signed the Oracle Contributor Agreement (based on email address andry -(dot)- konchin -(at)- gmail -(dot)- com) so can contribute to this repository. |
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.
Thank you for the PR, it looks good.
Could you apply my suggestions?
Either is fine and both have pros & cons.
A spec in ruby/spec is the way to go.
Indeed there was a test added in ruby/ruby@2188d6d#diff-8b146f8f5073c5ee6526a128c3e9c05ae7a52d2cd496f601351470137f2a87a0 |
Cool, thank you. I will try to reflect it in the tests. |
Could you please suggest if there is any naming convention for commits? Also, should multiple working commits be squashed? |
No specific convention, just of the description of what the commit does. |
80c3287
to
33cb29f
Compare
Done. |
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.
Looks great, thank you!
33cb29f
to
113acb1
Compare
0f3cc21
to
356040b
Compare
356040b
to
78ae117
Compare
I pushed a couple fixes as CI was failing for MRI tests. |
Thank you 🙇 |
The PR fixes the following item:
Related issue - #2453
Changes
Kernel#lambda
Concerns
I am not sure whether this PR should contain changes to the RubySpec tests. Maybe it will be better to create a PR directly to RubySpec.
Also, I haven't found any place for unit tests for changes in the
KernelNodes
class.Regarding the new RubySpec test - I am confused a bit. While I was reading https://bugs.ruby-lang.org/issues/15973 I was under impression that any argument like
&...
should cause a warning. A commit mentioned in the ticket contains tests withlambda(&:symbol)
that triggers a warning. But actually on Ruby 3.0.0.p0lambda(&:symbol)
doesn't trigger a warning... Onlylambda(&proc)
...Please let me know if I need to change anything.