Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/main/java/org/jruby/runtime/IRBlockBody.java
Original file line number Diff line number Diff line change
@@ -119,7 +119,12 @@ private IRubyObject[] toAry(ThreadContext context, IRubyObject value) {

protected IRubyObject doYieldLambda(ThreadContext context, IRubyObject value, Binding binding, Type type) {
// Lambda does not splat arrays even if a rest arg is present when it wants a single parameter filled.
IRubyObject[] args = signature.required() == 1 ? new IRubyObject[] { value } : toAry(context, value);
IRubyObject[] args;
if (signature.required() == 1 || signature.arityValue() == -1) {
args = new IRubyObject[] { value };
} else {
args = toAry(context, value);
}

signature.checkArity(context.runtime, args);

0 comments on commit f3dd725

Please sign in to comment.