Skip to content

Let Regexp.new accept any options value - #1059

Merged
soutaro merged 1 commit into
masterfrom
regexp-rbs
Jul 6, 2022
Merged

soutaro merged 1 commit into
masterfrom
regexp-rbs

Conversation

@soutaro

@soutaro soutaro commented Jul 5, 2022

Copy link
Copy Markdown
Member

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant