Actions
Bug #15613
closedEnumerator::Chain#each doesn't relay block signature
Bug #15613:
Enumerator::Chain#each doesn't relay block signature
Description
Currently, the block given when iterating on the components of a Enumerator::Chain always have arity of -1 and lambda? is always false:
class Foo
include Enumerable
def each(&block)
return to_enum unless block
p block.arity, block.lambda?
end
end
foo = Foo.new
foo.each(&->{}) # => 0, true
foo.each.each(&->{}) # => 0, true
foo.chain.each(&->{}) # => -1, false. Would ideally be 0, true
It would be preferable if the block information wasn't lost.
Files
Actions