mruby-proc-ext/proc.c (mrb_proc_parameters): disclose unnamed arguments.
Unnamed arguments (*, **, &) should be disclosed in the parameter list.
The test is also updated.
MODIFY
mrbgems/mruby-proc-ext/src/proc.c
mrbgems/mruby-proc-ext/src/proc.c
@@ -154,15 +154,7 @@ mrb_proc_parameters(mrb_state *mrb, mrb_value self)
a = mrb_ary_new(mrb);
mrb_ary_push(mrb, a, sname);
if (i < max && irep->lv[i]) {
- mrb_sym sym = irep->lv[i];
- const char *name = mrb_sym_name(mrb, sym);
- switch (name[0]) {
- case '*': case '&':
- break;
- default:
- mrb_ary_push(mrb, a, mrb_symbol_value(sym));
- break;
- }
+ mrb_ary_push(mrb, a, mrb_symbol_value(irep->lv[i]));
}
if (p->name == MRB_SYM(block)) {
block = a; continue;

MODIFY
mrbgems/mruby-proc-ext/test/proc.rb
mrbgems/mruby-proc-ext/test/proc.rb
@@ -78,7 +78,7 @@ assert('Proc#parameters') do
assert_equal([[:req, :a]], lambda {|a|}.parameters)
assert_equal([[:opt, :a]], lambda {|a=nil|}.parameters)
assert_equal([[:req, :a]], ->(a){}.parameters)
- assert_equal([[:rest]], lambda { |*| }.parameters)
+ assert_equal([[:rest, :*]], lambda { |*| }.parameters)
assert_equal([[:rest, :a]], Proc.new {|*a|}.parameters)
assert_equal([[:opt, :a], [:opt, :b], [:opt, :c], [:opt, :d], [:rest, :e], [:opt, :f], [:opt, :g], [:block, :h]], Proc.new {|a,b,c=:c,d=:d,*e,f,g,&h|}.parameters)
assert_equal([[:req, :a], [:req, :b], [:opt, :c], [:opt, :d], [:rest, :e], [:req, :f], [:req, :g], [:block, :h]], lambda {|a,b,c=:c,d=:d,*e,f,g,&h|}.parameters)

mruby-proc-ext/proc.c (mrb_proc_parameters): disclose unnamed arguments.

Unnamed arguments (*, **, &) should be disclosed in the parameter list.
The test is also updated.