Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proc from Method breaks encoded parameter list #2920

Closed
nirvdrum opened this Issue May 8, 2015 · 1 comment

Comments

Projects
None yet
3 participants
@nirvdrum
Copy link
Contributor

nirvdrum commented May 8, 2015

JRuby 9k's Method#to_proc seems to break the encoded parameter list.

MRI:

> ruby -v -e 'def m(x, y = 7, hey:, yo: "blah"); end; p method(:m).parameters; p method(:m).to_proc.parameters'
[[:req, :x], [:opt, :y], [:keyreq, :hey], [:key, :yo]]
[[:req, :x], [:opt, :y], [:keyreq, :hey], [:key, :yo]]

JRuby 9k:

> bin/jruby -v -e 'def m(x, y = 7, hey:, yo: "blah"); end; p method(:m).parameters; p method(:m).to_proc.parameters'
jruby 9.0.0.0-SNAPSHOT (2.2.2) 2015-05-08 3462a65 Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [linux-amd64]
[[:req, :x], [:opt, :y], [:keyreq, :hey], [:key, :yo]]
[[:rest, :eqx], [:opt, :pty], [:key, :eyreqhey], [:key, :eyyo]]
@headius

This comment has been minimized.

Copy link
Member

headius commented May 8, 2015

At some point (on 1.7 branch too) we stopped using MethodBlock to wrap the RubyMethod instance, so the parameter logic is going through BlockBody.getParameterList. However, getParameterList's format is different from the getArgDesc used by IR, so it messes it all up.

@headius headius closed this in d2ea69e May 8, 2015

headius added a commit that referenced this issue May 8, 2015

@enebo enebo added this to the JRuby 9.0.0.0.rc1 milestone Jun 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.