mruby-proc-ext/proc.c (mrb_proc_parameters): skip empty block slot.
Unlike other formal arguments, a block argument has an empty slot even
when the block is not given.
MODIFY
mrbgems/mruby-proc-ext/src/proc.c
mrbgems/mruby-proc-ext/src/proc.c
@@ -176,6 +176,8 @@ mrb_proc_parameters(mrb_state *mrb, mrb_value self)
}
mrb_ary_push(mrb, parameters, a);
}
+ /* need to skip empty block slot */
+ if (p->size == 0 && p->name == MRB_SYM(block)) i++;
}
if (!mrb_nil_p(krest)) mrb_ary_push(mrb, parameters, krest);
if (!mrb_nil_p(block)) mrb_ary_push(mrb, parameters, block);

mruby-proc-ext/proc.c (mrb_proc_parameters): skip empty block slot.

Unlike other formal arguments, a block argument has an empty slot even
when the block is not given.