The real problem is that eltype(t^2 for t in rand(10)) returns Any.
that is not a problem (t^2 for t in rand(10)) is a generator its element
type is Any which means a pointer to something complex.
On Friday, September 23, 2016 at 12:50:18 AM UTC+3, Steven G. Johnson wrote:
>
> I don't think the empty case should be the problem. If it can't infer the
> type, sum just throws an error. So test1(r) actually always returns the
> same type for r::Array{Float64} in any case where it returns a value at al.
>
> The real problem is that eltype(t^2 for t in rand(10)) returns Any.
>