Project

General

Profile

Actions

Bug #19721

closed

IO#timeout= can be called without required argument

Added by andrykonchin (Andrew Konchin) over 1 year ago. Updated over 1 year ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:113829]

Description

f = File.open("a.txt", "w")
f.timeout=() # => nil

IO#timeout= requires an argument (or it's supposed to require it) but if it's called as a method it seems the check is skipped and missing argument is treated as nil value.

If it's called with #send - then argument presence is checked:

f.send :"timeout="
# ...:in `timeout=': wrong number of arguments (given 0, expected 1) (ArgumentError)
Actions

Also available in: Atom PDF

Like0
Like1Like0Like0