-
-
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
Some object from each_object can't be "p"ed #4462
Comments
I do not think this is a bug. What is croaking is p calling inspect:
Since p calls inspect it is pretty easy to make MRI fail this as well: p = BasicObject.new
class << p
def inspect(a, b)
"HEH"
end
end
p p
ObjectSpace.each_object {|x| p x } I did figure what is causing this for us and it is 'JRuby.ref' returning our implementations of classes like RubyNil which not surprisingly does have two JI accessiable inspect()s which are our implementations of inspect. Had this been some JI type I thought maybe we could fix that case but in this case I do not think we want to start masking instances on refs. We could fix all of these by providing no-arg inspect() methods but it feels weird to me. |
While fixing #4461, I found that there's some object returned by
ObjectSpace.each_object
that produces an argument arity error when passed top
:Obviously,
p
is never called with zero args...and even if it were, that's a valid call. So this is pretty weird.The text was updated successfully, but these errors were encountered: