core/string.rbs in rbs-3.4.4 vs core/string.rbs in rbs-3.5.0.pre.1
- old
+ new
@@ -701,11 +701,11 @@
#
# The `string`, `encoding`, and `capacity` arguments may all be used together:
#
# String.new('hello', encoding: 'UTF-8', capacity: 25)
#
- def initialize: (?string source, ?encoding: encoding?, ?capacity: int?) -> self
+ def initialize: (?string source, ?encoding: encoding, ?capacity: int) -> void
# <!--
# rdoc-file=string.c
# - replace(other_string) -> self
# -->
@@ -1183,11 +1183,11 @@
# The form that take an Integer will raise an IndexError if the value is out of
# range; the Range form will raise a RangeError. If the beginning or ending
# offset does not land on character (codepoint) boundary, an IndexError will be
# raised.
#
- def bytesplice: (int start, int length, string str) -> String
+ def bytesplice: (Integer start, int length, string str) -> String
| (int start, int length, string str, int str_start, int str_length) -> String
| (range[int?] range, string str, ?range[int?] str_range) -> String
# <!--
# rdoc-file=string.c
@@ -2096,10 +2096,10 @@
# Returns an Enumerator if no `replacement` and no block given.
#
# Related: String#sub, String#gsub, String#sub!.
#
def gsub!: (Regexp | string pattern, string | hash[String, _ToS] replacement) -> self?
- | (Regexp | string pattern) -> Enumerator[String, self]
+ | (Regexp | string pattern) -> Enumerator[String, self?]
| (Regexp | string pattern) { (String match) -> _ToS } -> self?
# <!--
# rdoc-file=string.c
# - hash -> integer