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

Fix error in Hash#fetch documentation #4403

Merged
merged 1 commit into from
Apr 23, 2021

Conversation

romainsalles
Copy link
Contributor

@romainsalles romainsalles commented Apr 23, 2021

Documentation wrongly describes the behaviour of {}.fetch(:nosuch) which doesn't return nil but raises a KeyError exception, as explained a few lines after:

Raises KeyError if neither +default_value+ nor a block was given.

It doesn't return `nil` but raises an exception, as explained a few lines after
@marcandre marcandre merged commit 7de7d09 into ruby:master Apr 23, 2021
@marcandre
Copy link
Member

Indeed, thanks

@romainsalles romainsalles deleted the fix_hash_documentation branch April 23, 2021 16:52
@ioquatix
Copy link
Member

cc @BurdetteLamar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants