It seems like the compiler cannot infer the type of the tuple
b in the below MWE, while I think it should. This results in suboptimal performance. I can easily work around this, at the expense of code readability. Worth reporting?
js(n) = ntuple(i->i, n) foo(n, s) = exp.(im.*js(n).*s) function bar(s::Real) n = 5 b = foo(n, s) sum(b) end s = 1.0 @code_warntype bar(s) Variables: #self#::#bar s::Float64 n::Int64 b::ANY Body: begin # line 11: b::ANY = $(Expr(:invoke, MethodInstance for foo(::Int64, ::Float64), :(Main.foo), 5, :(s))) # line 12: return (Main.sum)(b::ANY)::ANY end::ANY