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

[BUGFIX beta] Enumerable#any bug - not always returning a boolean #13363

Closed
wants to merge 2 commits into from

Conversation

bryanaka
Copy link

closes #12533

Enumerable#any is supposed to return only a boolean, but is currently returning whatever truthy value is returned in the callback. This changed functionality is now aligned with Array#some.

Potentially a breaking change if someone was relying on the buggy functionality. It was introduced here - #4144

@bryanaka bryanaka changed the title Enumerable any bug Enumerable#any bug - not always returning a boolean Apr 18, 2016
@bryanaka bryanaka changed the title Enumerable#any bug - not always returning a boolean [BUGFIX beta] Enumerable#any bug - not always returning a boolean Apr 18, 2016
@bryanaka
Copy link
Author

hate to be a bother, but was wondering if this PR is valid or not?

I know it has some possibly far-reaching consequences (people relying on the buggy behavior), and the fact that it may be removed with iterators and more of the newer Array functions like Array#some being so well supported.

I'm cc'ing original commenters on the #12533 @pixelhandler @Serabe

@homu
Copy link
Contributor

homu commented Jun 15, 2016

☔ The latest upstream changes (presumably #13658) made this pull request unmergeable. Please resolve the merge conflicts.

@locks
Copy link
Contributor

locks commented Sep 25, 2017

Thank you for this effort and sorry for having let it sit for so long 🙇.

I have to side with your argument about the possible breaking changes this bugfix will introduce.
Regardless of documentation or intent, the current behaviour of any is the defacto one, being in effect for nearly four years.
What I believe we have to do in this case is to address the documentation of any to mention this quick and move from any to some. There is already an RFC that intends to do this. Let's figure out the path forward there :)

@locks locks closed this Sep 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enumerable#any vs Array#some
3 participants