Actions
Bug #18067
closedComposite procs with `instance_exec` aren't executed within the context of the receiver
Bug #18067:
Composite procs with `instance_exec` aren't executed within the context of the receiver
Description
func1 = -> (x) { x + y }
class A
def y
10
end
end
A.new.instance_exec(1, &func1) # => 11
func2 = -> (x) { x * 2 }
f = func1 >> func2
A.new.instance_exec(1, &f) # => undefined local variable or method `y' for main:Object (NameError)
Actions