From: yo@... Date: 2021-01-19T08:14:23+00:00 Subject: [ruby-core:102155] [Ruby master Bug#17559] Conflict with BasicSocket#send and Object#send Issue #17559 has been reported by sergioro (Sergio Romero). ---------------------------------------- Bug #17559: Conflict with BasicSocket#send and Object#send https://bugs.ruby-lang.org/issues/17559 * Author: sergioro (Sergio Romero) * Status: Open * Priority: Normal * ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- `Object#send` can be used in most objects like: ``` 's'.send :class => String ``` But `BasicSocket` objects call `BasicSocket#send` instead of `Object#send`: TCPSocket('example.com', 'echo').send :class Traceback (most recent call last): 22: from /home/sergioro/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `
' 21: from /home/sergioro/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `eval' 20: from /home/sergioro/.rvm/gems/ruby-2.7.0/bin/irb:23:in `
' 19: from /home/sergioro/.rvm/gems/ruby-2.7.0/bin/irb:23:in `load' 18: from /home/sergioro/.rvm/gems/ruby-2.7.0/gems/irb-1.3.1/exe/irb:11:in `' 1: from (irb):5:in `
' (irb):5:in `send': wrong number of arguments (given 1, expected 2..3) (ArgumentError) ``` How to call `Object#send` from a BasicSocket object? **Expected result:** ``` TCPSocket('example.com', 'echo').send :class => TCPSocket ``` -- https://bugs.ruby-lang.org/ Unsubscribe: