ok I just filed one.
On Wednesday, June 1, 2016 at 5:16:04 AM UTC-7, Mauro wrote: > > Yes, this is a bug: ranges should behave as vectors in read-only > situations. I suspect that this is on the radar of the devs already as > there is quite a bit of work happening in this area. But still filing a > bug report, if one does not exist yet, is probably the right thing to do. > > On Wed, 2016-06-01 at 03:26, Anonymous <[email protected] <javascript:>> > wrote: > > Consider the code: > > > > filter(n -> true, collect(1:0)) > > > > this returns a 0-element array. However if I don't collect the iterator > > into an array: > > > > filter(n -> true, 1:0) > > > > I get the error > > > > Error: TypeError: typeassert: expected AbstractArray{Bool, N}, got > > Array{Int64, 1} in filter at array.jl:923 > > > > It seems like this should also return a 0-element array, since if the > > iterator is non empty, e.g. > > > > filter(n -> true, 1:2) > > > > I get a two the element array [1,2]. >
