Skip to content

Commit

Permalink
Merge pull request #1040 from ruby/regexp-new
Browse files Browse the repository at this point in the history
Change `Regexp.new` type
  • Loading branch information
soutaro authored Jun 20, 2022
2 parents 585fe7d + fe93955 commit 24c16f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/regexp.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ class Regexp
# r3 = Regexp.new(r2) #=> /cat/i
# r4 = Regexp.new('dog', Regexp::EXTENDED | Regexp::IGNORECASE) #=> /dog/ix
#
def initialize: (String string, ?untyped options, ?String kcode) -> Object
def initialize: (String string, ?Integer | nil | false options, ?String kcode) -> Object
| (Regexp regexp) -> void

# <!--
Expand All @@ -769,8 +769,7 @@ class Regexp
# -->
# Alias for Regexp.new
#
def self.compile: (String string, ?untyped options, ?String kcode) -> Regexp
| (Regexp regexp) -> Regexp
alias self.compile self.new

# <!--
# rdoc-file=re.c
Expand Down

0 comments on commit 24c16f6

Please sign in to comment.