
Issue #19721 has been updated by andrykonchin (Andrew Konchin). Ah, I see. Thank you. ---------------------------------------- Bug #19721: IO#timeout= can be called without required argument https://bugs.ruby-lang.org/issues/19721#change-103480 * Author: andrykonchin (Andrew Konchin) * Status: Rejected * Priority: Normal * ruby -v: 3.2.1 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- ```ruby 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: ```ruby f.send :"timeout=" # ...:in `timeout=': wrong number of arguments (given 0, expected 1) (ArgumentError) ``` -- https://bugs.ruby-lang.org/