Skip to content

Commit

Permalink
Correct IO#autoclose= signature
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Mar 24, 2021
1 parent 2b18c08 commit 2c20223
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/io.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class IO < Object
# # ...
# f.gets # won't cause Errno::EBADF
#
def autoclose=: (bool) -> bool
def autoclose=: (boolish) -> untyped

# Returns `true` if the underlying file descriptor of *ios* will be closed
# automatically at its finalization, otherwise `false`.
Expand Down
4 changes: 4 additions & 0 deletions test/stdlib/IO_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ def test_autoclose=
io, :autoclose=, true
assert_send_type "(bool) -> bool",
io, :autoclose=, false
assert_send_type "(::Integer) -> ::Integer",
io, :autoclose=, 42
assert_send_type "(nil) -> nil",
io, :autoclose=, nil
end
end

Expand Down

0 comments on commit 2c20223

Please sign in to comment.