-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
TypeError: bind argument must be an instance of ... #5131
Comments
Thanks for the test case! Looking into it for a few minutes this evening... |
Oddly enough, the following change appears to fix the problem. It seems to match similar logic in MRI that accesses I'll push the change and hopefully you can confirm it's working for you tonight. If we can narrow this down to a piece of code that does not depend on minitest, it would be great to add a spec to https://github.com/ruby/spec! |
Heya, @headius! I spent a little time this evening and I think I was able to boil down the test case a bit. The initial test case for some reason doesn't fail until the second time the PrependedModule = Class.new(Module)
class Stubber; def foo; 'bar'; end; end
original_define = Stubber.instance_method(:foo)
original_define.bind(Stubber.new).call # this call works fine
Stubber.__send__(:prepend, PrependedModule.new)
original_define = Stubber.instance_method(:foo)
original_define.bind(Stubber.new).call # this call fails output
EDIT: I'm running under intellij and for some reason I get the above error in my output console when executing under the integrated debugger. If I run via intellij without the integrated debugger I receive the following output:
Top 2 frames are the same for both failure runs for me (debugger and no debugger, but running through the IDE). That said, It is unclear to me that when running the above code example via command line I receive no output. I would expect the same exception in all cases. |
Environment
failure test case:
Expected Behavior
No errors.
Actual Behavior
Behavior from various versions of jruby and MRI ruby
possibly related to #2519
The text was updated successfully, but these errors were encountered: