
Issue #20325 has been updated by eileencodes (Eileen Uchitelle). I don't think this is a bug, the documentation and tests say the current behavior is intentional:
"Returns the total size of the enumerator product calculated by multiplying the sizes of enumerables in the product. If any of the enumerables reports its size as nil or Float::INFINITY, that value is returned as the size."
https://docs.ruby-lang.org/en/master/Enumerator/Product.html#method-i-size ---------------------------------------- Bug #20325: Enumerator.product.size bug with zero * infinite enumerators https://bugs.ruby-lang.org/issues/20325#change-107131 * 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/