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

adds spec for Bug [#17030] #889

Merged
merged 1 commit into from
Oct 27, 2021
Merged

Conversation

moofkit
Copy link
Contributor

@moofkit moofkit commented Oct 27, 2021

Solving #823

Enumerable#grep and Enumerable#grep_v when passed a Regexp and no block no longer modify
Regexp.last_match

There are specs already for $& - an global alias to Regexp.last_match. Maybe it make sense to leave one of them but use Regexp.last_match explicitly because it seems more clear IMO.

Enumerable#grep and Enumerable#grep_v when passed a Regexp and no block no longer modify
Regexp.last_match
@moofkit moofkit changed the title adds spec for Bug [#17030](https://bugs.ruby-lang.org/issues/17030) adds spec for Bug [#17030] Oct 27, 2021
@eregon
Copy link
Member

eregon commented Oct 27, 2021

Regexp.last_match and $& are the same thing, and given $& existed before I'd see Regexp.last_match as the alias, but I guess it's subjective.

I'm not really against adding these extra specs, so I'll merge this, though I wouldn't do that in too many places because it just checks again that they are the same thing.

@eregon eregon merged commit 7376aa0 into ruby:master Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants