@@ -14,13 +14,17 @@ using .Base:
1414 @propagate_inbounds , @isdefined , @boundscheck , @inbounds , Generator,
1515 AbstractRange, AbstractUnitRange, UnitRange, LinearIndices,
1616 (:), | , + , - , * , != = , ! , == , != , <= , < , > , >= , missing ,
17- any, _counttuple, eachindex, ntuple, zero, prod, in, firstindex, lastindex,
17+ any, _counttuple, eachindex, ntuple, zero, prod, reduce, in, firstindex, lastindex,
1818 tail, fieldtypes, min, max, minimum, zero, oneunit, promote, promote_shape
1919using Core: @doc
2020
2121if Base != = Core. Compiler
2222using . Base:
2323 cld, fld, SubArray, view, resize!, IndexCartesian
24+ using . Base. Checked: checked_mul
25+ else
26+ # Checked.checked_mul is not available during bootstrapping:
27+ const checked_mul = *
2428end
2529
2630import . Base:
@@ -1055,7 +1059,7 @@ _prod_axes1(a, A) =
10551059 throw (ArgumentError (" Cannot compute indices for object of type $(typeof (a)) " ))
10561060
10571061ndims (p:: ProductIterator ) = length (axes (p))
1058- length (P:: ProductIterator ) = prod ( size (P))
1062+ length (P:: ProductIterator ) = reduce (checked_mul, size (P); init = 1 )
10591063
10601064IteratorEltype (:: Type{ProductIterator{Tuple{}}} ) = HasEltype ()
10611065IteratorEltype (:: Type{ProductIterator{Tuple{I}}} ) where {I} = IteratorEltype (I)
0 commit comments