Skip to content

Commit

Permalink
Revert "Merge pull request #1672 from ParadoxV5/string"
Browse files Browse the repository at this point in the history
This reverts commit 4eb84e2, reversing
changes made to bcf179c.
  • Loading branch information
soutaro committed Dec 20, 2023
1 parent 9d5a6e0 commit 2bba474
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
3 changes: 1 addition & 2 deletions core/string.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,6 @@ class String
# modification made, `self` otherwise.
#
def chomp!: (nil) -> nil
# | (?string separator) -> self? # https://github.com/ruby/rbs/pull/1672#discussion_r1423324796
| (?string? separator) -> self?

# <!--
Expand Down Expand Up @@ -2742,7 +2741,7 @@ class String
# "\x81"
# "\x81"
#
def scrub: (?string? replacement) -> String
def scrub: (?string replacement) -> String
| (?nil) { (String bytes) -> string } -> String

# <!--
Expand Down
10 changes: 0 additions & 10 deletions test/stdlib/String_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1281,11 +1281,6 @@ def test_scrub
assert_send_type '() -> String',
invalid, :scrub

assert_send_type '(nil) -> String',
valid, :scrub, nil
assert_send_type '(nil) -> String',
invalid, :scrub, nil

with_string '&' do |replacement|
assert_send_type '(string) -> String',
valid, :scrub, replacement
Expand Down Expand Up @@ -1315,11 +1310,6 @@ def test_scrub!
assert_send_type '() -> String',
invalid.dup, :scrub!

assert_send_type '(nil) -> String',
valid.dup, :scrub!, nil
assert_send_type '(nil) -> String',
invalid.dup, :scrub!, nil

with_string '&' do |replacement|
assert_send_type '(string) -> String',
valid.dup, :scrub!, replacement
Expand Down

0 comments on commit 2bba474

Please sign in to comment.