You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discovered this while trying to make awesome_print gem work with rbx-head:
$ irb -f
irb> m = [].method(:length)
=> #<Method: Array#length (defined in Array)>
irb> m.parameters
NoMethodError: undefined method `local_names' on an instance of Rubinius::AccessVariable.
from Kernel(Rubinius::AccessVariable)#local_names (method_missing) at kernel/delta/kernel.rb:79
from Method#parameters at kernel/common/method.rb:119
It seems that the following fixes the issue (added line 119 in kernel/common/method.rb):
118: def parameters
119: return [] if Rubinius::AccessVariable === @executable
120: @executable.local_names.each_with_index.map do |name, i|
However here's more complicated case that involves Rubinius::NativeMethod:
$ irb -f
irb> require "bigdecimal"
=> true
irb> Class Hi
irb> end
=> nil
irb> m = Hi.method(:BigDecimal)
=> #<Method: Class#BigDecimal (defined in Kernel at vm/capi/module.cpp:0)>
irb> m.parameters
NoMethodError: undefined method `local_names' on an instance of Rubinius::NativeMethod.
from Kernel(Rubinius::NativeMethod)#local_names (method_missing) at kernel/delta/kernel.rb:79
from Method#parameters at kernel/common/method.rb:119
In theory BigDecimal should show its parameters just like any other method, so returning [] doesn't seem right in this case.
I think the same issue might affect UnboundMethod#parameters. Let me know if you'd like me to dig deeper ;-)
Michael
The text was updated successfully, but these errors were encountered:
Hi there,
Discovered this while trying to make awesome_print gem work with rbx-head:
It seems that the following fixes the issue (added line 119 in kernel/common/method.rb):
However here's more complicated case that involves Rubinius::NativeMethod:
In theory BigDecimal should show its parameters just like any other method, so returning [] doesn't seem right in this case.
I think the same issue might affect UnboundMethod#parameters. Let me know if you'd like me to dig deeper ;-)
Michael
The text was updated successfully, but these errors were encountered: