@@ -641,7 +641,7 @@ julia> collect(Float64, 1:2:5)
641641collect(::Type{T}, itr) where {T} = _collect(T, itr, IteratorSize(itr))
642642
643643_collect(::Type{T}, itr, isz::Union{HasLength,HasShape}) where {T} =
644- copyto!(_array_for (T, isz, _similar_shape(itr, isz)), itr)
644+ copyto!(_array_for_inner (T, isz, _similar_shape(itr, isz)), itr)
645645function _collect(::Type{T}, itr, isz::SizeUnknown) where T
646646 a = Vector{T}()
647647 for x in itr
@@ -665,12 +665,12 @@ _similar_for(c::AbstractArray, ::Type{T}, itr, ::HasShape, axs) where {T} =
665665 similar(c, T, axs)
666666
667667# make a collection appropriate for collecting `itr::Generator`
668- _array_for (::Type{T}, ::SizeUnknown, ::Nothing) where {T} = Vector{T}(undef, 0)
669- _array_for (::Type{T}, ::HasLength, len::Integer) where {T} = Vector{T}(undef, Int(len))
670- _array_for (::Type{T}, ::HasShape{N}, axs) where {T,N} = similar(Array{T,N}, axs)
668+ _array_for_inner (::Type{T}, ::SizeUnknown, ::Nothing) where {T} = Vector{T}(undef, 0)
669+ _array_for_inner (::Type{T}, ::HasLength, len::Integer) where {T} = Vector{T}(undef, Int(len))
670+ _array_for_inner (::Type{T}, ::HasShape{N}, axs) where {T,N} = similar(Array{T,N}, axs)
671671
672672# used by syntax lowering for simple typed comprehensions
673- _array_for(::Type{T}, itr, isz) where {T} = _array_for (T, isz, _similar_shape(itr, isz))
673+ _array_for(::Type{T}, itr, isz) where {T} = _array_for_inner (T, isz, _similar_shape(itr, isz))
674674
675675
676676"""
@@ -789,10 +789,10 @@ function collect(itr::Generator)
789789 shp = _similar_shape(itr, isz)
790790 y = iterate(itr)
791791 if y === nothing
792- return _array_for (et, isz, shp)
792+ return _array_for_inner (et, isz, shp)
793793 end
794794 v1, st = y
795- dest = _array_for (typeof(v1), isz, shp)
795+ dest = _array_for_inner (typeof(v1), isz, shp)
796796 # The typeassert gives inference a helping hand on the element type and dimensionality
797797 # (work-around for #28382)
798798 et′ = et <: Type ? Type : et
0 commit comments