Skip to content

Commit

Permalink
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion core/src/main/java/org/jruby/RubyProc.java
Original file line number Diff line number Diff line change
@@ -325,7 +325,12 @@ public IRubyObject call(ThreadContext context, IRubyObject[] args, IRubyObject s

@JRubyMethod(name = "arity")
public RubyFixnum arity() {
return getRuntime().newFixnum(block.getSignature().arityValue());
Signature signature = block.getSignature();

if (block.type == Block.Type.LAMBDA) return getRuntime().newFixnum(signature.arityValue());

// FIXME: Consider min/max like MRI here instead of required + kwarg count.
return getRuntime().newFixnum(signature.hasRest() ? signature.arityValue() : signature.required() + signature.getRequiredKeywordForArityCount());
}

@JRubyMethod(name = "to_proc")
1 change: 0 additions & 1 deletion test/mri/excludes/TestProc.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
exclude :test_arity, "needs investigation"
exclude :test_arity2, "needs investigation"
exclude :test_attr_source_location, "needs investigation"
exclude :test_bound_parameters, "needs investigation"

0 comments on commit 7501519

Please sign in to comment.