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

Object.constants includes :fatal #2452

Closed
eregon opened this issue Oct 1, 2021 · 1 comment
Closed

Object.constants includes :fatal #2452

eregon opened this issue Oct 1, 2021 · 1 comment
Assignees
Milestone

Comments

@eregon
Copy link
Member

eregon commented Oct 1, 2021

Found by @fniephaus

And so Object.constants.collect { |x| Object.const_get x } fails with wrong constant name fatal.

We should filter out constants with a lowercase name for Module#constants.

Avoiding attaching fatal as a constant of Object doesn't seem a proper fix because I think it can be queried from C exts, and on CRuby (on TruffleRuby too) there are also namespaced lowercase constants:

$ ruby -rstringio -e 'p StringIO.ancestors'
[StringIO, IO::generic_writable, IO::generic_readable, Enumerable, Data, Object, Kernel, BasicObject]

@bjfish Could you fix it?

@bjfish
Copy link
Contributor

bjfish commented Oct 8, 2021

This is fixed at: 336721f

@bjfish bjfish closed this as completed Oct 8, 2021
@bjfish bjfish added this to the 22.0.0 milestone Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants