diff --git a/core/match_data.rbs b/core/match_data.rbs index 494f2c338b..1d0a633701 100644 --- a/core/match_data.rbs +++ b/core/match_data.rbs @@ -45,7 +45,9 @@ # See also "Special global variables" section in Regexp documentation. # class MatchData - public + type capture = String | Symbol | int + + def initialize_copy: (MatchData instance) -> self # # Returns `true` if `object` is another MatchData object whose target string, @@ -53,7 +55,8 @@ class MatchData # # MatchData#eql? is an alias for MatchData#==. # - def ==: (untyped other) -> bool + def ==: (MatchData other) -> bool + | (untyped) -> false # # Returns the array of captures, which are all matches except `m[0]`: @@ -183,7 +185,7 @@ class MatchData # m = /(\d{2}):(\d{2}):(\d{2})/.match("18:37:22") # m.deconstruct_keys(nil) # => {} # - def deconstruct_keys: (Array[Symbol]?) -> Hash[Symbol, String?] + def deconstruct_keys: (Array[Symbol]? array_of_names) -> Hash[Symbol, String?] #