[ruby-core:80219] [Ruby trunk Bug#13325] Block is not passed to Symbol proc if using refinements

From: nobu@...
Date: 2017-03-18 14:14:19 UTC
List: ruby-core #80219
Issue #13325 has been reported by nobu (Nobuyoshi Nakada).

----------------------------------------
Bug #13325: Block is not passed to Symbol proc if using refinements
https://bugs.ruby-lang.org/issues/13325

* Author: nobu (Nobuyoshi Nakada)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED
----------------------------------------
The following code raises a `LocalJumpError` at the last line on 2.4 and trunk.
2.3 and earlier work fine.

```ruby
module M
  refine String do # or any class
  end
end
class C
  def call(a, x, &b)
    b.call(a, &x)
  end
end
o = C.new
x = ->(z){p z}
o.call(42, x, &:tap) #=> 42
using M
o.call(42, x, &:tap) #=> LocalJumpError
```



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next