Project

General

Profile

Bug #7692

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

Added by Marc-Andre Lafortune almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
[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"

Associated revisions

Revision 38811
Added by Marc-Andre Lafortune almost 4 years ago

  • enumerator.c: Require block for Lazy#{take|drop}_while [Bug #7692]

Revision 38811
Added by Marc-Andre Lafortune almost 4 years ago

  • enumerator.c: Require block for Lazy#{take|drop}_while [Bug #7692]

Revision 38811
Added by Marc-Andre Lafortune almost 4 years ago

  • enumerator.c: Require block for Lazy#{take|drop}_while [Bug #7692]

History

#1 Updated by Marc-Andre Lafortune almost 4 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r38811.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • enumerator.c: Require block for Lazy#{take|drop}_while [Bug #7692]

Also available in: Atom PDF