Project

General

Profile

Actions

Bug #18390

closed

Enumerator::Lazy#find returns invalid value

Added by cvss (Kirill Vechera) almost 3 years ago. Updated almost 3 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
[ruby-core:106510]

Description

There is a regression bug in #find

# RUBY_VERSION 3.0.2
[1, 2, 3, 4].lazy.find(&:even?) # => nil (ERROR!), expected 2
[1, 2, 3, 4].find(&:even?).find(&:even?) # => 2
# RUBY_VERSION 2.4.1
[1, 2, 3, 4].lazy.find(&:even?) # => 2
[1, 2, 3, 4].find(&:even?) # => 2

Files

ruby_bug.png (8.8 KB) ruby_bug.png cvss (Kirill Vechera), 12/06/2021 05:25 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0