Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/regexp.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ class Regexp
#
# Regexp.compile is an alias for Regexp.new.
#
def initialize: (String string, ?Integer | nil | false | top options, ?String kcode) -> Object
def initialize: (String string, ?String | Integer | nil | false options) -> Object
| (Regexp regexp) -> void

# <!--
Expand Down
8 changes: 4 additions & 4 deletions test/stdlib/Regexp_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ class RegexpTest < StdlibTest
def test_new
Regexp.new('dog')
Regexp.new('dog', option = Regexp::IGNORECASE)
Regexp.new('dog', option = nil, code = 'n')
Regexp.new('dog', option = Regexp::IGNORECASE, code = 'n')
Regexp.new('dog', option = nil)
Regexp.new('dog', option = Regexp::IGNORECASE)
Regexp.new(/^a-z+:\\s+\w+/)
end

def test_compile
Regexp.compile('dog')
Regexp.compile('dog', option = Regexp::IGNORECASE)
Regexp.compile('dog', option = nil, code = 'n')
Regexp.compile('dog', option = Regexp::IGNORECASE, code = 'n')
Regexp.compile('dog', option = nil)
Regexp.compile('dog', option = Regexp::IGNORECASE)
Regexp.compile(/^a-z+:\\s+\w+/)
end

Expand Down