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

Add a explicit exception message when a nil regex capture group is accessed. #4048

Merged
merged 1 commit into from Feb 20, 2017
Merged

Add a explicit exception message when a nil regex capture group is accessed. #4048

merged 1 commit into from Feb 20, 2017

Conversation

karlseguin
Copy link
Contributor

addresses: #3978

end

private def valid_group?(index)
index <= @size
end

private def raise_invalid_group_index(n)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small suggestion: following the index argument name from the callers, perhaps the method signature reads better as raise_invalid_group(index)?

@asterite asterite merged commit 367e9de into crystal-lang:master Feb 20, 2017
@asterite asterite added this to the 0.21.0 milestone Feb 20, 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.

None yet

3 participants