Backport #9299
Required keyowrd arguments and arity
Description
While fixing #8072, I noticed another bug: a required keyword argument should add 1 to the arity:
proc{|required:|}.arity # => 0, should be 1
Related issues
Associated revisions
- proc.c: Having any mandatory keyword argument increases min arity [#9299]
- proc.c: Having any mandatory keyword argument increases min arity [#9299]
- proc.c: Having any mandatory keyword argument increases min arity [#9299]
- proc.c: Having any mandatory keyword argument increases min arity [#9299]
- proc.c: Having any mandatory keyword argument increases min arity [#9299]
merge revision(s) 44433: [Backport #9299]
* proc.c: Having any mandatory keyword argument increases min arity [#9299]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 44433: [Backport #9299]
* proc.c: Having any mandatory keyword argument increases min arity [#9299]
merge revision(s) 44432: [Backport #9299]
* proc.c: Having optional keyword arguments makes maximum arity +1, not unlimited [#8072]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 44432: [Backport #9299]
* proc.c: Having optional keyword arguments makes maximum arity +1, not unlimited [#8072]
History
#1
Updated by marcandre (Marc-Andre Lafortune) over 4 years ago
- Tracker changed from Bug to Backport
- Project changed from Ruby trunk to Backport21
- Category deleted (
core) - Assignee changed from marcandre (Marc-Andre Lafortune) to naruse (Yui NARUSE)
#2
[ruby-core:60991]
Updated by naruse (Yui NARUSE) about 4 years ago
- Status changed from Open to Feedback
- Assignee changed from naruse (Yui NARUSE) to marcandre (Marc-Andre Lafortune)
Like #8072, this is not a simple backport.
Please get confirmation by matz
#3
[ruby-core:61131]
Updated by marcandre (Marc-Andre Lafortune) about 4 years ago
- Assignee changed from marcandre (Marc-Andre Lafortune) to matz (Yukihiro Matsumoto)
Please excuse my ignorance, I'm not sure what a simple backport is.
Dear Matz, hopefully you will know.
I always put my bug fixes as backport requests, but I welcome guidelines.
#4
[ruby-core:61133]
Updated by matz (Yukihiro Matsumoto) about 4 years ago
I consider this as a bug. So it should be back-ported to 2.1, I think.
Matz.
#5
[ruby-core:61166]
Updated by naruse (Yui NARUSE) about 4 years ago
- Status changed from Feedback to Closed
- % Done changed from 0 to 100
#6
[ruby-core:61167]
Updated by naruse (Yui NARUSE) about 4 years ago
Thank you for comments.
Marc-Andre Lafortune wrote:
Please excuse my ignorance, I'm not sure what a simple backport is.
Dear Matz, hopefully you will know.
I always put my bug fixes as backport requests, but I welcome guidelines.
yeah, I know you understand backport policy.
What I wanted to say is "I don't understand Proc#arity's keyword argument spec and can't judge whether spec change or bug fix".
(I accidentally backported #8072 related another backport, but the main issue is the spec of arity for keyword arguments)
Therefore could you describe the spec to Proc#arity's rdoc?
I want to backport it to Ruby 2.1.2.
Anyway I had written HowToRequestBackport.
The use of Backport custom field will help you.
https://bugs.ruby-lang.org/projects/ruby/wiki/HowToRequestBackport
#7
[ruby-core:61213]
Updated by marcandre (Marc-Andre Lafortune) about 4 years ago
- Status changed from Closed to Open
Naruse-san: You're right, the rdoc of Proc#arity was quite out of date. I've committed r45236-r45238 (04042ec6eb4..47d6a7ee1c8) to address this.
Matz: would you have time to review the rdoc of Proc#arity, especially the part about the different treatment of lambdas vs procs?
Thanks
#8
Updated by marcandre (Marc-Andre Lafortune) 5 months ago
- Status changed from Open to Closed
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e