Actions
Bug #10006
closedinstance_exec uses incorrect binding with curried proc
Bug #10006:
instance_exec uses incorrect binding with curried proc
Description
After using Proc#curry, instanve_eval/instance_exec does not seem to work:
class Test
def test_func
140
end
end # => :test_func
p = ->(x, y) { x + y + test_func } # => #<Proc:0x007fd23b12bc80@(irb):6 (lambda)>
test = Test.new # => #<Test:0x007fd23b0f3d08>
test.instance_exec(1, 2, &p) # => 143
curried = p.curry[1] # => #<Proc:0x007fb3142be070 (lambda)>
test.instance_exec(2, &curried)
Actions