Project

General

Profile

Actions

Backport #9299

closed

Required keyowrd arguments and arity

Added by marcandre (Marc-Andre Lafortune) almost 11 years ago. Updated about 7 years ago.


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 1 (0 open1 closed)

Related to Backport21 - Backport #8072: Method#arity for keyword argumentsClosedmarcandre (Marc-Andre Lafortune)03/11/2013Actions
Actions #1

Updated by marcandre (Marc-Andre Lafortune) almost 11 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport21
  • Category deleted (core)
  • Assignee changed from marcandre (Marc-Andre Lafortune) to naruse (Yui NARUSE)

Updated by naruse (Yui NARUSE) almost 11 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

Updated by marcandre (Marc-Andre Lafortune) almost 11 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.

Updated by matz (Yukihiro Matsumoto) almost 11 years ago

I consider this as a bug. So it should be back-ported to 2.1, I think.

Matz.

Updated by naruse (Yui NARUSE) almost 11 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

Applied in changeset r45226.


merge revision(s) 44433: [Backport #9299]

* proc.c: Having any mandatory keyword argument increases min arity
  [#9299]

Updated by naruse (Yui NARUSE) almost 11 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

Updated by marcandre (Marc-Andre Lafortune) almost 11 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

Actions #8

Updated by marcandre (Marc-Andre Lafortune) about 7 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0