Project

General

Profile

Bug #7692

Enumerator::Lazy#drop_while and take_while should require a block.

Added by marcandre (Marc-Andre Lafortune) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
r38800
Backport:
[ruby-core:51422]

Description

Enumerator::Lazy#drop_while and take_while should require a block.

Currently:

[1].lazy.drop_while.force # => LocalJumpError: no block given
[1].lazy.take_while.force # => LocalJumpError: no block given

After patch, these will raise an ArgumentError "tried to call lazy drop_while without a block"

Also available in: Atom PDF