alias_method not preserving UnboundMethod#parameters #839

ericmeyer opened this Issue Jul 1, 2013 · 3 comments


None yet

2 participants


There seems to be a bug with alias_method. Aliasing a method does not preserve the return value of UnboundMethod#parameters.

Here is an example:

jruby-1.7.3 :001 > class Foo
jruby-1.7.3 :002?>     def abc_one(some_arg)
jruby-1.7.3 :003?>       end
jruby-1.7.3 :004?>     alias_method :abc_two, :abc_one
jruby-1.7.3 :005?>   end
 => Foo
jruby-1.7.3 :006 > Foo.instance_method(:abc_two).parameters
 => []
jruby-1.7.3 :007 > Foo.instance_method(:abc_one).parameters
 => [[:req, :some_arg]]

I would expect the return value of Foo.instance_method(:abc_two).parameters to be the [[:req, :some_arg]].

This bug exists in 1.6.8, 1.7.3 and 1.7.4.

@headius headius closed this in c84ea48 Jul 1, 2013
headius commented Jul 1, 2013

Could you submit either a spec (to rubyspec/rubyspec) or a test (to MRI or our copy of MRI's tests under test/externals) for this behavior? Thanks!


This what you were looking for?

headius commented Jul 24, 2013

Looks good to me...thanks!

On Fri, Jul 12, 2013 at 2:50 PM, ericmeyer wrote:

This what you were looking for?


Reply to this email directly or view it on GitHub

@alindeman alindeman added a commit to rspec/rspec-mocks that referenced this issue Oct 21, 2013
@alindeman alindeman Works around jruby/jruby#839 8f3bcf9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment