I can a see a point in what you say .. eltype of a function should be the return type of that function if it can be inferred. Because an array is just a special kind of function with a special notation.
On Friday, 23 September 2016, Steven G. Johnson <[email protected]> wrote: > > > On Thursday, September 22, 2016 at 6:10:29 PM UTC-4, Tsur Herman wrote: >> >> 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. >> >>> > It is a problem, because it means that the result type of sum cannot be > inferred. > > We could use type inference on the function t -> t^2 (which is buried in > the generator) to determine a more specific eltype. >
