From: kazuki@... Date: 2018-01-08T08:54:31+00:00 Subject: [ruby-dev:50414] [Ruby trunk Bug#14335] block.call should respect redefinition of Proc#call Issue #14335 has been reported by ktsj (Kazuki Tsujimoto). ---------------------------------------- Bug #14335: block.call should respect redefinition of Proc#call https://bugs.ruby-lang.org/issues/14335 * Author: ktsj (Kazuki Tsujimoto) * Status: Open * Priority: Normal * Assignee: * Target version: 2.6 * ruby -v: ruby 2.6.0dev (2018-01-08 master 61663) [x86_64-linux] * Backport: 2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONTNEED ---------------------------------------- r61659の変更によって、 ブロック引数に対してcallメソッドを呼び出したときに Proc#callの再定義が無視されるようになっています。 ~~~ $ cat t.rb Proc.prepend Module.new { def call p :call super end } def m(&blk) yield blk.call end m {} $ ruby -v t.rb ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux] :call $ ./ruby -v t.rb ruby 2.6.0dev (2018-01-08 master 61663) [x86_64-linux] ~~~ -- https://bugs.ruby-lang.org/