Project

General

Profile

Actions

Bug #14335

closed

block.call should respect redefinition of Proc#call

Added by ktsj (Kazuki Tsujimoto) about 6 years ago. Updated about 6 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 2.6.0dev (2018-01-08 master 61663) [x86_64-linux]
[ruby-dev:50414]

Description

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]

Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #14330: Speedup `block.call` where `block` is passed block parameter.Closedko1 (Koichi Sasada)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0