
Issue #20325 has been updated by shan (Shannon Skipper). It seems like an infinite size with a `0` always has a product count of `0`. An infinite size preceding a `nil` has either a product count of `0` or infinity, but it's not lazily calculable so seems like it should be `nil`. ---------------------------------------- Bug #20325: Enumerator.product.size bug with zero * infinite enumerators https://bugs.ruby-lang.org/issues/20325#change-107153 * Author: marcandre (Marc-Andre Lafortune) * Status: Open * Target version: 3.4 * ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin22] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- ``` ruby Enumerator.product([], 1..).to_a # => [] (OK) Enumerator.product([], 1..).size # => Infinity (Should be 0) ``` -- https://bugs.ruby-lang.org/