julia> foo(x) = 0
foo (generic function with 1 method)
julia> foo(x::Int) = 0.0
foo (generic function with 2 methods)
julia> foo.(Any[1, 2, 3])
3-element Array{Float64,1}:
0.0
0.0
0.0
julia> foo.(Number[1, 2, 3])
3-element Array{Number,1}:
0.0
0.0
0.0
My understanding was that the actual return type should be used for
nonempty collections, instead of the promote_op business, so the return
value of foo.(Number[1, 2, 3]) should be a Vector{Float64}. (Both map and
comprehensions have that behaviour.) This seems not to be the case. Is this
planned to be fixed, or is my understanding of broadcast's semantics
incorrect?