Project

General

Profile

Actions

Bug #7540

closed

Proc#parameters cannot show :opt with :rest and :keyword

Added by no6v (Nobuhiro IMAI) over 11 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.0.0dev (2012-12-10 trunk 38297) [x86_64-linux]
Backport:
[ruby-core:50735]

Description

When an :opt arg is specified with :rest and :key args,
Proc#parameters (as well as *Method) cannot show it as below:

->(opt = :ion, *rest, key: :word){}.parameters # => [[:rest, :rest], [:key, :key]]

Updated by Eregon (Benoit Daloze) over 11 years ago

I've started to take a look at this, and I wish to solve it if I find the way.
But of course if I'm taking too much time or somebody solves it before it's fine,
although I would prefer collaborating with them (I suppose mame, as he did r34137).

Updated by Eregon (Benoit Daloze) over 11 years ago

  • Assignee set to Eregon (Benoit Daloze)

Found the fix, just taking time to update related documentation.

no6v: nice catch!

Actions #3

Updated by Eregon (Benoit Daloze) over 11 years ago

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

This issue was solved with changeset r38333.
Nobuhiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • iseq.c (rb_iseq_parameters): fix limit for optional arguments.
  • test/ruby/test_keyword.rb: tests for above.
  • vm_core.h (struct rb_iseq_struct): update documentation
    with keyword arguments. [Bug #7540] [ruby-core:50735]

Updated by no6v (Nobuhiro IMAI) over 11 years ago

Cool! We are lucky to find this, and then fixed. Thanks :).

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0