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

Let Regexp.new accept any options value #1059

Merged
merged 1 commit into from
Jul 6, 2022
Merged

Let Regexp.new accept any options value #1059

merged 1 commit into from
Jul 6, 2022

Conversation

soutaro
Copy link
Member

@soutaro soutaro commented Jul 5, 2022

Regexp.new accepts any value as options while the doc says it accepts Integer | nil | false. I found a code passing true and it cannot be rejected by a type checker, because the RDoc of Regexp.new shows it as an example.

This change will be reverted once Ruby 3.2 is out. The unexpected options value will be rejected by a runtime error on 3.2.

(See also #1040)

@soutaro soutaro merged commit 799ba25 into master Jul 6, 2022
@soutaro soutaro deleted the regexp-rbs branch July 6, 2022 00:52
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.

1 participant