On this branch https://github.com/JuliaLang/julia/pull/16622 there is
*julia> **map(length, String[])*
*0-element Array{Int64,1}*
So, perhaps on 0.5 this will be "fixed".
On Monday, July 4, 2016 at 2:58:07 PM UTC-4, Jussi Piitulainen wrote:
>
> I browsed through some Github issues where this was discussed, but I'm
> unclear on the outcome. It's complicated.
>
> Is the result of `map` on an empty array going to be typed correctly any
> time soon? Ever? In 0.5, maybe? A comprehension seems to work now (this is
> on 0.4.6, the generic Linux binary), while `map` still inherits the type
> of the empty input array:
> ```julia
> julia> cumsum(map(length, UTF8String[]))
> ERROR: BoundsError: attempt to access 0-element Array{UTF8String,1}
> at index [1]
> in cumsum at arraymath.jl:450
>
> julia> cumsum([length(s) for s in UTF8String[]])
> 0-element Array{Int64,1}
>
> ```
> Some of my input arrays will be empty, so I need at least a temporary
> workaround, but should I give up on `map` altogether, or be patient?
>