From: "mame (Yusuke Endoh)" Date: 2021-12-06T14:04:57+00:00 Subject: [ruby-core:106515] [Ruby master Bug#18390] Enumerator::Lazy#find returns invalid value Issue #18390 has been updated by mame (Yusuke Endoh). I cannot reproduce the issue ``` $ ~/local/bin/ruby -ve 'p [1, 2, 3, 4].lazy.find(&:even?)' ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux] 2 ``` Could you please elaborate what did you do? How did you install your ruby? What platform are you using? Is the script complete? How did you run the script? ---------------------------------------- Bug #18390: Enumerator::Lazy#find returns invalid value https://bugs.ruby-lang.org/issues/18390#change-95176 * Author: cvss (Kirill Vechera) * Status: Open * Priority: Normal * ruby -v: 3.0.2 * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- There is a regression bug in `#find` ```ruby # 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 ``` -- https://bugs.ruby-lang.org/ Unsubscribe: