Project

General

Profile

Actions

Feature #17745

closed

`IO#close_on_exec=` returns different value when called with `send, __send__, public_send` or not

Added by kachick (Kenichi Kamiya) about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:102998]

Description

$ ruby -v -e 'p(STDIN.close_on_exec = 42)'
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
42
$ ruby -v -e 'p(STDIN.__send__ :close_on_exec=, 42)'
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
nil

Is this an intentional behavior?
ruby/spec has the test case, But I can't think any benefit this different returning value 🤔

PR: https://github.com/ruby/ruby/pull/4321

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0